diff options
Diffstat (limited to 'docs/samples/save_custom_writer.cpp')
-rw-r--r-- | docs/samples/save_custom_writer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/samples/save_custom_writer.cpp b/docs/samples/save_custom_writer.cpp index 6ea4300..fe08b72 100644 --- a/docs/samples/save_custom_writer.cpp +++ b/docs/samples/save_custom_writer.cpp @@ -11,7 +11,7 @@ struct xml_string_writer: pugi::xml_writer virtual void write(const void* data, size_t size) { - result += std::string(static_cast<const char*>(data), size); + result.append(static_cast<const char*>(data), size); } }; //] @@ -94,7 +94,7 @@ int main() { // get a test document pugi::xml_document doc; - doc.load("<foo bar='baz'>hey</foo>"); + doc.load_string("<foo bar='baz'>hey</foo>"); // get contents as std::string (single pass) std::cout << "contents: [" << node_to_string(doc) << "]\n"; |