source: trunk/src/objects/RpParserXML.h @ 1568

Last change on this file since 1568 was 1566, checked in by dkearney, 15 years ago

updates to Rappture::Library and Rappture::Number objects to demo how the library should store objects and generate the xml for those objects upon request. opting for configure() and dump() functions for objects. the object should know how to configure it self from a string of xml, tree object or (in the future) blob of hdf5. added some rudimentary examples of using the library object.

File size: 2.0 KB
Line 
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
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);
31Rp_TreeNode Rp_ParserXmlSearch( Rp_ParserXml *p, const char *path, int create);
32const char *Rp_ParserXmlGet(Rp_ParserXml *p, const char *path);
33void Rp_ParserXmlPut(Rp_ParserXml *p, const char *path, const char *val, int append);
34void Rp_ParserXmlPutF(Rp_ParserXml *p, const char *path, const char *val, ...);
35void Rp_ParserXmlAppendF(Rp_ParserXml *p, const char *path, const char *val, ...);
36
37Rp_Tree Rp_ParserXmlTreeClient(Rp_ParserXml *p);
38
39Rp_TreeNode Rp_ParserXmlElement(Rp_ParserXml *p, const char *path);
40Rp_TreeNode Rp_ParserXmlParent(Rp_ParserXml *p, const char *path);
41size_t Rp_ParserXmlChildren(Rp_ParserXml *p, const char *path,
42    const char *type, Rp_Chain *children);
43size_t Rp_ParserXmlNumberChildren(Rp_ParserXml *p, const char *path,
44    const char *type);
45void Rp_ParserXmlBaseNode(Rp_ParserXml *p, Rp_TreeNode node);
46
47const char *Rp_ParserXmlNodePath(Rp_ParserXml *p, Rp_TreeNode node);
48const char *Rp_ParserXmlNodeId(Rp_ParserXml *p, Rp_TreeNode node);
49
50const char *Rp_ParserXmlXml(Rp_ParserXml *p);
51const char *Rp_ParserXmlPathVal(Rp_ParserXml *p);
52
53#endif // RAPPTURE_PARSER_XML_H
Note: See TracBrowser for help on using the repository browser.