diff --git a/src/pedro/pedrodom.h b/src/pedro/pedrodom.h
index 9c6651259bdd288991ba7cf1f719f788dfd999dc..b8078dce14fa46abb9e3d29c7dd1bfbf19a9334c 100644 (file)
--- a/src/pedro/pedrodom.h
+++ b/src/pedro/pedrodom.h
* Authors:
* Bob Jamison
*
- * Copyright (C) 2005-2006 Bob Jamison
+ * Copyright (C) 2005-2007 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <glib.h>
+
#include <string>
#include <vector>
Element *getParent()
{ return parent; }
+ Element *getFirstChild()
+ { return (children.size() == 0) ? NULL : children[0]; }
+
std::vector<Element *> getChildren()
{ return children; }
DOMString getAttribute(const DOMString &name);
+ std::vector<Attribute> &getAttributes()
+ { return attributes; }
+
DOMString getTagAttribute(const DOMString &tagName, const DOMString &attrName);
DOMString getTagValue(const DOMString &tagName);
void addNamespace(const DOMString &prefix, const DOMString &namespaceURI);
+ bool exists(const DOMString &name)
+ { return (findElements(name).size() > 0); }
/**
* Prettyprint an XML tree to an output stream. Elements are indented
* @param fileName the name of the file to read
* @return a pointer to the root of the XML document;
*/
- Element *parseFile(const char *fileName);
+ Element *parseFile(const DOMString &fileName);
/**
* Utility method to preprocess a string for XML
*/
static DOMString encode(const DOMString &str);
+ /**
+ * Removes whitespace from beginning and end of a string
+ */
+ DOMString trim(const DOMString &s);
private:
void getLineAndColumn(long pos, long *lineNr, long *colNr);
- void error(char *fmt, ...);
+ void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
int peek(long pos);