本文整理汇总了C++中readDocument函数的典型用法代码示例。如果您正苦于以下问题:C++ readDocument函数的具体用法?C++ readDocument怎么用?C++ readDocument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readDocument函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reader
void RecordParser::parse(const unsigned char * content, int content_size, RecordParseListener &listener) {
ContentBuffer reader(content, content_size);
reader.prepare(1);
if (reader.content[reader.cursor] != 0)
throw parse_exception("unsupported version");
readDocument(reader, listener);
}
示例2: readDocument
std::string OEBSimpleIdReader::readId(const ZLFile &file) {
myPublicationId.erase();
myBuffer.erase();
myReadState = READ_NONE;
readDocument(file);
return myPublicationId;
}
示例3: readDocument
bool EncodingIntReader::fillTable(int *map) {
myMap = map;
for (int i = 0; i < 256; ++i) {
myMap[i] = i;
}
return readDocument(myFilePath);
}
示例4: fillTagTable
bool XHTMLReader::readFile(const ZLFile &file, const std::string &referenceName) {
fillTagTable();
myPathPrefix = MiscUtil::htmlDirectoryPrefix(file.path());
myReferenceAlias = fileAlias(referenceName);
myModelReader.addHyperlinkLabel(myReferenceAlias);
const int index = referenceName.rfind('/', referenceName.length() - 1);
myReferenceDirName = referenceName.substr(0, index + 1);
myPreformatted = false;
myNewParagraphInProgress = false;
myReadState = XHTML_READ_NOTHING;
myBodyCounter = 0;
myCurrentParagraphIsEmpty = true;
myStyleSheetTable.clear();
myFontMap = new FontMap();
myTagDataStack.clear();
myStyleParser = new StyleSheetSingleStyleParser(myPathPrefix);
myTableParser.reset();
return readDocument(file.inputStream(myEncryptionMap));
}
示例5: XMLObject
XMLDocument::XMLDocument(const char *path, bool validate, std::string * error, const char * encoding, const bool html): XMLObject()
{
char *expandedPath = expandPathVariable(const_cast<char *>(path));
if (expandedPath)
{
if (html)
{
document = readHTMLDocument(const_cast<const char *>(expandedPath), encoding, error);
}
else
{
document = readDocument(const_cast<const char *>(expandedPath), encoding, validate, error);
}
FREE(expandedPath);
if (document)
{
openDocs.push_back(this);
scope->registerPointers(document, this);
}
}
else
{
document = 0;
*error = std::string(gettext("Invalid file name: ")) + std::string(path);
}
id = scope->getVariableId(*this);
scilabType = XMLDOCUMENT;
}
示例6: readDocument
bool JSON::load(Variant & root, const std::string & filename)
{
// Create tokenizer for JSON
Tokenizer tokenizer;
tokenizer.setOptions(
Tokenizer::OptionParseStrings
| Tokenizer::OptionParseNumber
| Tokenizer::OptionParseBoolean
| Tokenizer::OptionParseNull
| Tokenizer::OptionCStyleComments
| Tokenizer::OptionCppStyleComments
);
tokenizer.setQuotationMarks("\"");
tokenizer.setSingleCharacters("{}[],:");
// Load file
if (!tokenizer.loadDocument(filename))
{
return false;
}
// Begin parsing
return readDocument(root, tokenizer);
}
示例7: readUids
bool OEBUidReader::readUids(const ZLFile &file) {
myReadState = READ_NONE;
if (!readDocument(file)) {
return false;
}
return true;
}
示例8: readBook
bool OEBBookReader::readBook(const std::string &fileName) {
myFilePrefix = MiscUtil::htmlDirectoryPrefix(fileName);
myIdToHref.clear();
myHtmlFileNames.clear();
myNCXTOCFileName.erase();
myTourTOC.clear();
myGuideTOC.clear();
myState = READ_NONE;
if (!readDocument(fileName)) {
return false;
}
myModelReader.setMainTextModel();
myModelReader.pushKind(REGULAR);
XHTMLReader xhtmlReader(myModelReader);
for (std::vector<std::string>::const_iterator it = myHtmlFileNames.begin(); it != myHtmlFileNames.end(); ++it) {
if (it != myHtmlFileNames.begin()) {
myModelReader.insertEndOfSectionParagraph();
}
xhtmlReader.readFile(myFilePrefix + *it, *it);
}
generateTOC();
return true;
}
示例9: fillTagTable
bool XHTMLReader::readFile(const ZLFile &file, const std::string &referenceName) {
fillTagTable();
myPathPrefix = MiscUtil::htmlDirectoryPrefix(file.path());
myReferenceAlias = fileAlias(referenceName);
myModelReader.addHyperlinkLabel(myReferenceAlias);
const int index = referenceName.rfind('/', referenceName.length() - 1);
myReferenceDirName = referenceName.substr(0, index + 1);
myPreformatted = false;
myNewParagraphInProgress = false;
myReadState = READ_NOTHING;
myCurrentParagraphIsEmpty = true;
myStyleSheetTable.clear();
myCSSStack.clear();
myStyleEntryStack.clear();
myStylesToRemove = 0;
myDoPageBreakAfterStack.clear();
myStyleParser = new StyleSheetSingleStyleParser();
myTableParser.reset();
return readDocument(file);
}
示例10: readDocument
bool FB2MetaInfoReader::readMetaInfo() {
myReadState = READ_NOTHING;
for (int i = 0; i < 3; ++i) {
myAuthorNames[i].erase();
}
return readDocument(myBook.file());
}
示例11: switch
void MetaInfoReader::elementStart(const QString &name)
{
switch (parserState()) {
case ParsingDocument:
setParserState(readDocument(name));
break;
case ParsingMetaInfo:
setParserState(readMetaInfoRootElement(name));
break;
case ParsingType:
setParserState(readTypeElement(name));
break;
case ParsingItemLibrary:
setParserState(readItemLibraryEntryElement(name));
break;
case ParsingProperty:
setParserState(readPropertyElement(name));
break;
case ParsingQmlSource:
setParserState(readQmlSourceElement(name));
break;
case Finished:
case Undefined:
setParserState(Error);
addError(tr("Illegal state while parsing"), currentSourceLocation());
case Error:
default:
return;
}
}
示例12: readDocument
bool DocBookReader::readBook() {
const ZLFile &file = myModelReader.model().book()->file();
shared_ptr<ZLInputStream> stream = file.inputStream();
if (stream.isNull()) {
return false;
}
return readDocument(stream, file.size());
}
示例13: main
int main(void)
{
element* html = readDocument();
printDocument(html);
deleteElement(html);
return 0;
}
示例14: readStyles
void DocxReader::readContent()
{
m_xml.readNextStartElement();
if (m_xml.qualifiedName() == "w:styles") {
readStyles();
} else if (m_xml.qualifiedName() == "w:document") {
readDocument();
}
}
示例15: readBook
bool ORBookReader::readBook() {
const ZLFile &file = myModelReader.model().book()->file();
myFilePrefix = MiscUtil::htmlDirectoryPrefix(file.path());
myResources.clear();
myCoverReference.erase();
myHtmlFileIDs.clear();
myImageIDs.clear();
myHtmlFilesOrder.clear();
myTOC.clear();
myState = READ_NONE;
if (!readDocument(file)) {
return false;
}
myModelReader.setMainTextModel();
myModelReader.pushKind(REGULAR);
if (!myCoverReference.empty()) {
myModelReader.addImageReference(myCoverReference);
}
for (std::vector<std::string>::const_iterator it = myHtmlFilesOrder.begin(); it != myHtmlFilesOrder.end(); ++it) {
myHtmlFileIDs.erase(*it);
XHTMLReader(myModelReader).readFile(ZLFile(myFilePrefix + myResources[*it]), *it);
}
int level = 1;
for (std::vector<TOCItem>::const_iterator it = myTOC.begin(); it != myTOC.end(); ++it) {
int index = myModelReader.model().label(it->Reference).ParagraphNumber;
if (index != -1) {
for (; level > it->Level; --level) {
myModelReader.endContentsParagraph();
}
++level;
myModelReader.beginContentsParagraph(index);
myModelReader.addContentsData(it->Text);
}
}
for (; level > 1; --level) {
myModelReader.endContentsParagraph();
}
for (std::set<std::string>::const_iterator it = myHtmlFileIDs.begin(); it != myHtmlFileIDs.end(); ++it) {
myModelReader.setFootnoteTextModel(*it);
myModelReader.pushKind(REGULAR);
XHTMLReader(myModelReader).readFile(ZLFile(myFilePrefix + myResources[*it]), *it);
}
for (std::map<std::string,std::string>::const_iterator it = myImageIDs.begin(); it != myImageIDs.end(); ++it) {
myModelReader.addImage(it->first, new ZLFileImage(ZLFile(myFilePrefix + myResources[it->first], it->second), 0));
}
return true;
}