Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: webrtc/libjingle/xmllite/xmlbuilder.h

Issue 2618633003: Revert of Remove webrtc/libjingle/{xmllite,xmpp} (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/libjingle/xmllite/qname_unittest.cc ('k') | webrtc/libjingle/xmllite/xmlbuilder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/libjingle/xmllite/xmlbuilder.h
diff --git a/webrtc/libjingle/xmllite/xmlbuilder.h b/webrtc/libjingle/xmllite/xmlbuilder.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b48f2824797a5a3e1dcf1d39e6dd02227feef6e
--- /dev/null
+++ b/webrtc/libjingle/xmllite/xmlbuilder.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2004 The WebRTC Project Authors. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef _xmlbuilder_h_
+#define _xmlbuilder_h_
+
+#include <memory>
+#include <string>
+#include <vector>
+#include "webrtc/libjingle/xmllite/xmlparser.h"
+
+#ifdef EXPAT_RELATIVE_PATH
+#include "expat.h"
+#else
+#include "third_party/expat/v2_0_1/Source/lib/expat.h"
+#endif // EXPAT_RELATIVE_PATH
+
+namespace buzz {
+
+class XmlElement;
+class XmlParseContext;
+
+
+class XmlBuilder : public XmlParseHandler {
+public:
+ XmlBuilder();
+
+ static XmlElement * BuildElement(XmlParseContext * pctx,
+ const char * name, const char ** atts);
+ virtual void StartElement(XmlParseContext * pctx,
+ const char * name, const char ** atts);
+ virtual void EndElement(XmlParseContext * pctx, const char * name);
+ virtual void CharacterData(XmlParseContext * pctx,
+ const char * text, int len);
+ virtual void Error(XmlParseContext * pctx, XML_Error);
+ virtual ~XmlBuilder();
+
+ void Reset();
+
+ // Take ownership of the built element; second call returns NULL
+ XmlElement * CreateElement();
+
+ // Peek at the built element without taking ownership
+ XmlElement * BuiltElement();
+
+private:
+ XmlElement * pelCurrent_;
+ std::unique_ptr<XmlElement> pelRoot_;
+ std::unique_ptr<std::vector<XmlElement*> > pvParents_;
+};
+
+}
+
+#endif
« no previous file with comments | « webrtc/libjingle/xmllite/qname_unittest.cc ('k') | webrtc/libjingle/xmllite/xmlbuilder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698