#include <Number.hpp>

Inheritance diagram for ejson::internal::Number:
ejson::internal::Value ememory::EnableSharedFromThis< Value > ememory::EnableSharedFromThisBase

Public Types

enum  type { tDouble, tInt, tUint }
 

Public Member Functions

ejson::internal::Number::type getType () const
 
void set (double _value)
 
void set (int64_t _value)
 
void set (uint64_t _value)
 
double get () const
 
uint64_t getU64 () const
 
int64_t getI64 () const
 
bool iParse (const std::string &_data, size_t &_pos, ejson::FilePos &_filePos, ejson::internal::Document &_doc) override
 
bool iGenerate (std::string &_data, size_t _indent) const override
 
void iMachineGenerate (std::string &_data) const override
 
bool transfertIn (ememory::SharedPtr< ejson::internal::Value > _obj) override
 
ememory::SharedPtr< ejson::internal::Valueclone () const override
 
- Public Member Functions inherited from ejson::internal::Value
enum ejson::valueType getType () const
 
virtual ~Value ()
 
void display () const
 
virtual void clear ()
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Value >
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis ()
 
const ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis () const
 
ememory::WeakPtr< EMEMORY_TYPE > weakFromThis ()
 
const ememory::WeakPtr< EMEMORY_TYPE > weakFromThis () const
 

Static Public Member Functions

static ememory::SharedPtr< Numbercreate (uint64_t _value=0)
 
static ememory::SharedPtr< Numbercreate (int64_t _value)
 
static ememory::SharedPtr< Numbercreate (double _value)
 

Protected Member Functions

 Number (uint64_t _value=0)
 
 Number (int64_t _value)
 
 Number (double _value)
 
- Protected Member Functions inherited from ejson::internal::Value
 Value ()
 
void addIndent (std::string &_data, int32_t _indent) const
 
void drawElementParsed (char32_t _val, const ejson::FilePos &_filePos) const
 
bool checkString (char32_t _val) const
 
bool checkNumber (char32_t _val) const
 
int32_t countWhiteChar (const std::string &_data, size_t _pos, ejson::FilePos &_filePos) const
 

Protected Attributes

type m_typeNumber
 
union {
   double   m_value
 
   uint64_t   m_valueU64
 
   int64_t   m_valueI64
 
}; 
 
- Protected Attributes inherited from ejson::internal::Value
enum ejson::valueType m_type
 

Additional Inherited Members

- Static Protected Member Functions inherited from ejson::internal::Value
static bool isWhiteChar (char32_t _val)
 

Detailed Description

ejson Number internal data implementation.

Constructor & Destructor Documentation

§ Number()

ejson::internal::Number::Number ( uint64_t  _value = 0)
protected

basic element of a xml structure

Parameters
[in]_valueValue to set on the ejson::Value

Member Function Documentation

§ clone()

ememory::SharedPtr<ejson::internal::Value> ejson::internal::Number::clone ( ) const
overridevirtual

Copy the curent node and all the child in the curent one.

Returns
nullptr in an error occured, the pointer on the element otherwise

Reimplemented from ejson::internal::Value.

§ create()

static ememory::SharedPtr<Number> ejson::internal::Number::create ( uint64_t  _value = 0)
static

Create factory on the ejson::internal::Number.

Parameters
[in]_valueValue to set on the ejson::Value
Returns
A SharedPtr on the Number value

§ get()

double ejson::internal::Number::get ( ) const

Get the current element Value.

Returns
The double number registered

§ getI64()

int64_t ejson::internal::Number::getI64 ( ) const

Get the current element Value.

Returns
The unsigned integer number registered

§ getU64()

uint64_t ejson::internal::Number::getU64 ( ) const

Get the current element Value.

Returns
The unsigned integer number registered

§ iGenerate()

bool ejson::internal::Number::iGenerate ( std::string _data,
size_t  _indent 
) const
overridevirtual

generate a string with the tree of the json

Parameters
[in,out]_datastring where to add the elements
[in]_indentcurrent indentation of the file
Returns
false if an error occured.

Implements ejson::internal::Value.

§ iMachineGenerate()

void ejson::internal::Number::iMachineGenerate ( std::string _data) const
overridevirtual

generate a string with the tree of the json (not human readable ==> for computer transfer)

Parameters
[in,out]_datastring where to add the elements
Returns
false if an error occured.

Implements ejson::internal::Value.

§ iParse()

bool ejson::internal::Number::iParse ( const std::string _data,
size_t &  _pos,
ejson::FilePos _filePos,
ejson::internal::Document _doc 
)
overridevirtual

parse the Current node [pure VIRUAL]

Parameters
[in]_datadata string to parse.
[in,out]_posposition in the string to start parse, return the position end of parsing.
[in,out]_filePosPosition in the file (in X/Y)
[in,out]_docReference on the main document
Returns
false if an error occured.

Implements ejson::internal::Value.

§ set() [1/3]

void ejson::internal::Number::set ( double  _value)

set the value of the node.

Parameters
[in]_valueNew value of the node.

§ set() [2/3]

void ejson::internal::Number::set ( int64_t  _value)

set the value of the node.

Parameters
[in]_valueNew value of the node.

§ set() [3/3]

void ejson::internal::Number::set ( uint64_t  _value)

set the value of the node.

Parameters
[in]_valueNew value of the node.

§ transfertIn()

bool ejson::internal::Number::transfertIn ( ememory::SharedPtr< ejson::internal::Value _obj)
overridevirtual

Tranfert all element in the element set in parameter.

Parameters
[in,out]_objmove all parameter in the selected element
Returns
true if transfer is done corectly
Note
all element is remove from the curent element.

Reimplemented from ejson::internal::Value.

Member Data Documentation

§ m_value

double ejson::internal::Number::m_value

value of the node

§ m_valueI64

int64_t ejson::internal::Number::m_valueI64

value of the node

§ m_valueU64

uint64_t ejson::internal::Number::m_valueU64

value of the node


The documentation for this class was generated from the following file:
  • framework/atria-soft/ejson/ejson/internal/Number.hpp