bool VJSONSingleObjectWriter::AddMember( const VString& inName, const VValueSingle &inValue, JSONOption inModifier) { bool ok = false; VString valueString; if(testAssert(inValue.GetJSONString( valueString, inModifier) == VE_OK) && !inName.IsEmpty()) { if (fIsClosed) { fObject.Remove( fObject.GetLength(), 1); fIsClosed = false; } if (fMembersCount > 0) fObject.AppendUniChar( ','); fObject.AppendUniChar( '"'); fObject.AppendString( inName); fObject.AppendUniChar( '"'); fObject.AppendUniChar( ':'); fObject.AppendString( valueString); ++fMembersCount; ok = true; } return ok; }
void VJSONArrayWriter::Add(const VValueSingle &inAny, JSONOption inModifier) { VString aStr; if(testAssert(inAny.GetJSONString(aStr, inModifier) == VE_OK)) { _ReopenIfNeeded(); fArrayRef += aStr; fArrayRef += ","; } }