diff --git a/CGIFormData.cpp b/CGIFormData.cpp index 59e0977..ca969b3 100644 --- a/CGIFormData.cpp +++ b/CGIFormData.cpp @@ -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; } diff --git a/MFile.cpp b/MFile.cpp index 314af2e..b30c37f 100644 --- a/MFile.cpp +++ b/MFile.cpp @@ -7,7 +7,6 @@ namespace coreutils { MFile::MFile(coreutils::MString fileName) : fileName(fileName) { inFile.open(fileName.c_str()); *this << inFile; -// inFile >> *this; inFile.close(); } diff --git a/testing/jfile_test b/testing/jfile_test new file mode 100755 index 0000000..6dda3b7 Binary files /dev/null and b/testing/jfile_test differ diff --git a/testing/jfile_test.cpp b/testing/jfile_test.cpp index 177add5..fa2e602 100644 --- a/testing/jfile_test.cpp +++ b/testing/jfile_test.cpp @@ -6,14 +6,8 @@ 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"; @@ -31,9 +25,6 @@ int main(int argc, char **argv) { // test1["age"] = 64; future 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; @@ -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; diff --git a/testing/jfile_test.data b/testing/jfile_test.data index 9e26dfe..13ec87c 100644 --- a/testing/jfile_test.data +++ b/testing/jfile_test.data @@ -1 +1 @@ -{} \ No newline at end of file +{"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"}}