1 // Copyright 2012 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "third_party/libxml/chromium/libxml_utils.h" 6 7 namespace internal { 8 XmlStringToStdString(const xmlChar * xmlstring)9std::string XmlStringToStdString(const xmlChar* xmlstring) { 10 if (!xmlstring) 11 return std::string(); 12 13 // xmlChar*s are UTF-8, so this cast is safe. 14 return std::string(reinterpret_cast<const char*>(xmlstring)); 15 } 16 17 } // namespace internal 18