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


C++ ListKey::GetElement方法代码示例

本文整理汇总了C++中ListKey::GetElement方法的典型用法代码示例。如果您正苦于以下问题:C++ ListKey::GetElement方法的具体用法?C++ ListKey::GetElement怎么用?C++ ListKey::GetElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ListKey的用法示例。


在下文中一共展示了ListKey::GetElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parseRangeKey

    std::string parseRangeKey(const char* keyValue, const char* locale) {
        const char* oldLocale = LocaleMgr::getSystemLocaleMgr()->getDefaultLocaleName();
        LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale);

        std::string ret;

        VerseKey DefaultVSKey;
            DefaultVSKey = "jas3:1";

            ListKey verses = DefaultVSKey.ParseVerseList(keyValue, DefaultVSKey, true);

        for (int i = 0; i < verses.Count(); i++) {
            VerseKey *element = dynamic_cast<VerseKey *>(verses.GetElement(i));
            if (element) {
                if (ret.length()) {
                    ret.append(" ");
                }

                ret.appendFormatted( "%s - %s;", (const char*)element->LowerBound(), (const char*)element->UpperBound() );
            }
            else {
                if (ret.length()) {
                    ret.append(" ");
                }

                ret.appendFormatted("%s;", (const char *)*verses.GetElement(i));
            }
        }

//         cout << ret.c_str() << endl;
        LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(oldLocale);
        return ret;
    };
开发者ID:kalemas,项目名称:swordxx,代码行数:33,代码来源:versekey_test.cpp

示例2: search

void SearchThread::search()  {
	
	if (!module) {
		std::cout << "Return." << std::endl;
		return;
	}

	ListKey scopeList = VerseKey().ParseVerseList("Luke;John;Revelation","", true);
	for (int i=0; i < scopeList.Count(); ++i) {
		std::cout << (const char*)*scopeList.GetElement(i) << std::endl;
	}
	SWKey* scope = &scopeList;

	searchResult = module->Search(searchedText, -2, REG_ICASE, scope, 0, &percentUpdate);

	if (!scope)
		std::cout << "bad scope!" << std::endl;
	isSearching = false;
}
开发者ID:Jaden-J,项目名称:osstudybible,代码行数:19,代码来源:threaded_search.cpp

示例3:

VerseKey &SWText::getVerseKey(const SWKey *keyToConvert) const {
	const SWKey *thisKey = keyToConvert ? keyToConvert : this->key;

	VerseKey *key = 0;
	// see if we have a VerseKey * or decendant
	SWTRY {
		key = SWDYNAMIC_CAST(VerseKey, thisKey);
	}
	SWCATCH ( ... ) {	}
	if (!key) {
		ListKey *lkTest = 0;
		SWTRY {
			lkTest = SWDYNAMIC_CAST(ListKey, thisKey);
		}
		SWCATCH ( ... ) {	}
		if (lkTest) {
			SWTRY {
				key = SWDYNAMIC_CAST(VerseKey, lkTest->GetElement());
			}
			SWCATCH ( ... ) {	}
		}
	}
开发者ID:raphink,项目名称:sword,代码行数:22,代码来源:swtext.cpp

示例4: doquery


//.........这里部分代码省略.........

		if (outputformat == FMT_RTF) {
			*output << "}";
		}

	}

	else if (querytype == QT_BIBLE || querytype == QT_COMM) {
		//do commentary/Bible stuff

		if ((sit = manager.config->Sections.find((*it).second->getName())) != manager.config->Sections.end()) {
			if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) {
				font = (char *)(*eit).second.c_str();
				if (strlen(font) == 0) font = 0;
			}
		}

 		listkey = parser->parseVerseList(ref, "Gen1:1", true);
		int i;

		if (outputformat == FMT_RTF) {
			*output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 ";
			if (font)
				*output << font;
			else
				*output << "Times New Roman";
			*output << ";}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}}";
		}
		else if (outputformat == FMT_HTML) {
			*output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
		}

		for (i = 0; i < listkey.Count() && maxverses; i++) {
			VerseKey *element = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(i));
			if (element && element->isBoundSet()) {
			  target->setKey(element->getLowerBound());
				*parser = element->getUpperBound();
				while (maxverses && *target->getKey() <= *parser) {
					*output << (char*)target->getKeyText();
					if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
						*output << ": <font face=\"";
						*output << font;
						*output << "\">";
					}
					else if (outputformat == FMT_RTF) {
						*output << ": {\\f1 ";
					}
					else {
						*output << ": ";
					}
					*output << (const char*)*target;
					if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
						*output << "</font>";
					}
					else if (outputformat == FMT_RTF) {
						*output << "}";
					}

					if (inputformat != FMT_THML && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI))
						*output << "<br />";
					else if (outputformat == FMT_OSIS)
						*output << "<milestone type=\"line\"/>";
					else if (outputformat == FMT_RTF)
						*output << "\\par ";
					else if (outputformat == FMT_GBF)
						*output << "<CM>";
开发者ID:raphink,项目名称:sword,代码行数:67,代码来源:corediatheke.cpp


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