Annotation of gpl/axl/src/axl_doc.h, revision 1.1.1.2
1.1 misho 1: /*
2: * LibAxl: Another XML library
3: * Copyright (C) 2006 Advanced Software Production Line, S.L.
4: *
5: * This program is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public License
7: * as published by the Free Software Foundation; either version 2.1 of
8: * the License, or (at your option) any later version.
9: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this program; if not, write to the Free
17: * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18: * 02111-1307 USA
19: *
20: * You may find a copy of the license under this software is released
21: * at COPYING file. This is LGPL software: you are welcome to
22: * develop proprietary applications using this library without any
23: * royalty or fee but returning back any change, improvement or
24: * addition in the form of source code, project image, documentation
25: * patches, etc.
26: *
27: * For commercial support on build XML enabled solutions contact us:
28: *
29: * Postal address:
30: * Advanced Software Production Line, S.L.
31: * Edificio Alius A, Oficina 102,
32: * C/ Antonio Suarez Nº 10,
33: * Alcalá de Henares 28802 Madrid
34: * Spain
35: *
36: * Email address:
37: * info@aspl.es - http://www.aspl.es/xml
38: */
39: #ifndef __AXL_DOC_H__
40: #define __AXL_DOC_H__
41:
42: #include <axl_decl.h>
43:
44: BEGIN_C_DECLS
45:
46: /**
47: * \addtogroup axl_doc_module
48: * @{
49: */
50:
51: axlDoc * axl_doc_create (const char * version,
52: const char * encoding,
53: axl_bool standalone);
54:
55: axlDoc * axl_doc_parse (const char * entity,
56: int entity_size,
57: axlError ** error);
58:
59: axlDoc * axl_doc_parse_strings (axlError ** error,
60: ...);
61:
62: axlDoc * axl_doc_parse_from_file (const char * file_path,
63: axlError ** error);
64:
65: axl_bool axl_doc_dump (axlDoc * doc,
66: char ** content,
67: int * size);
68:
69: axl_bool axl_doc_dump_pretty (axlDoc * doc,
70: char ** content,
71: int * size,
72: int tabular);
73:
74: axl_bool axl_doc_dump_to_file (axlDoc * doc,
75: const char * file_path);
76:
77: axl_bool axl_doc_dump_pretty_to_file (axlDoc * doc,
78: const char * file_path,
79: int tabular);
80:
81: int axl_doc_get_flat_size (axlDoc * doc);
82:
1.1.1.2 ! misho 83: int axl_doc_get_flat_size_pretty (axlDoc * doc, int tabular);
! 84:
1.1 misho 85: axl_bool axl_doc_are_equal (axlDoc * doc,
86: axlDoc * doc2);
87:
88: axl_bool axl_doc_are_equal_trimmed (axlDoc * doc,
89: axlDoc * doc2);
90:
91: axl_bool axl_doc_are_equal_full (axlDoc * doc,
92: axlDoc * doc2,
93: axl_bool trimmed,
94: axlError ** error);
95:
96: axlNode * axl_doc_get_root (axlDoc * doc);
97:
98: void axl_doc_set_root (axlDoc * doc,
99: axlNode * root);
100:
101: axlList * axl_doc_get_list (axlDoc * doc,
102: const char * path_to);
103:
104: axlNode * axl_doc_get (axlDoc * doc,
105: const char * path_to);
106:
107: /**
108: * @brief Convenience macro that allows to call \ref
109: * axl_node_find_called, providing a document, making the parent
110: * reference to use the root document node.
111: *
112: * See \ref axl_node_find_called for more information.
113: *
114: * @param doc The document where the node lookup will be produced.
115: * @param name The child node name that is looked up.
116: *
117: * @return A reference to the node found or NULL if it fails to find
118: * the node requested.
119: */
120: #define axl_doc_find_called(doc,name) (axl_node_find_called(axl_doc_get_root(doc),name))
121:
122: const char * axl_doc_get_content_at (axlDoc * doc,
123: const char * path_to,
124: int * content_size);
125:
126: const char * axl_doc_get_encoding (axlDoc * doc);
127:
128: axl_bool axl_doc_get_standalone (axlDoc * doc);
129:
130: void axl_doc_free (axlDoc * doc);
131:
132: void axl_doc_set_child_current_parent (axlDoc * doc,
133: axlNode * node);
134:
135: void axl_doc_pop_current_parent (axlDoc * doc);
136:
137: void axl_doc_add_pi_target (axlDoc * doc,
138: char * target,
139: char * content);
140:
141: axl_bool axl_doc_has_pi_target (axlDoc * doc,
142: char * pi_target);
143:
144: char * axl_doc_get_pi_target_content (axlDoc * doc,
145: char * pi_target);
146:
147: axlList * axl_doc_get_pi_target_list (axlDoc * doc);
148:
149: axlPI * axl_pi_create (char * name,
150: char * content);
151:
152: axlPI * axl_pi_copy (axlPI * pi);
153:
154: axl_bool axl_pi_are_equal (axlPI * pi,
155: axlPI * pi2);
156:
157: char * axl_pi_get_name (axlPI * pi);
158:
159: char * axl_pi_get_content (axlPI * pi);
160:
161: void axl_pi_free (axlPI * pi);
162:
163: int axl_pi_get_size (axlPI * pi);
164:
165: axl_bool axl_doc_iterate (axlDoc * doc,
166: AxlIterationMode mode,
167: axlIterationFunc func,
168: axlPointer ptr);
169:
170: axl_bool axl_doc_iterate_full (axlDoc * doc,
171: AxlIterationMode mode,
172: axlIterationFunc2 func,
173: axlPointer ptr,
174: axlPointer ptr2);
175:
176: axl_bool axl_doc_iterate_full_from (axlDoc * doc,
177: axlNode * starting_from,
178: AxlIterationMode mode,
179: axlIterationFunc2 func,
180: axlPointer ptr,
181: axlPointer ptr2);
182:
183: /* private API starts from here, do not use this API */
184:
185: axl_bool axl_doc_consume_comments (axlDoc * doc,
186: axlStream * stream,
187: axlError ** error);
188:
189: axl_bool axl_doc_consume_pi (axlDoc * doc,
190: axlNode * node,
191: axlStream * stream,
192: axlError ** error);
193:
194: axlFactory * axl_doc_get_item_factory (axlDoc * doc);
195:
196: /* configuration API */
197: axlDocDetectCodification axl_doc_set_detect_codification_func (axlDocDetectCodification func,
198: axlPointer user_data);
199:
200: axlDocConfigureCodification axl_doc_set_configure_codification_func (axlDocConfigureCodification func,
201: axlPointer user_data);
202:
203: /* @} */
204:
205: END_C_DECLS
206:
207: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>