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 | int Rp_ParserXmlNodeIdentify(Rp_ParserXml *p, Rp_TreeNode n, |
---|
32 | const char *name, const char *id); |
---|
33 | void Rp_ParserXmlFindChild( Rp_ParserXml *p, Rp_TreeNode parent, |
---|
34 | const char *childName, const char *childId, size_t degree, |
---|
35 | Rp_TreeNode *child, size_t *numFound); |
---|
36 | Rp_TreeNode Rp_ParserXmlSearch( Rp_ParserXml *p, const char *path, int create); |
---|
37 | const char *Rp_ParserXmlGet(Rp_ParserXml *p, const char *path); |
---|
38 | void Rp_ParserXmlPut(Rp_ParserXml *p, const char *path, const char *val, int append); |
---|
39 | void Rp_ParserXmlPutF(Rp_ParserXml *p, const char *path, const char *val, ...); |
---|
40 | void Rp_ParserXmlAppendF(Rp_ParserXml *p, const char *path, const char *val, ...); |
---|
41 | |
---|
42 | Rp_Tree Rp_ParserXmlTreeClient(Rp_ParserXml *p); |
---|
43 | |
---|
44 | Rp_TreeNode Rp_ParserXmlElement(Rp_ParserXml *p, const char *path); |
---|
45 | Rp_TreeNode Rp_ParserXmlParent(Rp_ParserXml *p, const char *path); |
---|
46 | size_t Rp_ParserXmlChildren(Rp_ParserXml *p, const char *path, |
---|
47 | const char *type, Rp_Chain *children); |
---|
48 | size_t Rp_ParserXmlNumberChildren(Rp_ParserXml *p, const char *path, |
---|
49 | const char *type); |
---|
50 | void Rp_ParserXmlBaseNode(Rp_ParserXml *p, Rp_TreeNode node); |
---|
51 | |
---|
52 | const char *Rp_ParserXmlNodePath(Rp_ParserXml *p, Rp_TreeNode node); |
---|
53 | const char *Rp_ParserXmlNodeId(Rp_ParserXml *p, Rp_TreeNode node); |
---|
54 | |
---|
55 | const char *Rp_ParserXmlXml(Rp_ParserXml *p); |
---|
56 | const char *Rp_ParserXmlPathVal(Rp_ParserXml *p); |
---|
57 | |
---|
58 | #endif // RAPPTURE_PARSER_XML_H |
---|