JFile seems to work well now.

This commit is contained in:
Brad Arant committed 2025-12-09 08:46:33 -08:00
1 parent ffa3361fd2
commit ab748802ee
5 files changed
+3 -24

No files matched your search

+2 -2
View File
@@ -19,8 +19,8 @@ namespace coreutils {
}
MString CGIFormData::operator[](ZString name) {
if(contentType == "application/x-www-form-urlencoded")
return formdata[name];
// if(contentType == "application/x-www-form-urlencoded")
// return formdata[name];
return name;
}
-1
View File
@@ -7,7 +7,6 @@ namespace coreutils {
MFile::MFile(coreutils::MString fileName) : fileName(fileName) {
inFile.open(fileName.c_str());
*this << inFile;
// inFile >> *this;
inFile.close();
}
BIN
View File
Binary file not shown.
-20
View File
@@ -6,15 +6,9 @@
int main(int argc, char **argv) {
coreutils::MString test0("{ \"Number\": \"0\", \"id\": \"XXXXX\" }");
coreutils::JFile test1("jfile_test.data");
coreutils::JString test9;
test1 = test0;
std::cout << test1 << std::endl;
std::cout << test1["id"] << std::endl;
test1["name"] = "Cohen";
std::cout << test1 << std::endl;
@@ -32,9 +26,6 @@ int main(int argc, char **argv) {
std::cout << test1 << std::endl;
coreutils::ZString test2 = test1["name"];
std::cout << test2 << std::endl;
std::cout << test1["name"] << std::endl;
std::cout << test1["health"] << std::endl;
std::cout << test1["comment"] << std::endl;
@@ -50,17 +41,6 @@ int main(int argc, char **argv) {
std::cout << test1["array[1]"] << std::endl;
std::cout << test1["array[2]"] << std::endl;
std::string string1 = test1["tester"];
std::cout << "from string: " << string1 << std::endl;
coreutils::MString testout;
testout << "this is a test: " << test1["comment"];
std::cout << testout << std::endl;
test9 = test1["object1"];
std::cout << test9 << std::endl;
std::cout << test9["attr3"] << std::endl;
std::cout << test1.pretty() << std::endl;
return 0;
+1 -1
View File
@@ -1 +1 @@
{}
{"name":"Cohen","health":"100","comment":"this is a comment","racex":"elvin","race":"human","array":["test1","test2","test3"],"tester":"test field","object1":{"attr1":"value1","attr2":{"xattr1":"xvalue1","xattr2":"xvalue2","xattr3":"xvalue3"},"attr3":"Im not an object"}}