From 2094a4fd3da85c1972f215cb5977f6157590ff79 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 28 Feb 2014 06:01:16 +0000 Subject: docs: Regenerate HTML documentation git-svn-id: https://pugixml.googlecode.com/svn/trunk@993 99668b35-9821-0410-8761-19e4c4f06640 --- docs/quickstart.html | 180 +++++++++++++++++++++++---------------------------- 1 file changed, 81 insertions(+), 99 deletions(-) (limited to 'docs/quickstart.html') diff --git a/docs/quickstart.html b/docs/quickstart.html index 6afd25d..8f8fa4e 100644 --- a/docs/quickstart.html +++ b/docs/quickstart.html @@ -1,31 +1,31 @@ -pugixml 1.2 +pugixml 1.4 - - + +
-
-
Introduction
-
Installation
-
Document object model
-
Loading document
-
Accessing document data
-
Modifying document data
-
Saving document
-
Feedback
-
License
+

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:

-
http://pugixml.googlecode.com/files/pugixml-1.2.zip
-http://pugixml.googlecode.com/files/pugixml-1.2.tar.gz
+
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
 

The distribution contains library source, documentation (the guide you're @@ -100,7 +100,7 @@ The easiest way to build pugixml is to compile the source file, pugixml.cpp, along with the existing library/executable. This process depends on the method of building your application; for example, if you're using Microsoft Visual - Studio[1], + Studio[1], Apple Xcode, Code::Blocks or any other IDE, just add pugixml.cpp to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; read @@ -109,7 +109,7 @@

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

The most common node types are:

-
    +
    • Document node (node_document) - this is the root of the tree, which consists of several child nodes. @@ -226,7 +226,7 @@

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

    -

    pugi::xml_document doc;
     
    @@ -282,7 +281,6 @@
             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);
    @@ -324,7 +322,6 @@
             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);
    @@ -332,17 +329,16 @@
     

    -

    -
    // 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;
     

    @@ -352,7 +348,6 @@ 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);
    @@ -362,7 +357,7 @@
     

    pugixml features an extensive interface for getting various types of data @@ -377,7 +372,7 @@ or an empty string if name/value is absent or if the handle is null. Also there are two notable things for reading values:

    -
      +
      • It is common to store data as text contents of some node - i.e. <node><description>This is a @@ -399,7 +394,6 @@ 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"))
         {
        @@ -420,7 +414,6 @@
                 functions (samples/traverse_base.cpp):
               

        -

        std::cout << "Tool for *.dae generation: " << tools.find_child_by_attribute("Tool", "OutputFileMasks", "*.dae").attribute("Filename").value() << "\n";
         
        @@ -445,7 +438,6 @@
                 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)
         {
        @@ -474,7 +466,6 @@
                 (samples/traverse_rangefor.cpp):
               

        -

        for (pugi::xml_node tool: tools.children("Tool"))
         {
        @@ -508,24 +499,22 @@
                 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);
        @@ -539,21 +528,21 @@
                 examples:
               

        -

        pugi::xpath_node_set tools = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote='true' and @DeriveCaptionFrom='lastparam']");
         
        -std::cout << "Tools:";
        +std::cout << "Tools:\n";
         
         for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)
         {
             pugi::xpath_node node = *it;
        -    std::cout << " " << node.node().attribute("Filename").value();
        +    std::cout << node.node().attribute("Filename").value() << "\n";
         }
         
         pugi::xpath_node build_tool = doc.select_single_node("//Tool[contains(Description, 'build system')]");
         
        -std::cout << "\nBuild tool: " << build_tool.node().attribute("Filename").value() << "\n";
        +if (build_tool)
        +    std::cout << "Build tool: " << build_tool.node().attribute("Filename").value() << "\n";
         

        @@ -570,7 +559,7 @@

      The document in pugixml is fully mutable: you can completely change the document @@ -601,38 +590,36 @@ 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;
       

      @@ -662,20 +649,19 @@ 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";
       
      @@ -695,18 +681,17 @@ 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);
       

      @@ -714,7 +699,7 @@

      Often after creating a new document or loading the existing one and processing @@ -739,10 +724,9 @@ 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;
       

      @@ -759,10 +743,9 @@ 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);
       

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

      -

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

      If you believe you've found a bug in pugixml, please file an issue via issue submission form. @@ -816,21 +798,21 @@ 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:

      - Copyright (c) 2006-2012 Arseny Kapoulkine + Copyright (c) 2006-2014 Arseny Kapoulkine

      Permission is hereby granted, free of charge, to any person obtaining a @@ -862,17 +844,17 @@

      This software is based on pugixml library (http://pugixml.org).
      pugixml - is Copyright (C) 2006-2012 Arseny Kapoulkine. + is Copyright (C) 2006-2014 Arseny Kapoulkine.

      -

      -

      [1] All trademarks used are properties of their respective owners.

      +

      +

      [1] All trademarks used are properties of their respective owners.

    - +

    Last revised: April 30, 2012 at 03:25:55 GMT

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

    -- cgit v1.2.3