source: branches/blt4/src/objects/RpParserXML.h

Last change on this file was 3959, checked in by gah, 11 years ago

sync with trunk

File size: 2.3 KB
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Derrick Kearney, Purdue University
4 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
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
18enum 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
23extern const char *Rp_ParserXml_Field_ID;
24
25typedef struct Rp_ParserXmlStruct Rp_ParserXml;
26
27Rp_ParserXml *Rp_ParserXmlCreate();
28void Rp_ParserXmlDestroy(Rp_ParserXml **p);
29
30void Rp_ParserXmlParse(Rp_ParserXml *p, const char *xml);
31int Rp_ParserXmlNodeIdentify(Rp_ParserXml *p, Rp_TreeNode n,
32    const char *name, const char *id);
33void 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);
36Rp_TreeNode Rp_ParserXmlSearch( Rp_ParserXml *p, const char *path, int create);
37const char *Rp_ParserXmlGet(Rp_ParserXml *p, const char *path);
38void Rp_ParserXmlPut(Rp_ParserXml *p, const char *path, const char *val, int append);
39void Rp_ParserXmlPutF(Rp_ParserXml *p, const char *path, const char *val, ...);
40void Rp_ParserXmlAppendF(Rp_ParserXml *p, const char *path, const char *val, ...);
41
42Rp_Tree Rp_ParserXmlTreeClient(Rp_ParserXml *p);
43
44Rp_TreeNode Rp_ParserXmlElement(Rp_ParserXml *p, const char *path);
45Rp_TreeNode Rp_ParserXmlParent(Rp_ParserXml *p, const char *path);
46size_t Rp_ParserXmlChildren(Rp_ParserXml *p, const char *path,
47    const char *type, Rp_Chain *children);
48size_t Rp_ParserXmlNumberChildren(Rp_ParserXml *p, const char *path,
49    const char *type);
50void Rp_ParserXmlBaseNode(Rp_ParserXml *p, Rp_TreeNode node);
51
52const char *Rp_ParserXmlNodePath(Rp_ParserXml *p, Rp_TreeNode node);
53const char *Rp_ParserXmlNodeId(Rp_ParserXml *p, Rp_TreeNode node);
54
55const char *Rp_ParserXmlXml(Rp_ParserXml *p);
56const char *Rp_ParserXmlPathVal(Rp_ParserXml *p);
57
58#endif // RAPPTURE_PARSER_XML_H
Note: See TracBrowser for help on using the repository browser.