From 7593b52dd9657301370c31d7a97465fa7b450ae0 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 27 Nov 2013 21:33:34 +0100 Subject: [PATCH] [DEV] add extra compilation flags & correct warning --- ejson/Array.cpp | 34 +++++++++++++++++----------------- ejson/Array.h | 30 +++++++++++++++--------------- ejson/Boolean.cpp | 4 ++-- ejson/Boolean.h | 4 ++-- ejson/Null.cpp | 4 ++-- ejson/Null.h | 4 ++-- ejson/Number.cpp | 6 +++--- ejson/Number.h | 4 ++-- ejson/Object.cpp | 16 ++++++++-------- ejson/Object.h | 10 ++++------ ejson/String.cpp | 6 +++--- ejson/String.h | 17 ++++++++++++----- ejson/Value.cpp | 10 +++++----- ejson/Value.h | 23 +++++++++++------------ ejson/ejson.cpp | 16 ++++++++-------- ejson/ejson.h | 12 +++++------- lutin_ejson.py | 2 ++ 17 files changed, 103 insertions(+), 99 deletions(-) diff --git a/ejson/Array.cpp b/ejson/Array.cpp index 66c63bc..6e1165a 100644 --- a/ejson/Array.cpp +++ b/ejson/Array.cpp @@ -21,7 +21,7 @@ void ejson::Array::clear(void) { - for (esize_t iii=0; iii3) { oneLine=false; } else { - for (esize_t iii=0; iiitoObject(); } -ejson::String* ejson::Array::getString(esize_t _id) { +ejson::String* ejson::Array::getString(size_t _id) { ejson::Value* tmpElement = m_value[_id]; if (NULL == tmpElement) { return NULL; @@ -266,7 +266,7 @@ ejson::String* ejson::Array::getString(esize_t _id) { return tmpElement->toString(); } -ejson::Array* ejson::Array::getArray(esize_t _id) { +ejson::Array* ejson::Array::getArray(size_t _id) { ejson::Value* tmpElement = m_value[_id]; if (NULL == tmpElement) { return NULL; @@ -274,7 +274,7 @@ ejson::Array* ejson::Array::getArray(esize_t _id) { return tmpElement->toArray(); } -ejson::Null* ejson::Array::getNull(esize_t _id) { +ejson::Null* ejson::Array::getNull(size_t _id) { ejson::Value* tmpElement = m_value[_id]; if (NULL == tmpElement) { return NULL; @@ -282,7 +282,7 @@ ejson::Null* ejson::Array::getNull(esize_t _id) { return tmpElement->toNull(); } -ejson::Number* ejson::Array::getNumber(esize_t _id) { +ejson::Number* ejson::Array::getNumber(size_t _id) { ejson::Value* tmpElement = m_value[_id]; if (NULL == tmpElement) { return NULL; @@ -290,7 +290,7 @@ ejson::Number* ejson::Array::getNumber(esize_t _id) { return tmpElement->toNumber(); } -ejson::Boolean* ejson::Array::getBoolean(esize_t _id) { +ejson::Boolean* ejson::Array::getBoolean(size_t _id) { ejson::Value* tmpElement = m_value[_id]; if (NULL == tmpElement) { return NULL; @@ -298,7 +298,7 @@ ejson::Boolean* ejson::Array::getBoolean(esize_t _id) { return tmpElement->toBoolean(); } -const std::string& ejson::Array::getStringValue(esize_t _id) { +const std::string& ejson::Array::getStringValue(size_t _id) { static const std::string errorValue(""); ejson::String* tmpElement = getString(_id); if (NULL == tmpElement) { @@ -307,7 +307,7 @@ const std::string& ejson::Array::getStringValue(esize_t _id) { return tmpElement->get(); } -std::string ejson::Array::getStringValue(esize_t _id, const std::string& _errorValue) { +std::string ejson::Array::getStringValue(size_t _id, const std::string& _errorValue) { ejson::String* tmpElement = getString(_id); if (NULL == tmpElement) { return _errorValue; @@ -315,7 +315,7 @@ std::string ejson::Array::getStringValue(esize_t _id, const std::string& _errorV return tmpElement->get(); } -double ejson::Array::getNumberValue(esize_t _id, double _errorValue) { +double ejson::Array::getNumberValue(size_t _id, double _errorValue) { ejson::Number* tmpElement = getNumber(_id); if (NULL == tmpElement) { return _errorValue; @@ -323,7 +323,7 @@ double ejson::Array::getNumberValue(esize_t _id, double _errorValue) { return tmpElement->get(); } -bool ejson::Array::getBooleanValue(esize_t _id, bool _errorValue) { +bool ejson::Array::getBooleanValue(size_t _id, bool _errorValue) { ejson::Boolean* tmpElement = getBoolean(_id); if (NULL == tmpElement) { return _errorValue; diff --git a/ejson/Array.h b/ejson/Array.h index 0fc8e8d..7327428 100644 --- a/ejson/Array.h +++ b/ejson/Array.h @@ -38,7 +38,7 @@ namespace ejson * @brief get the number of sub element in the current one * @return the Number of stored element */ - esize_t size(void) const { + size_t size(void) const { return m_value.size(); }; /** @@ -46,10 +46,10 @@ namespace ejson * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - const ejson::Value* get(esize_t _id) const { + const ejson::Value* get(size_t _id) const { return m_value[_id]; }; - ejson::Value* get(esize_t _id) { + ejson::Value* get(size_t _id) { return m_value[_id]; }; /** @@ -57,64 +57,64 @@ namespace ejson * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::Object* getObject(esize_t _id); + ejson::Object* getObject(size_t _id); /** * @brief get the pointer on an element reference with his ID (casted in String if it is an String). * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::String* getString(esize_t _id); + ejson::String* getString(size_t _id); /** * @brief get the value of the string element (if not a string return "") * @param[in] _id Id of the element. * @return value of the element. */ - const std::string& getStringValue(esize_t _id); + const std::string& getStringValue(size_t _id); /** * @brief get the value of the string element * @param[in] _id Id of the element. * @param[in] _errorValue The return value if an error occured. * @return value of the element, or the _errorValue. */ - std::string getStringValue(esize_t _id, const std::string& _errorValue); + std::string getStringValue(size_t _id, const std::string& _errorValue); /** * @brief get the pointer on an element reference with his ID (casted in Array if it is an Array). * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::Array* getArray(esize_t _id); + ejson::Array* getArray(size_t _id); /** * @brief get the pointer on an element reference with his ID (casted in Null if it is an Null). * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::Null* getNull(esize_t _id); + ejson::Null* getNull(size_t _id); /** * @brief get the pointer on an element reference with his ID (casted in Number if it is an Number). * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::Number* getNumber(esize_t _id); + ejson::Number* getNumber(size_t _id); /** * @brief get the value of the Number element * @param[in] _id Id of the element. * @param[in] _errorValue The return value if an error occured. * @return value of the element, or the _errorValue. */ - double getNumberValue(esize_t _id, double _errorValue); + double getNumberValue(size_t _id, double _errorValue); /** * @brief get the pointer on an element reference with his ID (casted in Boolean if it is an Boolean). * @param[in] _id Id of the element. * @return NULL if the element does not exist. */ - ejson::Boolean* getBoolean(esize_t _id); + ejson::Boolean* getBoolean(size_t _id); /** * @brief get the value of the Boolean element * @param[in] _id Id of the element. * @param[in] _errorValue The return value if an error occured. * @return value of the element, or the _errorValue. */ - bool getBooleanValue(esize_t _id, bool _errorValue); + bool getBooleanValue(size_t _id, bool _errorValue); /** * @brief add an element on the array. * @param[in] _element element to add. @@ -146,8 +146,8 @@ namespace ejson bool addNumber(double _value); public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeArray; }; diff --git a/ejson/Boolean.cpp b/ejson/Boolean.cpp index aab927d..724c49f 100644 --- a/ejson/Boolean.cpp +++ b/ejson/Boolean.cpp @@ -13,7 +13,7 @@ #undef __class__ #define __class__ "Boolean" -bool ejson::Boolean::iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { +bool ejson::Boolean::iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { JSON_PARSE_ELEMENT("start parse : 'Boolean' "); m_value=false; if( _data[_pos] == 't' @@ -42,7 +42,7 @@ bool ejson::Boolean::iParse(const std::string& _data, int32_t& _pos, ejson::file } -bool ejson::Boolean::iGenerate(std::string& _data, int32_t _indent) const { +bool ejson::Boolean::iGenerate(std::string& _data, size_t _indent) const { if (true == m_value) { _data += "true"; } else { diff --git a/ejson/Boolean.h b/ejson/Boolean.h index e31db06..28ebd90 100644 --- a/ejson/Boolean.h +++ b/ejson/Boolean.h @@ -50,8 +50,8 @@ namespace ejson return m_value; }; public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeString; }; diff --git a/ejson/Null.cpp b/ejson/Null.cpp index a7fdab3..d785410 100644 --- a/ejson/Null.cpp +++ b/ejson/Null.cpp @@ -14,7 +14,7 @@ #undef __class__ #define __class__ "Null" -bool ejson::Null::iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { +bool ejson::Null::iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { JSON_PARSE_ELEMENT("start parse : 'Null' "); if (_pos+3 >= _data.size()){ EJSON_CREATE_ERROR(_doc, _data, _pos, _filePos, "can not parse null !!! "); @@ -33,7 +33,7 @@ bool ejson::Null::iParse(const std::string& _data, int32_t& _pos, ejson::filePos } -bool ejson::Null::iGenerate(std::string& _data, int32_t _indent) const { +bool ejson::Null::iGenerate(std::string& _data, size_t _indent) const { _data += "null"; return true; } diff --git a/ejson/Null.h b/ejson/Null.h index e1b1dee..1cf6104 100644 --- a/ejson/Null.h +++ b/ejson/Null.h @@ -28,8 +28,8 @@ namespace ejson */ virtual ~Null(void) { }; public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeString; }; diff --git a/ejson/Number.cpp b/ejson/Number.cpp index ade6ca6..58f30b0 100644 --- a/ejson/Number.cpp +++ b/ejson/Number.cpp @@ -14,10 +14,10 @@ #undef __class__ #define __class__ "Number" -bool ejson::Number::iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { +bool ejson::Number::iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { JSON_PARSE_ELEMENT("start parse : 'Number' "); std::string tmpVal; - for (int32_t iii=_pos; iii<_data.size(); iii++) { + for (size_t iii=_pos; iii<_data.size(); iii++) { _filePos.check(_data[iii]); #ifdef ENABLE_DISPLAY_PARSED_ELEMENT drawElementParsed(_data[iii], _filePos); @@ -37,7 +37,7 @@ bool ejson::Number::iParse(const std::string& _data, int32_t& _pos, ejson::fileP } -bool ejson::Number::iGenerate(std::string& _data, int32_t _indent) const { +bool ejson::Number::iGenerate(std::string& _data, size_t _indent) const { // special thing to remove .000000 at the end of perfect number ... int64_t tmpVal = m_value; if ((double)tmpVal == m_value) { diff --git a/ejson/Number.h b/ejson/Number.h index c3988ed..569b15f 100644 --- a/ejson/Number.h +++ b/ejson/Number.h @@ -62,8 +62,8 @@ namespace ejson return (int64_t)m_value; }; public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeString; }; diff --git a/ejson/Object.cpp b/ejson/Object.cpp index 247b64b..da7bdbb 100644 --- a/ejson/Object.cpp +++ b/ejson/Object.cpp @@ -20,7 +20,7 @@ #define __class__ "Object" void ejson::Object::clear(void) { - for (esize_t iii=0; iii3) { oneLine=false; } else if (_indent<=1) { oneLine=false; } else { - for (esize_t iii=0; iii #include -namespace ejson -{ - class Object : public ejson::Value - { +namespace ejson { + class Object : public ejson::Value { public: /** * @brief basic element of a xml structure @@ -142,8 +140,8 @@ namespace ejson */ bool addNumber(const std::string& _name, double _value); public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeObject; }; diff --git a/ejson/String.cpp b/ejson/String.cpp index b8f871a..25bea20 100644 --- a/ejson/String.cpp +++ b/ejson/String.cpp @@ -18,9 +18,9 @@ -bool ejson::String::iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { +bool ejson::String::iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { JSON_PARSE_ELEMENT("start parse : 'String' "); - for (int32_t iii=_pos+1; iii<_data.size(); iii++) { + for (size_t iii=_pos+1; iii<_data.size(); iii++) { _filePos.check(_data[iii]); #ifdef ENABLE_DISPLAY_PARSED_ELEMENT drawElementParsed(_data[iii], _filePos); @@ -40,7 +40,7 @@ bool ejson::String::iParse(const std::string& _data, int32_t& _pos, ejson::fileP } -bool ejson::String::iGenerate(std::string& _data, int32_t _indent) const { +bool ejson::String::iGenerate(std::string& _data, size_t _indent) const { _data += "\"";; _data += m_value; _data += "\"";; diff --git a/ejson/String.h b/ejson/String.h index 0747ac7..ba6b0f5 100644 --- a/ejson/String.h +++ b/ejson/String.h @@ -22,7 +22,10 @@ namespace ejson /** * @brief basic element of a xml structure */ - String(const std::string& _value="") : m_value(_value) { }; + String(const std::string& _value="") : + m_value(_value) { + + }; /** * @brief destructor */ @@ -34,15 +37,19 @@ namespace ejson * @brief set the value of the node. * @param[in] _value New value of the node. */ - void set(const std::string& _value) { m_value = _value; }; + void set(const std::string& _value) { + m_value = _value; + }; /** * @brief get the current element Value. * @return the reference of the string value. */ - const std::string& get(void) const { return m_value; }; + const std::string& get(void) const { + return m_value; + }; public: // herited function : - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual enum nodeType getType(void) const { return typeString; }; diff --git a/ejson/Value.cpp b/ejson/Value.cpp index 04775c7..e86d75e 100644 --- a/ejson/Value.cpp +++ b/ejson/Value.cpp @@ -28,8 +28,8 @@ etk::CCout& ejson::operator <<(etk::CCout& _os, const ejson::filePos& _obj) { } -void ejson::Value::addIndent(std::string& _data, int32_t _indent) const { - for (int32_t iii=0; iii<_indent; iii++) { +void ejson::Value::addIndent(std::string& _data, size_t _indent) const { + for (size_t iii=0; iii<_indent; iii++) { _data+="\t"; } } @@ -44,10 +44,10 @@ void ejson::Value::drawElementParsed(char32_t _val, const ejson::filePos& _fileP } } -int32_t ejson::Value::countWhiteChar(const std::string& _data, int32_t _pos, ejson::filePos& _filePos) const { +int32_t ejson::Value::countWhiteChar(const std::string& _data, size_t _pos, ejson::filePos& _filePos) const { _filePos.clear(); - int32_t white=0; - for (int32_t iii=_pos; iii<_data.size(); iii++) { + size_t white=0; + for (size_t iii=_pos; iii<_data.size(); iii++) { _filePos.check(_data[iii]); if(true == etk::isWhiteChar(_data[iii])) { white++; diff --git a/ejson/Value.h b/ejson/Value.h index 95727b6..304c1cb 100644 --- a/ejson/Value.h +++ b/ejson/Value.h @@ -47,15 +47,15 @@ namespace ejson { class filePos { private: - int32_t m_col; - int32_t m_line; + size_t m_col; + size_t m_line; public: filePos(void) : m_col(0), m_line(0) { }; - filePos(int32_t _line, int32_t _col) : + filePos(size_t _line, size_t _col) : m_col(_col), m_line(_line) { @@ -66,9 +66,8 @@ namespace ejson { return *this; }; filePos& operator --(void) { - m_col--; - if(m_col<0) { - m_col=0; + if(m_col>0) { + m_col--; } return *this; }; @@ -81,7 +80,7 @@ namespace ejson { } return *this; }; - const filePos& operator +=(int32_t _col) { + const filePos& operator +=(size_t _col) { m_col += _col; return *this; }; @@ -102,7 +101,7 @@ namespace ejson { } return false; } - void set(int32_t _line, int32_t _col) { + void set(size_t _line, size_t _col) { m_col = _col; m_line = _line; } @@ -138,14 +137,14 @@ namespace ejson { * @param[in,out] file parsing position (line x col x) * @return false if an error occured. */ - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) = 0; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) = 0; /** * @brief generate a string with the tree of the xml * @param[in,out] _data string where to add the elements * @param[in] current indentation of the file * @return false if an error occured. */ - virtual bool iGenerate(std::string& _data, int32_t _indent) const = 0; + virtual bool iGenerate(std::string& _data, size_t _indent) const = 0; public: /** * @brief get the node type. @@ -160,7 +159,7 @@ namespace ejson { * @param[in,out] _data String where the indentation is done. * @param[in] _indent Number of tab to add at the string. */ - void addIndent(std::string& _data, int32_t _indent) const; + void addIndent(std::string& _data, size_t _indent) const; /** * @brief Display the cuurent element that is curently parse. * @param[in] _val Char that is parsed. @@ -184,7 +183,7 @@ namespace ejson { * @param[out] _filePos new poistion of te file to add. * @return number of white element. */ - int32_t countWhiteChar(const std::string& _data, int32_t _pos, ejson::filePos& _filePos) const; + int32_t countWhiteChar(const std::string& _data, size_t _pos, ejson::filePos& _filePos) const; public: /** * @brief Cast the element in a Value if it is possible. diff --git a/ejson/ejson.cpp b/ejson/ejson.cpp index fe02f16..374aae4 100644 --- a/ejson/ejson.cpp +++ b/ejson/ejson.cpp @@ -32,7 +32,7 @@ ejson::Document::~Document(void) { } -bool ejson::Document::iGenerate(std::string& _data, int32_t _indent) const { +bool ejson::Document::iGenerate(std::string& _data, size_t _indent) const { ejson::Object::iGenerate(_data, _indent+1); _data += "\n"; return true; @@ -42,7 +42,7 @@ bool ejson::Document::parse(const std::string& _data) { JSON_VERBOSE("Start parsing document (type: string) size=" << _data.size()); clear(); ejson::filePos filePos(1,0); - int32_t parsePos = 0; + size_t parsePos = 0; return iParse(_data, parsePos, filePos, *this); } @@ -102,7 +102,7 @@ bool ejson::Document::store(const std::string& _file) { JSON_ERROR("Can not open (w) the file : " << _file); return false; } - if (tmpFile.fileWrite((char*)createData.c_str(), sizeof(char), createData.size()) != createData.size()) { + if (tmpFile.fileWrite((char*)createData.c_str(), sizeof(char), createData.size()) != (int32_t)createData.size()) { JSON_ERROR("Error while writing output XML file : " << _file); tmpFile.fileClose(); return false; @@ -117,9 +117,9 @@ void ejson::Document::display(void) { JSON_INFO("Generated JSON : \n" << tmpp); } -static std::string createPosPointer(const std::string& _line, int32_t _pos) { +static std::string createPosPointer(const std::string& _line, size_t _pos) { std::string out; - int32_t iii; + size_t iii; for (iii=0; iii<_pos && iii<_line.size(); iii++) { if (_line[iii] == '\t') { out += "\t"; @@ -147,7 +147,7 @@ void ejson::Document::displayError(void) { #endif } -void ejson::Document::createError(const std::string& _data, int32_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_Line = extract_line(_data, _pos); m_filePos = _filePos; @@ -156,11 +156,11 @@ void ejson::Document::createError(const std::string& _data, int32_t _pos, const } } -bool ejson::Document::iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { +bool ejson::Document::iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) { JSON_PARSE_ELEMENT("start parse : 'Document' "); bool haveMainNode=false; bool nodeParsed=false; - for (int32_t iii=_pos; iii<_data.size(); iii++) { + for (size_t iii=_pos; iii<_data.size(); iii++) { _filePos.check(_data[iii]); #ifdef ENABLE_DISPLAY_PARSED_ELEMENT drawElementParsed(_data[iii], _filePos); diff --git a/ejson/ejson.h b/ejson/ejson.h index f52c5c3..129543c 100644 --- a/ejson/ejson.h +++ b/ejson/ejson.h @@ -17,10 +17,8 @@ #include #include -namespace ejson -{ - class Document : public ejson::Object - { +namespace ejson { + class Document : public ejson::Object { public: /** * @brief Constructor @@ -76,14 +74,14 @@ namespace ejson m_writeErrorWhenDetexted=false; }; - void createError(const std::string& _data, int32_t _pos, const ejson::filePos& _filePos, const std::string& _comment); + void createError(const std::string& _data, size_t _pos, const ejson::filePos& _filePos, const std::string& _comment); void displayError(void); public: // herited function: virtual enum nodeType getType(void) const { return typeDocument; }; - virtual bool iParse(const std::string& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); - virtual bool iGenerate(std::string& _data, int32_t _indent) const; + virtual bool iParse(const std::string& _data, size_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc); + virtual bool iGenerate(std::string& _data, size_t _indent) const; virtual ejson::Document* toDocument(void) { return this; }; diff --git a/lutin_ejson.py b/lutin_ejson.py index e442707..4aa3f87 100644 --- a/lutin_ejson.py +++ b/lutin_ejson.py @@ -7,6 +7,8 @@ def Create(target): myModule.AddModuleDepend(['etk']) + # add extra compilation flags : + myModule.add_extra_compile_flags() myModule.AddSrcFile([ 'ejson/debug.cpp', 'ejson/ejson.cpp',