OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "jingle/notifier/listener/xml_element_util.h" | 5 #include "jingle/notifier/listener/xml_element_util.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "talk/xmllite/qname.h" | 11 #include "talk/xmllite/qname.h" |
12 #include "talk/xmllite/xmlconstants.h" | 12 #include "talk/xmllite/xmlconstants.h" |
13 #include "talk/xmllite/xmlelement.h" | 13 #include "talk/xmllite/xmlelement.h" |
14 #include "talk/xmllite/xmlprinter.h" | 14 #include "talk/xmllite/xmlprinter.h" |
15 | 15 |
16 namespace notifier { | 16 namespace notifier { |
17 | 17 |
18 std::string XmlElementToString(const buzz::XmlElement& xml_element) { | 18 std::string XmlElementToString(const buzz::XmlElement& xml_element) { |
19 std::ostringstream xml_stream; | 19 std::ostringstream xml_stream; |
20 buzz::XmlPrinter::PrintXml(&xml_stream, &xml_element); | 20 buzz::XmlPrinter::PrintXml(&xml_stream, &xml_element); |
(...skipping 21 matching lines...) Expand all Loading... |
42 buzz::XmlElement* MakeStringXmlElement(const char* name, const char* value) { | 42 buzz::XmlElement* MakeStringXmlElement(const char* name, const char* value) { |
43 const buzz::QName elementQName(buzz::STR_EMPTY, name); | 43 const buzz::QName elementQName(buzz::STR_EMPTY, name); |
44 const buzz::QName dataAttrQName(buzz::STR_EMPTY, "data"); | 44 const buzz::QName dataAttrQName(buzz::STR_EMPTY, "data"); |
45 buzz::XmlElement* data_xml_element = | 45 buzz::XmlElement* data_xml_element = |
46 new buzz::XmlElement(elementQName, true); | 46 new buzz::XmlElement(elementQName, true); |
47 data_xml_element->AddAttr(dataAttrQName, value); | 47 data_xml_element->AddAttr(dataAttrQName, value); |
48 return data_xml_element; | 48 return data_xml_element; |
49 } | 49 } |
50 | 50 |
51 } // namespace notifier | 51 } // namespace notifier |
OLD | NEW |