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.
MVJSONValue Class Reference
JSON Value. More...
#include <JsonParser.h>
Inherits JSON::MVJSONUtils.
Public Member Functions | |
| double | getFieldDouble (string name) |
| get value of double field of VALUE OBJECT (objValue) | |
| int | getFieldInt (string name) |
| get value of int field of VALUE OBJECT (objValue) | |
| string | getFieldString (string name) |
| get value of string field of VALUE OBJECT (objValue) | |
| bool | getFieldBool (string name) |
| get value of bool field of VALUE OBJECT (objValue) | |
Data Fields | |
| string | name |
| value name [optional] | |
| MVJSON_TYPE | valueType |
| type of node | |
| string | stringValue |
| value if data has string type | |
| bool | boolValue |
| value if data has bool type | |
| int | intValue |
| value if data has int type | |
| double | doubleValue |
| value if data has double type | |
| MVJSONNode * | objValue |
| value if data has object type | |
| vector< MVJSONValue * > | arrayValue |
| array of values | |
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
JSON Value.
Definition at line 76 of file JsonParser.h.
Member Function Documentation
| bool getFieldBool | ( | string | name ) |
get value of bool field of VALUE OBJECT (objValue)
Definition at line 289 of file JsonParser.cpp.
| double getFieldDouble | ( | string | name ) |
get value of double field of VALUE OBJECT (objValue)
Definition at line 271 of file JsonParser.cpp.
| int getFieldInt | ( | string | name ) |
get value of int field of VALUE OBJECT (objValue)
Definition at line 277 of file JsonParser.cpp.
| string getFieldString | ( | string | name ) |
get value of string field of VALUE OBJECT (objValue)
Definition at line 283 of file JsonParser.cpp.
| 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
| vector<MVJSONValue*> arrayValue |
array of values
Definition at line 95 of file JsonParser.h.
| bool boolValue |
value if data has bool type
Definition at line 90 of file JsonParser.h.
| double doubleValue |
value if data has double type
Definition at line 92 of file JsonParser.h.
| int intValue |
value if data has int type
Definition at line 91 of file JsonParser.h.
| string name |
value name [optional]
Definition at line 86 of file JsonParser.h.
value if data has object type
Definition at line 93 of file JsonParser.h.
| string stringValue |
value if data has string type
Definition at line 89 of file JsonParser.h.
| MVJSON_TYPE valueType |
type of node
Definition at line 87 of file JsonParser.h.
Generated on Tue Jul 12 2022 18:55:02 by
1.7.2