arsa  2.7
arsa_xml.h
Go to the documentation of this file.
1 #ifndef _XML_H_
2 #define _XML_H_
3 
4 #if defined(ARSA_FRAMEWORK)
5 #ifndef ARSA_API
6 #define ARSA_API
7 #endif
8 
9 #ifndef ARSACALLCONV
10 #define ARSACALLCONV
11 #endif
12 #else
13 #include "arsa_begin_code.h"
14 #endif
15 
16 #include <irrlicht.h>
17 #include <pugixml.hpp>
18 
22 
23 extern ARSA_API int XML_ENCODING_AUTO;
24 extern ARSA_API int XML_ENCODING_UTF8;
25 extern ARSA_API int XML_ENCODING_UTF16;
26 extern ARSA_API int XML_ENCODING_UTF32;
27 
28 // json
29 extern ARSA_API bool ARSACALLCONV xml_load_json(arsa_xml_doc& doc, const void* dat, long len );
30 extern ARSA_API bool ARSACALLCONV xml_save_json(const arsa_xml_doc& doc, irr::core::stringc& out_stream );
31 extern ARSA_API bool ARSACALLCONV xml_save_json(const arsa_xml_node& node, irr::core::stringc& out_stream );
32 
33 // xml
34 extern ARSA_API bool ARSACALLCONV xml_load( arsa_xml_doc& doc, const void* dat, long len );
36 extern ARSA_API bool ARSACALLCONV xml_save( const arsa_xml_doc& doc, irr::core::stringc& out_stream, int encoding = XML_ENCODING_AUTO );
37 extern ARSA_API bool ARSACALLCONV xml_save( const arsa_xml_node& node, irr::core::stringc& out_stream, int encoding = XML_ENCODING_AUTO );
38 extern ARSA_API bool ARSACALLCONV xml_save_to_file(const arsa_xml_doc& doc, const irr::io::path& name, int encoding = XML_ENCODING_AUTO);
39 
40 extern ARSA_API bool ARSACALLCONV xml_is_empty( const arsa_xml_node& node );
42 extern ARSA_API const char* ARSACALLCONV xml_get_name( const arsa_xml_node& node );
46 extern ARSA_API arsa_xml_node ARSACALLCONV xml_get_node( const arsa_xml_node& node, const irr::core::stringc& xml_tag_name ); // founded first node then return
47 extern ARSA_API irr::u32 ARSACALLCONV xml_get_node( const arsa_xml_node& node, const irr::core::stringc& xml_tag_name , ArrayXmlNode& out_node_array );
49 extern ARSA_API irr::u32 ARSACALLCONV xml_get_node_by_type( const arsa_xml_node& node, const irr::core::stringc& type, ArrayXmlNode& out_node_array, bool ignore_case = false );
50 extern ARSA_API irr::u32 ARSACALLCONV xml_get_node_by_visible( arsa_xml_node& node, bool visible, ArrayXmlNode& out_node_array );
51 extern ARSA_API void ARSACALLCONV xml_calculate_id(const arsa_xml_node& node, int lastest_id );
52 extern ARSA_API void ARSACALLCONV xml_calculate_transformation(const arsa_xml_node& node, const irr::core::vector3df* position, const irr::core::vector3df* rotation );
53 extern ARSA_API bool ARSACALLCONV xml_is_visible( const arsa_xml_node& node, bool& out_visible ); // get visible node from xml, return bool is founded, parameter is value of visible
54 extern ARSA_API bool ARSACALLCONV xml_is_name_equal( const arsa_xml_node& node, irr::core::stringc& out_name ); // get node name from xml, return bool is founded, parameter is value of node name
56 extern ARSA_API bool ARSACALLCONV xml_remove_node_by_name( arsa_xml_node& node, const irr::core::stringc& name ); // name is tag name :-)
57 extern ARSA_API bool ARSACALLCONV xml_remove_node_by_visible( arsa_xml_node& node, bool visible = true );
64 extern ARSA_API const char* ARSACALLCONV xml_get_att_as_string( const arsa_xml_node& node, const irr::core::stringc& name );
72 extern ARSA_API arsa_xml_node ARSACALLCONV xml_new_node( arsa_xml_node& node, const irr::core::stringc& name, bool after = true );
83 extern ARSA_API arsa_xml_node ARSACALLCONV xml_child_insert( arsa_xml_node& root, const arsa_xml_node& node, bool insert_end = true );
89 
90 #endif // _XML_H_
ARSA_API const char *ARSACALLCONV xml_get_att_as_string(const arsa_xml_node &node, const irr::core::stringc &name)
The FileSystem manages files and archives and provides access to them.
Definition: IFileSystem.h:32
ARSA_API int XML_ENCODING_AUTO
ARSA_API int XML_ENCODING_UTF8
ARSA_API irr::core::quaternion ARSACALLCONV xml_get_att_as_queterion(const arsa_xml_node &node, const irr::core::stringc &name)
ARSA_API irr::core::vector3df ARSACALLCONV xml_get_att_as_vector3df(const arsa_xml_node &node, const irr::core::stringc &name)
Provides a generic interface for attributes and their values and the possibility to serialize them.
Definition: IAttributes.h:41
ARSA_API bool ARSACALLCONV xml_is_visible(const arsa_xml_node &node, bool &out_visible)
ARSA_API void ARSACALLCONV xml_new_att_bool(arsa_xml_node &node, const irr::core::stringc &name, bool value)
ARSA_API void ARSACALLCONV xml_new_att_int(arsa_xml_node &node, const irr::core::stringc &name, irr::s32 value)
ARSA_API arsa_xml_node ARSACALLCONV xml_get_first(const arsa_xml_doc &doc)
float f32
32 bit floating point variable.
Definition: irrTypes.h:108
ARSA_API void ARSACALLCONV xml_calculate_id(const arsa_xml_node &node, int lastest_id)
ARSA_API bool ARSACALLCONV xml_move_node_to_start_by_type(arsa_xml_node &node, const irr::core::stringc &type, bool start=true)
ARSA_API bool ARSACALLCONV xml_remove_node_by_name(arsa_xml_node &node, const irr::core::stringc &name)
ARSA_API bool ARSACALLCONV xml_remove_node_by_visible(arsa_xml_node &node, bool visible=true)
ARSA_API void ARSACALLCONV xml_remove_node_by_att_name(arsa_xml_node &node, const irr::core::stringc &prefix)
ARSA_API bool ARSACALLCONV xml_get_att_is_exist(const arsa_xml_node &node, const irr::core::stringc &name)
GLuint start
Definition: SDL_opengl.h:1571
GLuint const GLchar * name
ARSA_API bool ARSACALLCONV xml_save(const arsa_xml_doc &doc, irr::core::stringc &out_stream, int encoding=XML_ENCODING_AUTO)
Main header file of the irrlicht, the only file needed to include.
ARSA_API arsa_xml_node ARSACALLCONV xml_child_next(const arsa_xml_node &node)
ARSA_API irr::u32 ARSACALLCONV xml_child_count(const arsa_xml_node &node)
ARSA_API void ARSACALLCONV xml_calculate_transformation(const arsa_xml_node &node, const irr::core::vector3df *position, const irr::core::vector3df *rotation)
GLenum GLsizei len
Very simple string class with some useful features.
Definition: irrString.h:37
ARSA_API void ARSACALLCONV xml_new_att_float(arsa_xml_node &node, const irr::core::stringc &name, irr::f32 value)
ARSA_API void ARSACALLCONV xml_new_att_string(arsa_xml_node &node, const irr::core::stringc &name, const irr::core::stringc &value)
ARSA_API bool ARSACALLCONV xml_save_to_file(const arsa_xml_doc &doc, const irr::io::path &name, int encoding=XML_ENCODING_AUTO)
irr::core::array< arsa_xml_node > ArrayXmlNode
Definition: arsa_xml.h:21
ARSA_API bool ARSACALLCONV xml_set_att_as_string(arsa_xml_node &node, const irr::core::stringc &name, const irr::core::stringc &value)
pugi::xml_document arsa_xml_doc
Definition: arsa_xml.h:20
ARSA_API irr::video::SColor ARSACALLCONV xml_get_att_as_color(const arsa_xml_node &node, const irr::core::stringc &name)
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
ARSA_API void ARSACALLCONV xml_new_att_u32(arsa_xml_node &node, const irr::core::stringc &name, irr::u32 value)
ARSA_API bool ARSACALLCONV xml_load_json(arsa_xml_doc &doc, const void *dat, long len)
GLsizei const GLfloat * value
ARSA_API bool ARSACALLCONV xml_is_name_equal(const arsa_xml_node &node, irr::core::stringc &out_name)
ARSA_API bool ARSACALLCONV xml_save_json(const arsa_xml_doc &doc, irr::core::stringc &out_stream)
ARSA_API arsa_xml_node ARSACALLCONV xml_child_last(const arsa_xml_node &node)
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
ARSA_API const char *ARSACALLCONV xml_get_name(const arsa_xml_node &node)
ARSA_API arsa_xml_node ARSACALLCONV xml_get_parent(const arsa_xml_node &node)
ARSA_API bool ARSACALLCONV xml_is_sub_string_equal(const irr::core::stringc &name, const irr::core::stringc &sub)
ARSA_API int XML_ENCODING_UTF32
ARSA_API irr::u32 ARSACALLCONV xml_get_node_by_visible(arsa_xml_node &node, bool visible, ArrayXmlNode &out_node_array)
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition: IVideoDriver.h:151
Class representing a 32 bit ARGB color.
Definition: SColor.h:316
ARSA_API arsa_xml_node ARSACALLCONV xml_new_node(arsa_xml_node &node, const irr::core::stringc &name, bool after=true)
ARSA_API arsa_xml_node ARSACALLCONV xml_child_add(arsa_xml_doc &doc, const irr::core::stringc &name)
ARSA_API arsa_xml_node ARSACALLCONV xml_child_insert(arsa_xml_node &root, const arsa_xml_node &node, bool insert_end=true)
Self reallocating template array (like stl vector) with additional features.
Definition: irrArray.h:22
ARSA_API bool ARSACALLCONV xml_is_empty(const arsa_xml_node &node)
#define ARSA_API
ARSA_API bool ARSACALLCONV xml_load_from_file(arsa_xml_doc &doc, const irr::io::path &name)
ARSA_API arsa_xml_node ARSACALLCONV xml_child_first(const arsa_xml_node &node)
ARSA_API arsa_xml_node ARSACALLCONV xml_get_node(const arsa_xml_node &node, const irr::core::stringc &xml_tag_name)
ARSA_API bool ARSACALLCONV xml_remove_node_by_type(arsa_xml_node &node, const irr::core::stringc &type)
ARSA_API void ARSACALLCONV xml_new_att_vec(arsa_xml_node &node, const irr::core::stringc &name, const irr::core::vector3df &vec)
GLuint color
ARSA_API bool ARSACALLCONV xml_set_value(arsa_xml_node &node, const irr::core::stringc &value)
ARSA_API bool ARSACALLCONV xml_get_att_as_bool(const arsa_xml_node &node, const irr::core::stringc &name)
ARSA_API bool ARSACALLCONV xml_load(arsa_xml_doc &doc, const void *dat, long len)
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571
ARSA_API void ARSACALLCONV xml_new_att_color(arsa_xml_node &node, const irr::core::stringc &name, const irr::video::SColor &color)
Quaternion class for representing rotations.
Definition: quaternion.h:31
ARSA_API irr::s32 ARSACALLCONV xml_get_att_as_int(const arsa_xml_node &node, const irr::core::stringc &name)
ARSA_API irr::core::stringc ARSACALLCONV xml_get_value(const arsa_xml_node &node)
ARSA_API int XML_ENCODING_UTF16
ARSA_API irr::io::IAttributes *ARSACALLCONV xml_create_att(const arsa_xml_node &node, irr::video::IVideoDriver *driver, irr::io::IFileSystem *fs)
ARSA_API irr::f32 ARSACALLCONV xml_get_att_as_float(const arsa_xml_node &node, const irr::core::stringc &name)
ARSA_API bool ARSACALLCONV xml_remove_node(arsa_xml_node &node)
pugi::xml_node arsa_xml_node
Definition: arsa_xml.h:19
#define ARSACALLCONV
ARSA_API arsa_xml_node ARSACALLCONV xml_get_node_by_type(const arsa_xml_node &node, const irr::core::stringc &type)
ARSA_API void ARSACALLCONV xml_remove_node_by_att_name_value(arsa_xml_node &node, const irr::core::stringc &prefix, const irr::core::stringc &value)