Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MVJSONReader Class Reference
Compact JSON parser (based on specification: http://www.json.org/) More...
#include <JsonParser.h>
Inherits JSON::MVJSONUtils.
Public Member Functions | |
| MVJSONReader (const string &source) | |
| constructor from json source | |
Data Fields | |
| MVJSONNode * | root |
| root object (if its null - parsing was failed) | |
Static Protected Member Functions | |
| static int | stringToInt (const string &s) |
| convert string to int | |
| static double | stringToDouble (const string &s) |
| convert string to float | |
| static bool | symbolToBeTrimmed (const char &c) |
| check if symbol is space, tab or new line break | |
| static string | trim (const string &text) |
| trim spaces, tabs and line break | |
| static void | replace (string &target, const string &oldStr, const string &newStr) |
| replace all occurrences of substring | |
| static void | splitInHalf (const string &s, const string &separator, string &begin, string &end) |
| second half (output) | |
| static void | splitList (const string &s, vector< string > &parts) |
| split string by "," - ignore content inside of "{", "}", "[", "]" and quotations "...." also take " into account (Code should be cleared of comments beforehand) | |
Detailed Description
Compact JSON parser (based on specification: http://www.json.org/)
Definition at line 126 of file JsonParser.h.
Constructor & Destructor Documentation
| MVJSONReader | ( | const string & | source ) |
constructor from json source
Definition at line 40 of file JsonParser.cpp.
Member Function Documentation
| void replace | ( | string & | target, |
| const string & | oldStr, | ||
| const string & | newStr | ||
| ) | [static, protected, inherited] |
replace all occurrences of substring
- Parameters:
-
target text to be modified oldStr old string newStr new string
Definition at line 240 of file JsonParser.h.
| void splitInHalf | ( | const string & | s, |
| const string & | separator, | ||
| string & | begin, | ||
| string & | end | ||
| ) | [static, protected, inherited] |
second half (output)
- Parameters:
-
s source string to split up separator separator string) begin first part (output) end second half (output)
Definition at line 181 of file JsonParser.h.
| void splitList | ( | const string & | s, |
| vector< string > & | parts | ||
| ) | [static, protected, inherited] |
split string by "," - ignore content inside of "{", "}", "[", "]" and quotations "...." also take " into account (Code should be cleared of comments beforehand)
- Parameters:
-
s string to be splitted parts result parts
Definition at line 197 of file JsonParser.h.
| double stringToDouble | ( | const string & | s ) | [static, protected, inherited] |
convert string to float
Definition at line 151 of file JsonParser.h.
| int stringToInt | ( | const string & | s ) | [static, protected, inherited] |
convert string to int
Definition at line 145 of file JsonParser.h.
| bool symbolToBeTrimmed | ( | const char & | c ) | [static, protected, inherited] |
check if symbol is space, tab or new line break
- Parameters:
-
c the char to test
Definition at line 157 of file JsonParser.h.
| string trim | ( | const string & | text ) | [static, protected, inherited] |
trim spaces, tabs and line break
- Parameters:
-
text the text to trim
Definition at line 168 of file JsonParser.h.
Field Documentation
root object (if its null - parsing was failed)
Definition at line 131 of file JsonParser.h.
Generated on Tue Jul 12 2022 18:55:02 by
1.7.2