当前位置: 首页>>代码示例>>C++>>正文


C++ readDocument函数代码示例

本文整理汇总了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);
}
开发者ID:pkdevbox,项目名称:orientc,代码行数:7,代码来源:orientc_reader.cpp

示例2: readDocument

std::string OEBSimpleIdReader::readId(const ZLFile &file) {
	myPublicationId.erase();
	myBuffer.erase();
	myReadState = READ_NONE;
	readDocument(file);
	return myPublicationId;
}
开发者ID:04k,项目名称:FBReaderJ,代码行数:7,代码来源:OEBSimpleIdReader.cpp

示例3: readDocument

bool EncodingIntReader::fillTable(int *map) {
	myMap = map;
	for (int i = 0; i < 256; ++i) {
		myMap[i] = i;
	}
	return readDocument(myFilePath);
}
开发者ID:TodorGrin,项目名称:boox-opensource,代码行数:7,代码来源:MyEncodingConverter.cpp

示例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));
}
开发者ID:Ca5th,项目名称:FBReaderJ,代码行数:25,代码来源:XHTMLReader.cpp

示例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;
}
开发者ID:ScilabOrg,项目名称:scilab,代码行数:30,代码来源:XMLDocument.cpp

示例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);
}
开发者ID:Beta-Alf,项目名称:cppexpose,代码行数:26,代码来源:JSON.cpp

示例7: readUids

bool OEBUidReader::readUids(const ZLFile &file) {
	myReadState = READ_NONE;
	if (!readDocument(file)) {
		return false;
	}
	return true;
}
开发者ID:419131433,项目名称:FBReaderJ,代码行数:7,代码来源:OEBUidReader.cpp

示例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;
}
开发者ID:f059074251,项目名称:interested,代码行数:29,代码来源:OEBBookReader.cpp

示例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);
}
开发者ID:Alexander--,项目名称:FBReaderJ,代码行数:26,代码来源:XHTMLReader.cpp

示例10: readDocument

bool FB2MetaInfoReader::readMetaInfo() {
	myReadState = READ_NOTHING;
	for (int i = 0; i < 3; ++i) {
		myAuthorNames[i].erase();
	}
	return readDocument(myBook.file());
}
开发者ID:MattFisher,项目名称:FBReaderJ,代码行数:7,代码来源:FB2MetaInfoReader.cpp

示例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;
    }
}
开发者ID:ntrincano,项目名称:qt-creator,代码行数:30,代码来源:metainforeader.cpp

示例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());
}
开发者ID:37Jayden,项目名称:bho,代码行数:8,代码来源:DocBookReader.cpp

示例13: main

int main(void)
{
	element* html = readDocument();
	printDocument(html);
	deleteElement(html);

	return 0;
}
开发者ID:OndrejSlamecka,项目名称:hw03tester,代码行数:8,代码来源:main.c

示例14: readStyles

void DocxReader::readContent()
{
	m_xml.readNextStartElement();
	if (m_xml.qualifiedName() == "w:styles") {
		readStyles();
	} else if (m_xml.qualifiedName() == "w:document") {
		readDocument();
	}
}
开发者ID:barak,项目名称:focuswriter,代码行数:9,代码来源:docx_reader.cpp

示例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;
}
开发者ID:ALEXGUOQ,项目名称:FBReader,代码行数:56,代码来源:ORBookReader.cpp


注:本文中的readDocument函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。