本文整理汇总了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;
};
示例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;
}
示例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\">";
}