Compare commits

...

4 Commits

7 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@ File to read: "read.json"
Reading a file is done like this:
@snippet read.cpp ejson_sample_read_file
The file naming is manage by @ref etk::FSNode that provide "DATA:" start string for internal application asset. You can use external path like "./plop/file.json" too.
The file naming is manage by @ref etk::FSNode that provide "DATA:///" start string for internal application asset. You can use external path like "./plop/file.json" too.
Read an JSON Stream {#ejson_tutorial_read_stream}

View File

@ -85,7 +85,7 @@ bool ejson::internal::Document::store(const etk::Uri& _uri) {
EJSON_ERROR("Can not open (r) the file : " << _uri);
return false;
}
fileIo->fileWriteAll(createData);
fileIo->writeAll(createData);
fileIo->close();
return true;
}

View File

@ -1,5 +1,5 @@
#!/usr/bin/python
import lutin.debug as debug
import realog.debug as debug
import lutin.tools as tools
def get_type():

View File

@ -1,5 +1,5 @@
#!/usr/bin/python
import lutin.debug as debug
import realog.debug as debug
import lutin.tools as tools

View File

@ -1,5 +1,5 @@
#!/usr/bin/python
import lutin.debug as debug
import realog.debug as debug
import lutin.tools as tools

View File

@ -16,7 +16,7 @@ static void readFromFile() {
ejson::Document doc;
//! [ejson_sample_declare_doc]
//! [ejson_sample_read_file]
bool retParse = doc.load("DATA:read.json");
bool retParse = doc.load(etk::Uri("DATA:///read.json"));
//! [ejson_sample_read_file]
TEST_INFO("parse ret = " << retParse);
TEST_INFO("Debug display of the tree:");
@ -76,7 +76,7 @@ static void readFromString2() {
static void readFull() {
ejson::Document doc;
TEST_INFO("parse");
bool retParse = doc.load("DATA:read.json");
bool retParse = doc.load(etk::Uri("DATA:///read.json"));
TEST_INFO("parse ret = " << retParse);
TEST_INFO("Debug display of the tree:");
doc.display();

View File

@ -16,10 +16,10 @@ static void writeToFile() {
doc.add("D", ejson::Array());
TEST_INFO("store");
//! [ejson_sample_write_file]
bool retGenerate = doc.store("generate.json");
bool retGenerate = doc.store(etk::Path("generate.json"));
//! [ejson_sample_write_file]
//! [ejson_sample_write_file_safe_mode]
retGenerate = doc.storeSafe("generate.json");
retGenerate = doc.storeSafe(etk::Path("generate.json"));
//! [ejson_sample_write_file_safe_mode]
TEST_INFO("parse ret = " << retGenerate);
TEST_INFO("Debug display of the tree:");