Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Delete childer node

Help
Anonymous
2012-06-30
2013-06-12

  • Anonymous
    2012-06-30

    Hi.
    I can't delete childer node.

    JSONNode::json_iterator session = n.find_nocase("session");
    n.erase(session->begin(), session->end() + 1);
    

    It doesn't work, if session is childern node. For example.
    {
      "session" : "ttttt"
    }
    Here It works.

    But here doesn't work.
    {
      "point" : {
           "session" : "ttttt"
      }
    }

    Please, help me.
    Thanks.

     

  • Anonymous
    2012-06-30

    Sorry, I wrote nonsense.
    My code islike this.

    JSONNode::json_iterator session = n.find_nocase("session");
    n.erase(session, session + 1);
    
     
  • I will have to look into it, are you sure session+1 is a valid address.