CMarkup Load Method
Load to read the document from a file. For example:
CMarkup xml; bool bSuccess = xml.Load( "C:\\Temp\\hello.xml" );
true if the file is successfully loaded and determined to be well-formed as explained in the SetDoc method. If the file is not accessible or empty then the CMarkup object is empty. If the read is successful, the CMarkup object contains the content of the file whether or not it is well-formed, and you can navigate and modify it using the CMarkup methods.
false, the information about what went wrong can be retrieved with GetResult. See also When CMarkup Load Returns false. But note that even when
GetResult returns useful information about the load process like charset conversion.
Load, you can call GetDoc to get the loaded document content as a string, and use any other methods to navigate, modify, save the document, etc.
Load reads the entire document at once which for a 50MB file can take over a second and use up 70MB-150MB of memory. Look at the Open method if you want to parse the file without loading it all into memory.
Load method calls the ReadTextFile function and retrieves any resulting flags to the CMarkup document's flags. So, after calling
Load you can check if it was a UTF-16 file or there was a UTF-8 BOM (see GetDocFlags). These flags are maintained in the CMarkup object so that if the file is saved later, it will be written the same way.
Update December 17, 2008: With CMarkup release 10.1, the
Save methods, and the underlying
ReadTextFile and WriteTextFile functions have greatly expanded character conversion capabilities.
Load will now decode the file according to the ANSI or double-byte encoding specified in the XML declaration or HTML Content-Type meta tag (see GetDeclaredEncoding).