[DEV] change enum naming
This commit is contained in:
parent
9644468f6e
commit
a94a1c6e60
@ -148,7 +148,7 @@ namespace ejson
|
|||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const {
|
virtual enum nodeType getType(void) const {
|
||||||
return typeArray;
|
return typeArray;
|
||||||
};
|
};
|
||||||
virtual ejson::Array* toArray(void) {
|
virtual ejson::Array* toArray(void) {
|
||||||
|
@ -52,7 +52,7 @@ namespace ejson
|
|||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const {
|
virtual enum nodeType getType(void) const {
|
||||||
return typeString;
|
return typeString;
|
||||||
};
|
};
|
||||||
virtual ejson::Boolean* toBoolean(void) {
|
virtual ejson::Boolean* toBoolean(void) {
|
||||||
|
12
ejson/Null.h
12
ejson/Null.h
@ -30,9 +30,15 @@ namespace ejson
|
|||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const { return typeString; };
|
virtual enum nodeType getType(void) const {
|
||||||
virtual ejson::Null* toNull(void) { return this; };
|
return typeString;
|
||||||
virtual const ejson::Null* toNull(void) const{ return this; };
|
};
|
||||||
|
virtual ejson::Null* toNull(void) {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
virtual const ejson::Null* toNull(void) const{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
virtual bool transfertIn(ejson::Value* _obj);
|
virtual bool transfertIn(ejson::Value* _obj);
|
||||||
virtual ejson::Value* duplicate(void) const;
|
virtual ejson::Value* duplicate(void) const;
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,10 @@ namespace ejson
|
|||||||
/**
|
/**
|
||||||
* @brief basic element of a xml structure
|
* @brief basic element of a xml structure
|
||||||
*/
|
*/
|
||||||
Number(double _value=0.0) : m_value(_value) { };
|
Number(double _value=0.0) :
|
||||||
|
m_value(_value) {
|
||||||
|
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief destructor
|
* @brief destructor
|
||||||
*/
|
*/
|
||||||
@ -34,20 +37,42 @@ namespace ejson
|
|||||||
* @brief set the value of the node.
|
* @brief set the value of the node.
|
||||||
* @param[in] _value New value of the node.
|
* @param[in] _value New value of the node.
|
||||||
*/
|
*/
|
||||||
void set(double _value) { m_value = _value; };
|
void set(double _value) {
|
||||||
|
m_value = _value;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief get the current element Value.
|
* @brief Get the current element Value.
|
||||||
* @return the reference of the string value.
|
* @return The double number registered
|
||||||
*/
|
*/
|
||||||
double get(void) const { return m_value; };
|
double get(void) const {
|
||||||
int32_t getInt32(void) const { return (int32_t)m_value; };
|
return m_value;
|
||||||
int64_t getInt64(void) const { return (int64_t)m_value; };
|
};
|
||||||
|
/**
|
||||||
|
* @brief Get the current element Value.
|
||||||
|
* @return The 32 bit integer number registered
|
||||||
|
*/
|
||||||
|
int32_t getInt32(void) const {
|
||||||
|
return (int32_t)m_value;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @brief Get the current element Value.
|
||||||
|
* @return The 64 bit integer number registered
|
||||||
|
*/
|
||||||
|
int64_t getInt64(void) const {
|
||||||
|
return (int64_t)m_value;
|
||||||
|
};
|
||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const { return typeString; };
|
virtual enum nodeType getType(void) const {
|
||||||
virtual ejson::Number* toNumber(void) { return this; };
|
return typeString;
|
||||||
virtual const ejson::Number* toNumber(void) const{ return this; };
|
};
|
||||||
|
virtual ejson::Number* toNumber(void) {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
virtual const ejson::Number* toNumber(void) const{
|
||||||
|
return this;
|
||||||
|
};
|
||||||
virtual bool transfertIn(ejson::Value* _obj);
|
virtual bool transfertIn(ejson::Value* _obj);
|
||||||
virtual ejson::Value* duplicate(void) const;
|
virtual ejson::Value* duplicate(void) const;
|
||||||
};
|
};
|
||||||
|
@ -31,14 +31,14 @@ void ejson::Object::clear(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
enum statusParsing {
|
||||||
parseName,
|
parseName,
|
||||||
parseMiddle,
|
parseMiddle,
|
||||||
parseValue,
|
parseValue,
|
||||||
} statusParsing_te;
|
};
|
||||||
|
|
||||||
bool ejson::Object::iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) {
|
bool ejson::Object::iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc) {
|
||||||
statusParsing_te mode = parseName;
|
enum statusParsing mode = parseName;
|
||||||
etk::UString currentName;
|
etk::UString currentName;
|
||||||
JSON_PARSE_ELEMENT("start parse : 'Object' ");
|
JSON_PARSE_ELEMENT("start parse : 'Object' ");
|
||||||
bool standalone = true;
|
bool standalone = true;
|
||||||
|
@ -144,7 +144,7 @@ namespace ejson
|
|||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const {
|
virtual enum nodeType getType(void) const {
|
||||||
return typeObject;
|
return typeObject;
|
||||||
};
|
};
|
||||||
virtual ejson::Object* toObject(void) {
|
virtual ejson::Object* toObject(void) {
|
||||||
|
@ -43,9 +43,15 @@ namespace ejson
|
|||||||
public: // herited function :
|
public: // herited function :
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual nodeType_te getType(void) const { return typeString; };
|
virtual enum nodeType getType(void) const {
|
||||||
virtual ejson::String* toString(void) { return this; };
|
return typeString;
|
||||||
virtual const ejson::String* toString(void) const{ return this; };
|
};
|
||||||
|
virtual ejson::String* toString(void) {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
virtual const ejson::String* toString(void) const {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
virtual bool transfertIn(ejson::Value* _obj);
|
virtual bool transfertIn(ejson::Value* _obj);
|
||||||
virtual ejson::Value* duplicate(void) const;
|
virtual ejson::Value* duplicate(void) const;
|
||||||
};
|
};
|
||||||
|
155
ejson/Value.h
155
ejson/Value.h
@ -13,8 +13,7 @@
|
|||||||
#include <etk/UString.h>
|
#include <etk/UString.h>
|
||||||
#include <etk/math/Vector2D.h>
|
#include <etk/math/Vector2D.h>
|
||||||
|
|
||||||
namespace ejson
|
namespace ejson {
|
||||||
{
|
|
||||||
//#define ENABLE_DISPLAY_PARSED_ELEMENT
|
//#define ENABLE_DISPLAY_PARSED_ELEMENT
|
||||||
#if 1
|
#if 1
|
||||||
#define JSON_PARSE_ELEMENT JSON_VERBOSE
|
#define JSON_PARSE_ELEMENT JSON_VERBOSE
|
||||||
@ -34,7 +33,7 @@ namespace ejson
|
|||||||
class Number;
|
class Number;
|
||||||
class String;
|
class String;
|
||||||
|
|
||||||
typedef enum {
|
enum nodeType{
|
||||||
typeUnknow, //!< might be an error ...
|
typeUnknow, //!< might be an error ...
|
||||||
typeValue, //!< XXXXXX:*
|
typeValue, //!< XXXXXX:*
|
||||||
typeDocument, //!< all the file main access
|
typeDocument, //!< all the file main access
|
||||||
@ -44,19 +43,35 @@ namespace ejson
|
|||||||
typeBoolean, //!< the true and false
|
typeBoolean, //!< the true and false
|
||||||
typeNull, //!< the null element
|
typeNull, //!< the null element
|
||||||
typeObject, //!< the { ... }
|
typeObject, //!< the { ... }
|
||||||
} nodeType_te;
|
};
|
||||||
|
|
||||||
class filePos
|
class filePos {
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
int32_t m_col;
|
int32_t m_col;
|
||||||
int32_t m_line;
|
int32_t m_line;
|
||||||
public:
|
public:
|
||||||
filePos(void) : m_col(0),m_line(0) { };
|
filePos(void) :
|
||||||
filePos(int32_t _line, int32_t _col) : m_col(_col),m_line(_line) { };
|
m_col(0),
|
||||||
|
m_line(0) {
|
||||||
|
|
||||||
|
};
|
||||||
|
filePos(int32_t _line, int32_t _col) :
|
||||||
|
m_col(_col),
|
||||||
|
m_line(_line) {
|
||||||
|
|
||||||
|
};
|
||||||
~filePos(void) { };
|
~filePos(void) { };
|
||||||
filePos& operator ++(void) { m_col++; return *this; };
|
filePos& operator ++(void) {
|
||||||
filePos& operator --(void) { m_col--; if(m_col<0) { m_col=0;} return *this; };
|
m_col++;
|
||||||
|
return *this;
|
||||||
|
};
|
||||||
|
filePos& operator --(void) {
|
||||||
|
m_col--;
|
||||||
|
if(m_col<0) {
|
||||||
|
m_col=0;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
};
|
||||||
const filePos& operator +=(const filePos& _obj) {
|
const filePos& operator +=(const filePos& _obj) {
|
||||||
if (_obj.m_line == 0) {
|
if (_obj.m_line == 0) {
|
||||||
m_col += _obj.m_col;
|
m_col += _obj.m_col;
|
||||||
@ -75,7 +90,10 @@ namespace ejson
|
|||||||
m_line = _obj.m_line;
|
m_line = _obj.m_line;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
void newLine(void) { m_col=0; m_line++; };
|
void newLine(void) {
|
||||||
|
m_col=0;
|
||||||
|
m_line++;
|
||||||
|
};
|
||||||
bool check(const etk::UChar& _val) {
|
bool check(const etk::UChar& _val) {
|
||||||
m_col++;
|
m_col++;
|
||||||
if (_val == '\n') {
|
if (_val == '\n') {
|
||||||
@ -92,13 +110,16 @@ namespace ejson
|
|||||||
m_col = 0;
|
m_col = 0;
|
||||||
m_line = 0;
|
m_line = 0;
|
||||||
}
|
}
|
||||||
int32_t getCol(void) const { return m_col; };
|
int32_t getCol(void) const {
|
||||||
int32_t getLine(void) const { return m_line; };
|
return m_col;
|
||||||
|
};
|
||||||
|
int32_t getLine(void) const {
|
||||||
|
return m_line;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
etk::CCout& operator <<(etk::CCout& _os, const filePos& _obj);
|
etk::CCout& operator <<(etk::CCout& _os, const filePos& _obj);
|
||||||
|
|
||||||
class Value
|
class Value {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief basic element of a xml structure
|
* @brief basic element of a xml structure
|
||||||
@ -130,7 +151,9 @@ namespace ejson
|
|||||||
* @brief get the node type.
|
* @brief get the node type.
|
||||||
* @return the type of the Node.
|
* @return the type of the Node.
|
||||||
*/
|
*/
|
||||||
virtual nodeType_te getType(void) const { return typeValue; };
|
virtual enum nodeType getType(void) const {
|
||||||
|
return typeValue;
|
||||||
|
};
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief add indentation of the string input.
|
* @brief add indentation of the string input.
|
||||||
@ -167,86 +190,132 @@ namespace ejson
|
|||||||
* @brief Cast the element in a Value if it is possible.
|
* @brief Cast the element in a Value if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Value* toValue(void) { return this; };
|
virtual ejson::Value* toValue(void) {
|
||||||
virtual const ejson::Value* toValue(void) const { return this; };
|
return this;
|
||||||
|
};
|
||||||
|
virtual const ejson::Value* toValue(void) const {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Document if it is possible.
|
* @brief Cast the element in a Document if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Document* toDocument(void) { return NULL; };
|
virtual ejson::Document* toDocument(void) {
|
||||||
virtual const ejson::Document* toDocument(void) const { return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Document* toDocument(void) const {
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Array if it is possible.
|
* @brief Cast the element in a Array if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Array* toArray(void) { return NULL; };
|
virtual ejson::Array* toArray(void) {
|
||||||
virtual const ejson::Array* toArray(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Array* toArray(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Object if it is possible.
|
* @brief Cast the element in a Object if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Object* toObject(void) { return NULL; };
|
virtual ejson::Object* toObject(void) {
|
||||||
virtual const ejson::Object* toObject(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Object* toObject(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a String if it is possible.
|
* @brief Cast the element in a String if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::String* toString(void) { return NULL; };
|
virtual ejson::String* toString(void) {
|
||||||
virtual const ejson::String* toString(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::String* toString(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Number if it is possible.
|
* @brief Cast the element in a Number if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Number* toNumber(void) { return NULL; };
|
virtual ejson::Number* toNumber(void) {
|
||||||
virtual const ejson::Number* toNumber(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Number* toNumber(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Boolean if it is possible.
|
* @brief Cast the element in a Boolean if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Boolean* toBoolean(void) { return NULL; };
|
virtual ejson::Boolean* toBoolean(void) {
|
||||||
virtual const ejson::Boolean* toBoolean(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Boolean* toBoolean(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Cast the element in a Null if it is possible.
|
* @brief Cast the element in a Null if it is possible.
|
||||||
* @return pointer on the class or NULL.
|
* @return pointer on the class or NULL.
|
||||||
*/
|
*/
|
||||||
virtual ejson::Null* toNull(void) { return NULL; };
|
virtual ejson::Null* toNull(void) {
|
||||||
virtual const ejson::Null* toNull(void) const{ return NULL; };
|
return NULL;
|
||||||
|
};
|
||||||
|
virtual const ejson::Null* toNull(void) const{
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Document
|
* @brief check if the node is a ejson::Document
|
||||||
* @return true if the node is a ejson::Document
|
* @return true if the node is a ejson::Document
|
||||||
*/
|
*/
|
||||||
bool isDocument(void) const { return getType() == ejson::typeDocument; };
|
bool isDocument(void) const {
|
||||||
|
return getType() == ejson::typeDocument;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Array
|
* @brief check if the node is a ejson::Array
|
||||||
* @return true if the node is a ejson::Array
|
* @return true if the node is a ejson::Array
|
||||||
*/
|
*/
|
||||||
bool isArray(void) const { return getType() == ejson::typeArray; };
|
bool isArray(void) const {
|
||||||
|
return getType() == ejson::typeArray;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Object
|
* @brief check if the node is a ejson::Object
|
||||||
* @return true if the node is a ejson::Object
|
* @return true if the node is a ejson::Object
|
||||||
*/
|
*/
|
||||||
bool isObject(void) const { return getType() == ejson::typeObject; };
|
bool isObject(void) const {
|
||||||
|
return getType() == ejson::typeObject;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::String
|
* @brief check if the node is a ejson::String
|
||||||
* @return true if the node is a ejson::String
|
* @return true if the node is a ejson::String
|
||||||
*/
|
*/
|
||||||
bool isString(void) const { return getType() == ejson::typeString; };
|
bool isString(void) const {
|
||||||
|
return getType() == ejson::typeString;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Number
|
* @brief check if the node is a ejson::Number
|
||||||
* @return true if the node is a ejson::Number
|
* @return true if the node is a ejson::Number
|
||||||
*/
|
*/
|
||||||
bool isNumber(void) const { return getType() == ejson::typeNumber; };
|
bool isNumber(void) const {
|
||||||
|
return getType() == ejson::typeNumber;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Boolean
|
* @brief check if the node is a ejson::Boolean
|
||||||
* @return true if the node is a ejson::Boolean
|
* @return true if the node is a ejson::Boolean
|
||||||
*/
|
*/
|
||||||
bool isBoolean(void) const { return getType() == ejson::typeBoolean; };
|
bool isBoolean(void) const {
|
||||||
|
return getType() == ejson::typeBoolean;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief check if the node is a ejson::Null
|
* @brief check if the node is a ejson::Null
|
||||||
* @return true if the node is a ejson::Null
|
* @return true if the node is a ejson::Null
|
||||||
*/
|
*/
|
||||||
bool isNull(void) const { return getType() == ejson::typeNull; };
|
bool isNull(void) const {
|
||||||
|
return getType() == ejson::typeNull;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief clear the Node
|
* @brief clear the Node
|
||||||
@ -258,12 +327,16 @@ namespace ejson
|
|||||||
* @return true if transfer is done corectly
|
* @return true if transfer is done corectly
|
||||||
* @note all element is remove from the curent element.
|
* @note all element is remove from the curent element.
|
||||||
*/
|
*/
|
||||||
virtual bool transfertIn(ejson::Value* _obj) { return false; };
|
virtual bool transfertIn(ejson::Value* _obj) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* @brief Copy the curent node and all the child in the curent one.
|
* @brief Copy the curent node and all the child in the curent one.
|
||||||
* @return NULL in an error occured, the pointer on the element otherwise
|
* @return NULL in an error occured, the pointer on the element otherwise
|
||||||
*/
|
*/
|
||||||
virtual ejson::Value* duplicate(void) const { return NULL; };
|
virtual ejson::Value* duplicate(void) const {
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ bool ejson::Document::load(const etk::UString& _file) {
|
|||||||
tmpFile.fileClose();
|
tmpFile.fileClose();
|
||||||
|
|
||||||
// convert in UTF8 :
|
// convert in UTF8 :
|
||||||
etk::UString tmpDataUnicode(fileBuffer, unicode::EDN_CHARSET_UTF8);
|
etk::UString tmpDataUnicode(fileBuffer, unicode::charsetUTF8);
|
||||||
// remove temporary buffer:
|
// remove temporary buffer:
|
||||||
delete(fileBuffer);
|
delete(fileBuffer);
|
||||||
// parse the data :
|
// parse the data :
|
||||||
|
@ -69,17 +69,27 @@ namespace ejson
|
|||||||
etk::UString m_Line;
|
etk::UString m_Line;
|
||||||
ejson::filePos m_filePos;
|
ejson::filePos m_filePos;
|
||||||
public:
|
public:
|
||||||
void displayErrorWhenDetected(void) { m_writeErrorWhenDetexted=true; };
|
void displayErrorWhenDetected(void) {
|
||||||
void notDisplayErrorWhenDetected(void) { m_writeErrorWhenDetexted=false; };
|
m_writeErrorWhenDetexted=true;
|
||||||
|
};
|
||||||
|
void notDisplayErrorWhenDetected(void) {
|
||||||
|
m_writeErrorWhenDetexted=false;
|
||||||
|
};
|
||||||
|
|
||||||
void createError(const etk::UString& _data, int32_t _pos, const ejson::filePos& _filePos, const etk::UString& _comment);
|
void createError(const etk::UString& _data, int32_t _pos, const ejson::filePos& _filePos, const etk::UString& _comment);
|
||||||
void displayError(void);
|
void displayError(void);
|
||||||
public: // herited function:
|
public: // herited function:
|
||||||
virtual nodeType_te getType(void) const { return typeDocument; };
|
virtual enum nodeType getType(void) const {
|
||||||
|
return typeDocument;
|
||||||
|
};
|
||||||
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
virtual bool iParse(const etk::UString& _data, int32_t& _pos, ejson::filePos& _filePos, ejson::Document& _doc);
|
||||||
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
virtual bool iGenerate(etk::UString& _data, int32_t _indent) const;
|
||||||
virtual ejson::Document* toDocument(void) { return this; };
|
virtual ejson::Document* toDocument(void) {
|
||||||
virtual const ejson::Document* toDocument(void) const { return this; };
|
return this;
|
||||||
|
};
|
||||||
|
virtual const ejson::Document* toDocument(void) const {
|
||||||
|
return this;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user