summaryrefslogtreecommitdiff
path: root/docs/samples/save_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'docs/samples/save_file.cpp')
-rw-r--r--docs/samples/save_file.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/samples/save_file.cpp b/docs/samples/save_file.cpp
new file mode 100644
index 0000000..44bcfd1
--- /dev/null
+++ b/docs/samples/save_file.cpp
@@ -0,0 +1,15 @@
+#include "pugixml.hpp"
+
+#include <iostream>
+
+int main()
+{
+ // get a test document
+ pugi::xml_document doc;
+ doc.load("<foo bar='baz'>hey</foo>");
+
+ //[code_save_file
+ // save document to file
+ std::cout << "Saving result: " << doc.save_file("save_file_output.xml") << std::endl;
+ //]
+}