exml::internal::Document Class Reference

#include <Document.hpp>

Inheritance diagram for exml::internal::Document:
exml::internal::Element exml::internal::AttributeList exml::internal::Node ememory::EnableSharedFromThis< Node > ememory::EnableSharedFromThisBase

Public Member Functions

 Document ()
 
virtual void setCaseSensitive (bool _val)
 
virtual bool getCaseSensitive () const
 
bool parse (const std::string &_data)
 
bool generate (std::string &_data)
 
bool load (const std::string &_file)
 
bool store (const std::string &_file)
 
void display ()
 
void setDisplayError (bool _value)
 
bool getDisplayError ()
 
void displayError ()
 
void createError (const std::string &_data, int32_t _pos, const exml::FilePos &_filePos, const std::string &_comment)
 
enum nodeType getType () const override
 
bool iGenerate (std::string &_data, int32_t _indent) const override
 
ememory::SharedPtr< exml::internal::DocumenttoDocument () override
 
const ememory::SharedPtr< exml::internal::DocumenttoDocument () const override
 
- Public Member Functions inherited from exml::internal::Element
size_t size () const
 
void append (const ememory::SharedPtr< exml::internal::Node > &_node)
 
void remove (const std::string &_nodeName)
 
enum nodeType getType (int32_t _id) const
 
ememory::SharedPtr< NodegetNode (int32_t _id)
 
const ememory::SharedPtr< NodegetNode (int32_t _id) const
 
ememory::SharedPtr< ElementgetElement (int32_t _id)
 
const ememory::SharedPtr< ElementgetElement (int32_t _id) const
 
ememory::SharedPtr< ElementgetNamed (const std::string &_name)
 
const ememory::SharedPtr< ElementgetNamed (const std::string &_name) const
 
std::string getText () const
 
enum nodeType getType () const override
 
bool iParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc) override
 
bool iGenerate (std::string &_data, int32_t _indent) const override
 
ememory::SharedPtr< exml::internal::ElementtoElement () override
 
const ememory::SharedPtr< exml::internal::ElementtoElement () const override
 
void clear () override
 
- Public Member Functions inherited from exml::internal::AttributeList
size_t sizeAttribute () const
 
void appendAttribute (const ememory::SharedPtr< exml::internal::Attribute > &_attr)
 
ememory::SharedPtr< AttributegetAttr (int32_t _id)
 
ememory::SharedPtr< const AttributegetAttr (int32_t _id) const
 
std::pair< std::string, std::string > getAttrPair (int32_t _id) const
 
const std::string & getAttribute (const std::string &_name) const
 
bool existAttribute (const std::string &_name) const
 
void setAttribute (const std::string &_name, const std::string &_value)
 
bool removeAttribute (const std::string &_name)
 
- Public Member Functions inherited from exml::internal::Node
virtual ~Node ()=default
 
const exml::FilePosgetPos () const
 
virtual void setValue (std::string _value)
 
virtual const std::string & getValue () const
 
virtual ememory::SharedPtr< exml::internal::AttributetoAttribute ()
 
virtual const ememory::SharedPtr< exml::internal::AttributetoAttribute () const
 
virtual ememory::SharedPtr< exml::internal::CommenttoComment ()
 
virtual const ememory::SharedPtr< exml::internal::CommenttoComment () const
 
virtual ememory::SharedPtr< exml::internal::DeclarationtoDeclaration ()
 
virtual const ememory::SharedPtr< exml::internal::DeclarationtoDeclaration () const
 
virtual ememory::SharedPtr< exml::internal::TexttoText ()
 
virtual const ememory::SharedPtr< exml::internal::TexttoText () const
 
bool isDocument () const
 
bool isAttribute () const
 
bool isComment () const
 
bool isDeclaration () const
 
bool isElement () const
 
bool isText () const
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Node >
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< exml::internal::Documentcreate ()
 
- Static Public Member Functions inherited from exml::internal::Element
static ememory::SharedPtr< Elementcreate (const std::string &_value="")
 

Additional Inherited Members

- Protected Member Functions inherited from exml::internal::Element
 Element ()
 
 Element (const std::string &_value)
 
bool subParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc, bool _mainNode=false)
 
- Protected Member Functions inherited from exml::internal::AttributeList
 AttributeList (const std::string &_value="")
 
- Protected Member Functions inherited from exml::internal::Node
 Node ()
 
 Node (const std::string &_value)
 
void addIndent (std::string &_data, int32_t _indent) const
 
void drawElementParsed (char32_t _val, const exml::FilePos &_filePos) const
 
bool checkAvaillable (char32_t _val, bool _firstChar) const
 
int32_t countWhiteChar (const std::string &_data, int32_t _pos, exml::FilePos &_filePos) const
 
- Protected Attributes inherited from exml::internal::Element
std::vector< ememory::SharedPtr< exml::internal::Node > > m_listSub
 
- Protected Attributes inherited from exml::internal::AttributeList
std::vector< ememory::SharedPtr< exml::internal::Attribute > > m_listAttribute
 
- Protected Attributes inherited from exml::internal::Node
exml::FilePos m_pos
 
std::string m_value
 

Detailed Description

Basic document element of a document.

Constructor & Destructor Documentation

§ Document()

exml::internal::Document::Document ( )

Constructor.

Member Function Documentation

§ create()

static ememory::SharedPtr<exml::internal::Document> exml::internal::Document::create ( )
static

Factory on a document.

Returns
an local created xml document

§ createError()

void exml::internal::Document::createError ( const std::string &  _data,
int32_t  _pos,
const exml::FilePos _filePos,
const std::string &  _comment 
)

Create an error in the parsing (call by the syetm for error management)

Parameters
[in]_datastring of chat is wrong
[in]_posPosition in the file
[in]_filePoshuman position of the error
[in]_commentError string to display

§ display()

void exml::internal::Document::display ( )

Display the Document on console.

§ displayError()

void exml::internal::Document::displayError ( )

Request display in log of the error.

§ generate()

bool exml::internal::Document::generate ( std::string &  _data)

generate a string that contain the created XML

Parameters
[out]_dataData where the xml is stored
Returns
false : An error occured
true : Parsing is OK

§ getCaseSensitive()

virtual bool exml::internal::Document::getCaseSensitive ( ) const
inlinevirtual

get the status of case sensitive mode.

Returns
true if case sensitive is active

§ getDisplayError()

bool exml::internal::Document::getDisplayError ( )

Get the display of the error status.

Returns
true Display error
false Does not display error (get it at end)

§ getType()

enum nodeType exml::internal::Document::getType ( ) const
inlineoverridevirtual

get the node type.

Returns
the type of the Node.

Reimplemented from exml::internal::Node.

§ iGenerate()

bool exml::internal::Document::iGenerate ( std::string &  _data,
int32_t  _indent 
) const
overridevirtual

generate a string with the tree of the xml

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

Reimplemented from exml::internal::AttributeList.

§ load()

bool exml::internal::Document::load ( const std::string &  _file)

Load the file that might contain the xml.

Parameters
[in]_fileFilename of the xml (compatible with etk FSNode naming)
Returns
false : An error occured
true : Parsing is OK

§ parse()

bool exml::internal::Document::parse ( const std::string &  _data)

parse a string that contain an XML

Parameters
[in]_dataData to parse
Returns
false : An error occured
true : Parsing is OK

§ setCaseSensitive()

virtual void exml::internal::Document::setCaseSensitive ( bool  _val)
inlinevirtual

Enable or diasable the case sensitive (must be done before the call of parsing)

Parameters
[in]_valtrue if enable; false else.

§ setDisplayError()

void exml::internal::Document::setDisplayError ( bool  _value)

Set the display of the error when detected.

Parameters
[in]_valuetrue: display error, false not display error (get it at end)

§ store()

bool exml::internal::Document::store ( const std::string &  _file)

Store the Xml in the file.

Parameters
[in]_fileFilename of the xml (compatible with etk FSNode naming)
Returns
false : An error occured
true : Parsing is OK

§ toDocument() [1/2]

ememory::SharedPtr<exml::internal::Document> exml::internal::Document::toDocument ( )
inlineoverridevirtual

Cast the element in a Document if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented from exml::internal::Node.

§ toDocument() [2/2]

const ememory::SharedPtr<exml::internal::Document> exml::internal::Document::toDocument ( ) const
inlineoverridevirtual

Cast the element in a Document if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented from exml::internal::Node.


The documentation for this class was generated from the following file: