JString now streams properly.
This commit is contained in:
1 parent
0baa44d076
commit
7531c885a7
5 files changed
+57
-122
No files matched your search
Binary file not shown.
@@ -5,8 +5,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
coreutils::MString test0("{\"Number:\"0\",\"id\":\"XXXXX\"}");
|
||||
coreutils::JString test1;
|
||||
coreutils::MString test2;
|
||||
|
||||
test1 = test0;
|
||||
|
||||
test1["name"] = "Cohen";
|
||||
test1["health"] = "100";
|
||||
test1["comment"] = "this is a comment";
|
||||
@@ -15,17 +16,18 @@ int main(int argc, char **argv) {
|
||||
test1["tester"] = "test field";
|
||||
test1["object1"] = "{\"attr1\":\"value1\",\"attr2\":\"value2\",\"attr3\":\"value3\"}";
|
||||
|
||||
|
||||
std::cout << test1 << std::endl;
|
||||
|
||||
coreutils::MString test2 = test1["name"];
|
||||
std::cout << test2 << std::endl;
|
||||
|
||||
std::cout << test1["id"] << std::endl;
|
||||
std::cout << test1["name"] << std::endl;
|
||||
std::cout << test1["health"] << std::endl;
|
||||
std::cout << test1["comment"] << std::endl;
|
||||
std::cout << test1["race"] << std::endl;
|
||||
std::cout << test1["array"] << std::endl;
|
||||
std::cout << test1["tester"] << std::endl;
|
||||
std::cout << test1["object"] << std::endl;
|
||||
std::cout << test1["object1"] << std::endl;
|
||||
std::cout << test1["object1.attr2"] << std::endl;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user