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


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

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


在下文中一共展示了ListKey::Count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: doquery


//.........这里部分代码省略.........
		*output << "\"-- ";

 		if (range) {
 			ListKey scope = parser->parseVerseList(range, "Gen 1:1", true);
 			listkey = target->search(ref, st, REG_ICASE, &scope);
 		}
 		else listkey = target->search(ref, st, REG_ICASE);

		if (strlen((const char*)listkey)) {
		  if (!listkey.popError()) {
		    if (outputformat == FMT_CGI) *output << "<entry>";
		    if (querytype == QT_BIBLE) {
		      *parser = listkey;
		      *output << (const char *)*parser;
		    }
		    else *output << (const char *)listkey;
		    if (outputformat == FMT_CGI) *output << "</entry>";
		  }
		  listkey++;
		  while (!listkey.popError()) {
		    *output << " ; ";
		    if (outputformat == FMT_CGI) *output << "<entry>";
		    if (querytype == QT_BIBLE) {
		      *parser = listkey;
		      *output << (const char *)*parser;
		    }
		    else *output << (const char *)listkey;
		    if (outputformat == FMT_CGI) *output << "</entry>";
		    listkey++;
		  }
		  *output << " -- ";

		  char *temp = new char[10];
		  sprintf(temp, "%u", listkey.Count());
		  *output << temp;
		  delete [] temp;

		  *output << " matches total (";
		  *output << target->getName();
		  *output << ")\n";
		}
		else {
		  *output << "none (";
		  *output << target->getName();
		  *output << ")\n";
		}
	}

	else if (querytype == QT_LD) {
		//do dictionary stuff

		target->setKey(ref);

		const char * text = (const char *) *target;

		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 << ";}}";
		}
		else if (outputformat == FMT_HTML) {
			*output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
		}
开发者ID:raphink,项目名称:sword,代码行数:67,代码来源:corediatheke.cpp


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