示例#1
0
 void JSONObject::emplace( const String& key, const JSONValue& value ){
   if( !key.empty() && value.isValid() ){
     if( m_members.isNull() ){
       m_members = new std::map<String, JSONValue>();
     }
     m_members->insert( m_members->end(), std::make_pair( key, value ) );
   }
 }
示例#2
0
    void JSONArray::appendValue( const JSONValue& value){
      if( value.isValid() ){
        if( m_elements.isNull()  ){
          m_elements = Elements( new std::vector<JSONValue>() );          
        }

        m_elements->push_back( value );
      }
    }