A full file path/filename which specifies the file to parse. Caller must insure the path exists, and the user has access rights to the directory.
in
A reference to an input stream (std::istream). Can be a user instanciated stream, including a std::ofstream or std::ostringstream.
Remarks
The parser constructor creates a parser object which is used to parse (x)html content from a file or stream. A parameter must be passed
to the constructor specifying the input.
Complexity
Logarithmic
Examples
1st Variety
#include "xhtml_doc.h"
#include "xport_brochure.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
// create an xhtml strict root document
document doc(root_doc);
xport_brochure broch;
broch.create(doc);
// create a formatter object to write to a file
formatter fmtr("c:/xport_brochure.htm");
fmtr << doc;
// now create a parser object to parse input stream
parser prsr("c:/xport_brochure.htm");
// create a new document to hold the parsed output
document parsed_doc;
parsed_doc.parse(prsr);
// output the document to cout
formatter fmtr2(std::cout);
fmtr2.option(max_line_length, 70);
fmtr2 << parsed_doc;
return 0;
}
2nd Variety
#include "xhtml_doc.h"
#include "xport_brochure.h"
#include <iostream>
#include <sstream>
int main(int argc, char* argv[])
{
using namespace Xport;
// create an xhtml strict root document
document doc(root_doc);
xport_brochure broch;
broch.create(doc);
// create a std::ostream to output the document
std::ostringstream doc_container;
// create a formatter object to write to the doc container
formatter fmtr(doc_container);
fmtr << doc;
// create an istream of the doc container to parse
std::istringstream istr(doc_container.str());
// now create a parser object to parse input stream
parser prsr(istr);
// create a new document to hold the parsed output
document parsed_doc;
parsed_doc.parse(prsr);
// output the document to cout
formatter fmtr2(std::cout);
fmtr2.option(max_line_length, 70);
fmtr2 << parsed_doc;
return 0;
}
Datasoft Solutions is proud to present their landmark product, Work Time Studio. Utilizing the tree container library, Work Time Studio provides
unparalleled features in personal time, project and task management
software. If you're looking for a way to increase your productivity,
visit Work Time Studio's product website, and start being more productive
today.