From ca3f051fbf42b9abf7c22e3f58215cf5010f9727 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Fri, 24 Sep 2010 05:37:50 +0000 Subject: docs: Removed pugixpath.cpp mentions, updated evaluate_* arguments and added xpath_node ctor clarification, updated custom memory management description, updated CDATA printing information, added wide load_file/save_file documentation, added as_utf8/as_wide string overloads, fixed xml_node::root() complexity git-svn-id: http://pugixml.googlecode.com/svn/trunk@752 99668b35-9821-0410-8761-19e4c4f06640 --- docs/manual/loading.html | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'docs/manual/loading.html') diff --git a/docs/manual/loading.html b/docs/manual/loading.html index a3c1515..547b355 100644 --- a/docs/manual/loading.html +++ b/docs/manual/loading.html @@ -65,20 +65,27 @@

Loading document from file

-

- The most common source of XML data is files; pugixml provides a separate - function for loading XML document from file: +

+ The most common source of XML data is files; pugixml provides dedicated functions + for loading XML document from file:

xml_parse_result xml_document::load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
+xml_parse_result xml_document::load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
 

- This function accepts file path as its first argument, and also two optional + These functions accept file path as its first argument, and also two optional arguments, which specify parsing options (see Parsing options) and input data encoding (see Encodings). The path has the target operating system format, so it can be a relative or absolute one, it should have the delimiters of target system, it should have the exact case if target - file system is case-sensitive, etc. File path is passed to system file opening - function as is. + file system is case-sensitive, etc. +

+

+ File path is passed to system file opening function as is in case of the + first function (which accepts const + char* path); the second function either uses + a special file opening function if it is provided by the runtime library + or converts the path to UTF-8 and uses the system file opening function.

load_file destroys the existing @@ -88,20 +95,6 @@ (i.e. last successfully parsed position in the input file, if parsing fails). See Handling parsing errors for error handling details.

-
- - - - - -
[Note]Note

- As of version 0.9, there is no function for loading XML document from wide - character path. Unfortunately, there is no portable way to do this; the - version 1.0 will provide such function only for platforms with the corresponding - functionality. You can use stream-loading functions as a workaround if - your STL implementation can open file streams via wchar_t - paths. -

This is an example of loading XML document from file (samples/load_file.cpp):

@@ -297,7 +290,7 @@

Handling parsing errors

-

+

All document loading functions return the parsing result via xml_parse_result object. It contains parsing status, the offset of last successfully parsed character from the beginning of the source stream, and the encoding of the source stream: @@ -308,6 +301,7 @@ ptrdiff_t offset; xml_encoding encoding; + xml_parse_result(); operator bool() const; const char* description() const; }; -- cgit v1.2.3