1 | /* |
---|
2 | * ====================================================================== |
---|
3 | * AUTHOR: Derrick Kearney, Purdue University |
---|
4 | * Copyright (c) 2005-2009 Purdue Research Foundation |
---|
5 | * |
---|
6 | * See the file "license.terms" for information on usage and |
---|
7 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
8 | * ====================================================================== |
---|
9 | */ |
---|
10 | #include "RpTree.h" |
---|
11 | #include "RpChain.h" |
---|
12 | |
---|
13 | #ifndef RAPPTURE_PARSER_XML_H |
---|
14 | #define RAPPTURE_PARSER_XML_H |
---|
15 | |
---|
16 | #define PARSERXML_LEVEL_WIDTH 4 |
---|
17 | |
---|
18 | enum RapptureParserXmlFlags { |
---|
19 | RPXML_CREATE=(1<<0), /* Create the xml path if needed. */ |
---|
20 | RPXML_APPEND=(1<<1), /* Append data to the data already available. */ |
---|
21 | }; |
---|
22 | |
---|
23 | extern const char *Rp_ParserXml_Field_ID; |
---|
24 | |
---|
25 | typedef struct Rp_ParserXmlStruct Rp_ParserXml; |
---|
26 | |
---|
27 | Rp_ParserXml *Rp_ParserXmlCreate(); |
---|
28 | void Rp_ParserXmlDestroy(Rp_ParserXml **p); |
---|
29 | |
---|
30 | void Rp_ParserXmlParse(Rp_ParserXml *p, const char *xml); |
---|
31 | Rp_TreeNode Rp_ParserXmlSearch( Rp_ParserXml *p, const char *path, int create); |
---|
32 | const char *Rp_ParserXmlGet(Rp_ParserXml *p, const char *path); |
---|
33 | void Rp_ParserXmlPut(Rp_ParserXml *p, const char *path, const char *val, int append); |
---|
34 | void Rp_ParserXmlPutF(Rp_ParserXml *p, const char *path, const char *val, ...); |
---|
35 | void Rp_ParserXmlAppendF(Rp_ParserXml *p, const char *path, const char *val, ...); |
---|
36 | |
---|
37 | Rp_Tree Rp_ParserXmlTreeClient(Rp_ParserXml *p); |
---|
38 | |
---|
39 | Rp_TreeNode Rp_ParserXmlElement(Rp_ParserXml *p, const char *path); |
---|
40 | Rp_TreeNode Rp_ParserXmlParent(Rp_ParserXml *p, const char *path); |
---|
41 | size_t Rp_ParserXmlChildren(Rp_ParserXml *p, const char *path, |
---|
42 | const char *type, Rp_Chain *children); |
---|
43 | size_t Rp_ParserXmlNumberChildren(Rp_ParserXml *p, const char *path, |
---|
44 | const char *type); |
---|
45 | void Rp_ParserXmlBaseNode(Rp_ParserXml *p, Rp_TreeNode node); |
---|
46 | |
---|
47 | const char *Rp_ParserXmlNodePath(Rp_ParserXml *p, Rp_TreeNode node); |
---|
48 | const char *Rp_ParserXmlNodeId(Rp_ParserXml *p, Rp_TreeNode node); |
---|
49 | |
---|
50 | const char *Rp_ParserXmlXml(Rp_ParserXml *p); |
---|
51 | const char *Rp_ParserXmlPathVal(Rp_ParserXml *p); |
---|
52 | |
---|
53 | #endif // RAPPTURE_PARSER_XML_H |
---|