[DEV] change default Instance

This commit is contained in:
Edouard DUPIN 2014-08-13 22:30:47 +02:00
parent d9c98697ed
commit 53e2f04072
3 changed files with 8 additions and 8 deletions

View File

@ -26,7 +26,7 @@ bool ejson::Number::iParse(const std::string& _data, size_t& _pos, ejson::filePo
tmpVal+=_data[iii]; tmpVal+=_data[iii];
} else { } else {
_pos = iii-1; _pos = iii-1;
m_value = std::stod(tmpVal); m_value = etk::string_to_double(tmpVal);
JSON_PARSE_ELEMENT("end parse : 'Number' " << tmpVal << " >> " << m_value); JSON_PARSE_ELEMENT("end parse : 'Number' " << tmpVal << " >> " << m_value);
return true; return true;
} }
@ -41,9 +41,9 @@ bool ejson::Number::iGenerate(std::string& _data, size_t _indent) const {
// special thing to remove .000000 at the end of perfect number ... // special thing to remove .000000 at the end of perfect number ...
int64_t tmpVal = m_value; int64_t tmpVal = m_value;
if ((double)tmpVal == m_value) { if ((double)tmpVal == m_value) {
_data += std::to_string(tmpVal); _data += etk::to_string(tmpVal);
} else { } else {
_data += std::to_string(m_value); _data += etk::to_string(m_value);
} }
return true; return true;
} }

View File

@ -149,7 +149,7 @@ void ejson::Document::displayError() {
void ejson::Document::createError(const std::string& _data, size_t _pos, const ejson::filePos& _filePos, const std::string& _comment) { void ejson::Document::createError(const std::string& _data, size_t _pos, const ejson::filePos& _filePos, const std::string& _comment) {
m_comment = _comment; m_comment = _comment;
m_Line = extract_line(_data, _pos); m_Line = etk::extract_line(_data, _pos);
m_filePos = _filePos; m_filePos = _filePos;
if (true == m_writeErrorWhenDetexted) { if (true == m_writeErrorWhenDetexted) {
displayError(); displayError();

View File

@ -518,8 +518,8 @@ int main(int argc, const char *argv[]) {
JSON_INFO("[TEST] " << sectionID << ":" << jjj << " { OK } Result in error (normal case)"); JSON_INFO("[TEST] " << sectionID << ":" << jjj << " { OK } Result in error (normal case)");
} else { } else {
JSON_ERROR("[TEST] " << sectionID << ":" << jjj << " {ERROR } different output"); JSON_ERROR("[TEST] " << sectionID << ":" << jjj << " {ERROR } different output");
std::vector<std::string> tmpout = std::split(out, '\n'); std::vector<std::string> tmpout = etk::split(out, '\n');
std::vector<std::string> tmpref = std::split(l_list[iii].m_ref, '\n'); std::vector<std::string> tmpref = etk::split(l_list[iii].m_ref, '\n');
//JSON_ERROR("generate : \n" << out); //JSON_ERROR("generate : \n" << out);
//JSON_ERROR("reference : \n" << l_list[iii].m_ref); //JSON_ERROR("reference : \n" << l_list[iii].m_ref);
for (int32_t jjj=0; jjj<tmpout.size() || jjj<tmpref.size(); ++jjj) { for (int32_t jjj=0; jjj<tmpout.size() || jjj<tmpref.size(); ++jjj) {
@ -538,8 +538,8 @@ int main(int argc, const char *argv[]) {
} }
if (l_list[iii].m_errorPos == 3) { if (l_list[iii].m_errorPos == 3) {
JSON_ERROR("[TEST] " << sectionID << ":" << jjj << " {ERROR} checking result might be in error..."); JSON_ERROR("[TEST] " << sectionID << ":" << jjj << " {ERROR} checking result might be in error...");
std::vector<std::string> tmpout = std::split(out, '\n'); std::vector<std::string> tmpout = etk::split(out, '\n');
std::vector<std::string> tmpref = std::split(l_list[iii].m_ref, '\n'); std::vector<std::string> tmpref = etk::split(l_list[iii].m_ref, '\n');
//JSON_ERROR("generate : \n" << out); //JSON_ERROR("generate : \n" << out);
//JSON_ERROR("reference : \n" << l_list[iii].m_ref); //JSON_ERROR("reference : \n" << l_list[iii].m_ref);
for (int32_t jjj=0; jjj<tmpout.size() || jjj<tmpref.size(); ++jjj) { for (int32_t jjj=0; jjj<tmpout.size() || jjj<tmpref.size(); ++jjj) {