From 1a06d7d3de3d2f30eaf3d56b7b2d0fa3446d46d8 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 18 Nov 2014 09:30:19 -0800 Subject: docs: Regenerated documentation Also fix documentation jam rules for Windows. --- docs/quickstart.html | 159 ++++++++++++++++++++++++++++----------------------- 1 file changed, 89 insertions(+), 70 deletions(-) (limited to 'docs/quickstart.html') diff --git a/docs/quickstart.html b/docs/quickstart.html index 8f8fa4e..c702852 100644 --- a/docs/quickstart.html +++ b/docs/quickstart.html @@ -1,31 +1,31 @@ -pugixml 1.4 +pugixml 1.5 - +

pugixml is a light-weight C++ XML @@ -59,7 +59,7 @@

No documentation is perfect, neither is this one. If you encounter a description - that is unclear, please file an issue as described in Feedback. Also if + that is unclear, please file an issue as described in Feedback. Also if you can spare the time for a full proof-reading, including spelling and grammar, that would be great! Please send me an e-mail; as a token of appreciation, your name will be included into the corresponding @@ -69,14 +69,14 @@

pugixml is distributed in source form. You can download a source distribution via one of the following links:

-
https://github.com/zeux/pugixml/releases/download/v1.4/pugixml-1.4.zip
-https://github.com/zeux/pugixml/releases/download/v1.4/pugixml-1.4.tar.gz
+
https://github.com/zeux/pugixml/releases/download/v1.5/pugixml-1.5.zip
+https://github.com/zeux/pugixml/releases/download/v1.5/pugixml-1.5.tar.gz
 

The distribution contains library source, documentation (the guide you're @@ -109,7 +109,7 @@

pugixml stores XML data in DOM-like way: the entire XML document (both document @@ -226,7 +226,7 @@

pugixml provides several functions for loading XML data from various places @@ -250,6 +250,7 @@ This is an example of loading XML document from file (samples/load_file.cpp):

+

pugi::xml_document doc;
 
@@ -281,9 +282,10 @@
         This is an example of handling loading errors (samples/load_error_handling.cpp):
       

+

pugi::xml_document doc;
-pugi::xml_parse_result result = doc.load(source);
+pugi::xml_parse_result result = doc.load_string(source);
 
 if (result)
     std::cout << "XML [" << source << "] parsed without errors, attr value: [" << doc.child("node").attribute("attr").value() << "]\n\n";
@@ -322,6 +324,7 @@
         read the sample code for more examples:
       

+

const char source[] = "<mesh name='sphere'><bounds>0 0 1 1</bounds></mesh>";
 size_t size = sizeof(source);
@@ -329,16 +332,17 @@
 

+

-
// You can use load_buffer_inplace to load document from mutable memory block; the block's lifetime must exceed that of document
-char* buffer = new char[size];
+
// You can use load_buffer_inplace to load document from mutable memory block; the block's lifetime must exceed that of document
+char* buffer = new char[size];
 memcpy(buffer, source, size);
 
-// The block can be allocated by any method; the block is modified during parsing
-pugi::xml_parse_result result = doc.load_buffer_inplace(buffer, size);
+// The block can be allocated by any method; the block is modified during parsing
+pugi::xml_parse_result result = doc.load_buffer_inplace(buffer, size);
 
-// You have to destroy the block yourself after the document is no longer used
-delete[] buffer;
+// You have to destroy the block yourself after the document is no longer used
+delete[] buffer;
 

@@ -348,6 +352,7 @@ the sample code for more complex examples involving wide streams and locales:

+

std::ifstream stream("weekly-utf-8.xml");
 pugi::xml_parse_result result = doc.load(stream);
@@ -357,7 +362,7 @@
 

pugixml features an extensive interface for getting various types of data @@ -394,6 +399,7 @@ This is an example of using these functions (samples/traverse_base.cpp):

+

for (pugi::xml_node tool = tools.child("Tool"); tool; tool = tool.next_sibling("Tool"))
 {
@@ -414,6 +420,7 @@
         functions (samples/traverse_base.cpp):
       

+

std::cout << "Tool for *.dae generation: " << tools.find_child_by_attribute("Tool", "OutputFileMasks", "*.dae").attribute("Filename").value() << "\n";
 
@@ -438,6 +445,7 @@
         Here is an example of using iterators for document traversal (samples/traverse_iter.cpp):
       

+

for (pugi::xml_node_iterator it = tools.begin(); it != tools.end(); ++it)
 {
@@ -466,6 +474,7 @@
         (samples/traverse_rangefor.cpp):
       

+

for (pugi::xml_node tool: tools.children("Tool"))
 {
@@ -499,22 +508,24 @@
         This is an example of traversing tree hierarchy with xml_tree_walker (samples/traverse_walker.cpp):
       

+

struct simple_walker: pugi::xml_tree_walker
 {
     virtual bool for_each(pugi::xml_node& node)
     {
-        for (int i = 0; i < depth(); ++i) std::cout << "  "; // indentation
-
+        for (int i = 0; i < depth(); ++i) std::cout << "  "; // indentation
+
         std::cout << node_types[node.type()] << ": name='" << node.name() << "', value='" << node.value() << "'\n";
 
-        return true; // continue traversal
-    }
+        return true; // continue traversal
+    }
 };
 

+

simple_walker walker;
 doc.traverse(walker);
@@ -528,6 +539,7 @@
         examples:
       

+

pugi::xpath_node_set tools = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote='true' and @DeriveCaptionFrom='lastparam']");
 
@@ -539,7 +551,7 @@
     std::cout << node.node().attribute("Filename").value() << "\n";
 }
 
-pugi::xpath_node build_tool = doc.select_single_node("//Tool[contains(Description, 'build system')]");
+pugi::xpath_node build_tool = doc.select_node("//Tool[contains(Description, 'build system')]");
 
 if (build_tool)
     std::cout << "Build tool: " << build_tool.node().attribute("Filename").value() << "\n";
@@ -559,7 +571,7 @@
 

The document in pugixml is fully mutable: you can completely change the document @@ -590,36 +602,38 @@ example of setting node/attribute name and value (samples/modify_base.cpp):

+

pugi::xml_node node = doc.child("node");
 
-// change node name
-std::cout << node.set_name("notnode");
+// change node name
+std::cout << node.set_name("notnode");
 std::cout << ", new node name: " << node.name() << std::endl;
 
-// change comment text
-std::cout << doc.last_child().set_value("useless comment");
+// change comment text
+std::cout << doc.last_child().set_value("useless comment");
 std::cout << ", new comment text: " << doc.last_child().value() << std::endl;
 
-// we can't change value of the element or name of the comment
-std::cout << node.set_value("1") << ", " << doc.last_child().set_name("2") << std::endl;
+// we can't change value of the element or name of the comment
+std::cout << node.set_value("1") << ", " << doc.last_child().set_name("2") << std::endl;
 

+

pugi::xml_attribute attr = node.attribute("id");
 
-// change attribute name/value
-std::cout << attr.set_name("key") << ", " << attr.set_value("345");
+// change attribute name/value
+std::cout << attr.set_name("key") << ", " << attr.set_value("345");
 std::cout << ", new attribute: " << attr.name() << "=" << attr.value() << std::endl;
 
-// we can use numbers or booleans
-attr.set_value(1.234);
+// we can use numbers or booleans
+attr.set_value(1.234);
 std::cout << "new attribute value: " << attr.value() << std::endl;
 
-// we can also use assignment operators for more concise code
-attr = true;
+// we can also use assignment operators for more concise code
+attr = true;
 std::cout << "final attribute value: " << attr.value() << std::endl;
 

@@ -649,19 +663,20 @@ This is an example of adding new attributes/nodes to the document (samples/modify_add.cpp):

+

-
// add node with some name
-pugi::xml_node node = doc.append_child("node");
+
// add node with some name
+pugi::xml_node node = doc.append_child("node");
 
-// add description node with text child
-pugi::xml_node descr = node.append_child("description");
+// add description node with text child
+pugi::xml_node descr = node.append_child("description");
 descr.append_child(pugi::node_pcdata).set_value("Simple node");
 
-// add param node before the description
-pugi::xml_node param = node.insert_child_before("param", descr);
+// add param node before the description
+pugi::xml_node param = node.insert_child_before("param", descr);
 
-// add attributes to param node
-param.append_attribute("name") = "version";
+// add attributes to param node
+param.append_attribute("name") = "version";
 param.append_attribute("value") = 1.1;
 param.insert_attribute_after("type", param.attribute("name")) = "float";
 
@@ -681,17 +696,18 @@ This is an example of removing attributes/nodes from the document (samples/modify_remove.cpp):

+

-
// remove description node with the whole subtree
-pugi::xml_node node = doc.child("node");
+
// remove description node with the whole subtree
+pugi::xml_node node = doc.child("node");
 node.remove_child("description");
 
-// remove id attribute
-pugi::xml_node param = node.child("param");
+// remove id attribute
+pugi::xml_node param = node.child("param");
 param.remove_attribute("value");
 
-// we can also remove nodes/attributes by handles
-pugi::xml_attribute id = param.attribute("name");
+// we can also remove nodes/attributes by handles
+pugi::xml_attribute id = param.attribute("name");
 param.remove_attribute(id);
 

@@ -699,7 +715,7 @@

Often after creating a new document or loading the existing one and processing @@ -724,9 +740,10 @@ of saving XML document to file (samples/save_file.cpp):

+

-
// save document to file
-std::cout << "Saving result: " << doc.save_file("save_file_output.xml") << std::endl;
+
// save document to file
+std::cout << "Saving result: " << doc.save_file("save_file_output.xml") << std::endl;
 

@@ -743,9 +760,10 @@ This is a simple example of saving XML document to standard output (samples/save_stream.cpp):

+

-
// save document to standard output
-std::cout << "Document:\n";
+
// save document to standard output
+std::cout << "Document:\n";
 doc.save(std::cout);
 

@@ -765,6 +783,7 @@ read the sample code for more complex examples:

+

struct xml_string_writer: pugi::xml_writer
 {
@@ -789,7 +808,7 @@
 

If you believe you've found a bug in pugixml, please file an issue via issue submission form. @@ -798,14 +817,14 @@ that uses pugixml and exhibits the bug, etc. Feature requests and contributions can be filed as issues, too.

-

- If filing an issue is not possible due to privacy or - other concerns, you can contact pugixml author by e-mail directly: arseny.kapoulkine@gmail.com. +

+ If filing an issue is not possible due to privacy or other concerns, you + can contact pugixml author by e-mail directly: arseny.kapoulkine@gmail.com.

The pugixml library is distributed under the MIT license: @@ -854,7 +873,7 @@ pugixml

- +

Last revised: February 28, 2014 at 03:52:54 GMT

Last revised: November 18, 2014 at 17:25:31 GMT

-- cgit v1.2.3