Working flat JString sorta

This commit is contained in:
Brad Arant committed 2023-10-09 19:31:12 -07:00
1 parent 7b333a3984
commit 74ab316e64
7 files changed
+65 -95

No files matched your search

Binary file not shown.
+24 -7
View File
@@ -16,20 +16,37 @@ int main(int argc, char **argv) {
// test1.set("key4", "data4");
// std::cout << test1 << std::endl;
coreutils::JString test2("{\"key1\":[{\"id\":\"1\",\"name\":\"Brad\"},{\"id\":\"2\",\"name\":\"Jenn\"},{\"id\":\"3\",\"name\":\"Skye\"}],\"key2\":\"data5\",\"key3\":\"data3\",\"key4\":\"data4\"}");
std::cout << test2 << std::endl;
std::cout << "--------" << std::endl;
// coreutils::JString test2("{\"key1\":[{\"id\":\"1\",\"name\":\"Brad\"},{\"id\":\"2\",\"name\":\"Jenn\"},{\"id\":\"3\",\"name\":\"Skye\"}],\"key2\":\"data5\",\"key3\":\"data3\",\"key4\":\"data4\"}");
// std::cout << test2 << std::endl;
// std::cout << "--------" << std::endl;
// std::cout << test2["key2"] << std::endl;
// std::cout << test2["key1"] << std::endl;
// std::cout << "value: " << test2["key1.name[id=2]"] << std::endl;
// std::cout << "value: " << test2["key1.name[id=3]"] << std::endl;
test2["key2"] = "newvalue1";
std::cout << "--------" << std::endl;
// test2["key2"] = "newvalue1";
// std::cout << "--------" << std::endl;
// test2 = "newvalue";
// std::cout << test2 << std::endl;
// std::cout << "--------" << std::endl;
// std::cout << "key2: " << test2["key2"] << std::endl;
coreutils::JString test1;
coreutils::MString test2;
test1["name"] = "Cohen";
test1["health"] = "100";
test1["comment"] = "this is a comment";
test1["race"] = "human";
std::cout << test1 << std::endl;
test2 = test1["name"];
std::cout << test2 << std::endl;
std::cout << "--------" << std::endl;
std::cout << "key2: " << test2["key2"] << std::endl;
test2 = test1["health"];
std::cout << test2 << std::endl;
test2 = test1["comment"];
std::cout << test2 << std::endl;
test2 = test1["race"];
std::cout << test2 << std::endl;
// std::cout << "[" << test1["name"] << std::endl;
return 0;
}
Binary file not shown.
+3 -1
View File
@@ -64,7 +64,9 @@ int main(int argc, char **argv) {
coreutils::MString test21;
test21 = test20;
std::cout << "mstring = zstring: [" << test21 << "]" << std::endl;
coreutils::MString test22;
test22 << test20;
std::cout << "mstring << zstring: [" << test22 << "]" << std::endl;
return 0;
}