ARSA Language  2.8
(Encryption, GPU and Web 3.0)
xml.h
Go to the documentation of this file.
1 
15 class xml
16 {
17 public:
19 
30  int xml(const char* filename);
31 
33 
61  int xml(const char* str);
62 
64 
75  int json(const char* filename);
76 
78 
122  int json(const char* str);
123 
125 
130  bool save(int doc_id, const char* filename);
131 
133 
138  bool save_json(int doc_id, const char* filename);
139 
141 
145  bool close(int doc_id);
146 
148 
152  bool close_node(int node_id);
153 
155 
159  bool close_array(int array_id);
160 
162 
167  int first(int doc_id);
168 
170 
175  int first_child(int node_id);
176 
178 
183  int next_child(int node_id);
184 
186 
192  int get_node(int node_id, const char* node_name);
193 
195 
200  int get_array(int node_id, const char* node_name);
201 
203 
207  const char* get_name(int node_id);
208 
210 
214  const char* get_value(int node_id);
215 
217 
222  const char* get_att(int node_id, const char* att_name);
223 
225 
229  int new();
230 
232 
239  int new_node(int root_id, const char* node_name, const char* value = "");
240 
242 
248  bool new_att(int node_id, const char* att_name, const char* att_value);
249 
251 
257  int add_child(int doc_id, const char* node_name);
258 
260 
266  int insert_child(int root_id, int child_id);
267 
269 
274  bool set_value(int node_id, const char* value);
275 
277 
283  bool set_att_value(int node_id, const char* att_name, const char* att_value);
284 
286 
291  int get_node_count(int node_id, const char* node_name);
292 
294 
298  int get_array_count(int array_id);
299 
301 
309  int get_array_element(int array_id, int index);
310 
312 
318  void for(int array_id, void* function);
319 
321 
439  const char* value(int node_id, const char* path);
440 
442 
447  int count(int node_id, const char* path);
448 
450 
455  int array(int node_id, const char* path);
456 
458 
464  const char* array_value(int array_id, int array_num, const char* path);
465 
467 
471  void log(int id, const char* option = "xml");
472 
474 
478  void logarray(int array_id, const char* option = "xml");
479 
481 
485  const char* tostring(int doc_id);
486 
488 
492  const char* tostringjson(int doc_id);
493 
495 
512  bool fset( const char* path, const char* value, const char* filename, const char* option = "xml", bool push_back = false );
513 
515 
530  const char* fget(const char* path, const char* filename, const char* option = "xml");
531 
533 
544  int fcount(const char* path, const char* filename, const char* option = "xml");
545 
547 
558  bool ferase(const char* path, const char* filename, const char* option = "xml");
559 
561 
572  bool fsave(const char* src_filename, const char* src_option, const char* dest_filename, const char* dest_option);
573 
574 };
void log(int id, const char *option="xml")
debug and print xml or json buffer in log window
const char * get_att(int node_id, const char *att_name)
get value from attribute of this node id
int fcount(const char *path, const char *filename, const char *option="xml")
get path count in file immediately.
const char * tostring(int doc_id)
saving xml to string buffer
int insert_child(int root_id, int child_id)
insert xml node to another root node and return new node as id.
int new_node(int root_id, const char *node_name, const char *value="")
add xml node with a name to root node and return new node as id.
int next_child(int node_id)
get next xml child in this node id.
int get_node_count(int node_id, const char *node_name)
get node count of this xml node.
bool close_node(int node_id)
close and free memory xml node.
void logarray(int array_id, const char *option="xml")
debug and print array of xml or json buffer in log window
bool fset(const char *path, const char *value, const char *filename, const char *option="xml", bool push_back=false)
set value to path at file immediately.
const char * fget(const char *path, const char *filename, const char *option="xml")
get value from path in file immediately.
bool close_array(int array_id)
close and free memory xml nodes array functions: xml.get_node_array() from.
int get_array_count(int array_id)
get array count.
const char * tostringjson(int doc_id)
saving json to string buffer
int array(int node_id, const char *path)
get all xml childs with same path, use last path as element name. MUST call xml....
int json(const char *filename)
loading json from file
int add_child(int doc_id, const char *node_name)
add xml node with a name to document node and return new node as id.
bool save(int doc_id, const char *filename)
saving xml to file
int first(int doc_id)
get xml root node from doc id.
const char * array_value(int array_id, int array_num, const char *path)
get value in array follow path
bool ferase(const char *path, const char *filename, const char *option="xml")
erase path in file immediately.
int count(int node_id, const char *path)
get array count from path.
bool set_att_value(int node_id, const char *att_name, const char *att_value)
set attribute value to this node id.
const char * get_name(int node_id)
get name of this node id
bool new_att(int node_id, const char *att_name, const char *att_value)
add attribute to xml node by attribute name and value.
int get_array(int node_id, const char *node_name)
get all xml childs with same name from this node id. MUST call xml.close_array() after used for mem...
bool fsave(const char *src_filename, const char *src_option, const char *dest_filename, const char *dest_option)
convert file format to another file format.
int get_node(int node_id, const char *node_name)
get first xml child from all childs in this node id.
int first_child(int node_id)
get xml root node from node id.
bool save_json(int doc_id, const char *filename)
saving json to file
int get_array_element(int array_id, int index)
get xml node from array with index.
Definition: xml.h:15
const char * value(int node_id, const char *path)
get value of this path, use last path as element name
const char * get_value(int node_id)
get value of this node id
bool close(int doc_id)
close and free memory xml document functions: xml(), xml.json() and xml.new() from.
int xml(const char *filename)
loading xml from file
bool set_value(int node_id, const char *value)
set value to xml node.