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

Unified Diff: ios/public/provider/chrome/browser/omaha/omaha_xml_writer.h

Issue 2482173002: [ios] Adds OmahaServiceProvider. (Closed)
Patch Set: XML Created 4 years, 1 month 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
Index: ios/public/provider/chrome/browser/omaha/omaha_xml_writer.h
diff --git a/ios/public/provider/chrome/browser/omaha/omaha_xml_writer.h b/ios/public/provider/chrome/browser/omaha/omaha_xml_writer.h
new file mode 100644
index 0000000000000000000000000000000000000000..a959faa6b3655ecaa4623ec5eb01c0ea6210a1c2
--- /dev/null
+++ b/ios/public/provider/chrome/browser/omaha/omaha_xml_writer.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_OMAHA_OMAHA_XML_WRITER_H_
+#define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_OMAHA_OMAHA_XML_WRITER_H_
+
+// OmahaXmlWriter is a helper class to generate XML for the Omaha request.
+class OmahaXmlWriter {
+ public:
+ OmahaXmlWriter() = default;
+ virtual ~OmahaXmlWriter() = default;
+
+ // Starts a new element with the given |name|.
+ virtual void StartElement(const char* name) = 0;
+
+ // Ends the current element.
+ virtual void EndElement() = 0;
+
+ // Writes an attribute with the given |name| and |value| to the current
+ // element.
+ virtual void WriteAttribute(const char* name, const char* value) = 0;
+
+ // Finalizes the XML document. Calling StartElement(), EndElement(), or
+ // WriteAttribute() will have no effect after calling this method.
+ virtual void Finalize() = 0;
+
+ // Returns the generated XML. This method should only be called after
+ // Finalize().
+ virtual std::string GetContentAsString() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OmahaXmlWriter);
+};
+
+#endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_OMAHA_OMAHA_XML_WRITER_H_

Powered by Google App Engine
This is Rietveld 408576698