Major Update:

- Bug fix: BufferCore - set correct auto buffer size
- Change Get/Set methods to use BaseReference and full path instead of
    ParentPath and MemberName
- Add Create param to all Get methods (create if not found)
- Implement arrays & parsing of arrays
- Set CJSONparse as friend class to DataTree (access protected methods)
- Print JSON to screen
This commit is contained in:
Charl Wentzel
2017-03-26 22:26:52 +02:00
parent b823bd7ea7
commit a22f60b152
5 changed files with 640 additions and 424 deletions

View File

@@ -61,18 +61,23 @@ private:
BufPos++;
}
}
bool ParseString( char ** Value, int &pLen );
bool ParseObject( TDataMember * Object );
bool ParseString( char ** Value, int * pLen = NULL, EDataType * pType = NULL );
bool ParsePrimitive( char ** Value, int * pLen = NULL, EDataType * pType = NULL );
bool ParseArray( TDataMember * Array );
bool ParseString( TDataMember * Member );
bool ParsePrimitive( TDataMember * Member );
bool SaveObject( TDataMember * Object, const int Indent );
bool PrintObject( TDataMember * Object, const int Indent );
bool PrintArray( TDataMember * Object, const int Indent );
public:
CJSONparse( CDataTree * pDataTree );
~CJSONparse();
bool LoadFile( const char * FilePath, int pBufLen = 500 );
bool SaveFile( const char * FilePath, const int ValueTab = 20 );
bool PrintToScreen( const int Indent );
bool LoadFromFile( const char * FilePath, int pBufLen = 500 );
bool SaveToFile( const char * FilePath, const int Indent = 2 );
const char * GetError() { return ((Error)? ErrorText : "Success"); };
};