| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_COMMON_LIBXML_UTILS_H__ | 5 #ifndef CHROME_COMMON_LIBXML_UTILS_H__ |
| 6 #define CHROME_COMMON_LIBXML_UTILS_H__ | 6 #define CHROME_COMMON_LIBXML_UTILS_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "libxml/xmlreader.h" | 10 #include "libxml/xmlreader.h" |
| 11 #include "libxml/xmlwriter.h" | 11 #include "libxml/xmlwriter.h" |
| 12 #include "base/scoped_ptr.h" | |
| 13 | 12 |
| 14 // Converts a libxml xmlChar* into a UTF-8 std::string. | 13 // Converts a libxml xmlChar* into a UTF-8 std::string. |
| 15 // NULL inputs produce an empty string. | 14 // NULL inputs produce an empty string. |
| 16 std::string XmlStringToStdString(const xmlChar* xmlstring); | 15 std::string XmlStringToStdString(const xmlChar* xmlstring); |
| 17 | 16 |
| 18 // libxml uses a global error function pointer for reporting errors. | 17 // libxml uses a global error function pointer for reporting errors. |
| 19 // A ScopedXmlErrorFunc object lets you change the global error pointer | 18 // A ScopedXmlErrorFunc object lets you change the global error pointer |
| 20 // for the duration of the object's lifetime. | 19 // for the duration of the object's lifetime. |
| 21 class ScopedXmlErrorFunc { | 20 class ScopedXmlErrorFunc { |
| 22 public: | 21 public: |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 173 |
| 175 private: | 174 private: |
| 176 // The underlying libxml xmlTextWriter. | 175 // The underlying libxml xmlTextWriter. |
| 177 xmlTextWriterPtr writer_; | 176 xmlTextWriterPtr writer_; |
| 178 | 177 |
| 179 // Stores the output. | 178 // Stores the output. |
| 180 xmlBufferPtr buffer_; | 179 xmlBufferPtr buffer_; |
| 181 }; | 180 }; |
| 182 | 181 |
| 183 #endif // CHROME_COMMON_LIBXML_UTILS_H__ | 182 #endif // CHROME_COMMON_LIBXML_UTILS_H__ |
| OLD | NEW |