本文整理汇总了C++中VerseKey::isBoundSet方法的典型用法代码示例。如果您正苦于以下问题:C++ VerseKey::isBoundSet方法的具体用法?C++ VerseKey::isBoundSet怎么用?C++ VerseKey::isBoundSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VerseKey
的用法示例。
在下文中一共展示了VerseKey::isBoundSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decodeCrossReference
const QString CInfoDisplay::decodeCrossReference( const QString& data ) {
Q_ASSERT(!data.isEmpty());
if (data.isEmpty()) {
return QString("<div class=\"crossrefinfo\"><h3>%1</h3></div>")
.arg(tr("Cross references"));
}
// qWarning("setting crossref %s", data.latin1());
CSwordBackend::DisplayOptions dispOpts;
dispOpts.lineBreaks = false;
dispOpts.verseNumbers = true;
CSwordBackend::FilterOptions filterOpts;
filterOpts.headings = false;
filterOpts.strongNumbers = false;
filterOpts.morphTags = false;
filterOpts.lemmas = false;
filterOpts.footnotes = false;
filterOpts.scriptureReferences = false;
CrossRefRendering renderer(dispOpts, filterOpts);
CTextRendering::KeyTree tree;
// const bool isBible = true;
CSwordModuleInfo* module = CBTConfig::get
(CBTConfig::standardBible);
//a prefixed module gives the module to look into
QRegExp re("^[^ ]+:");
// re.setMinimal(true);
int pos = re.indexIn(data);
if (pos != -1) {
pos += re.matchedLength()-1;
}
if (pos > 0) {
const QString moduleName = data.left(pos);
// qWarning("found module %s", moduleName.latin1());
module = CPointers::backend()->findModuleByName(moduleName);
if (!module) {
module = CBTConfig::get
(CBTConfig::standardBible);
}
// Q_ASSERT(module);
}
//Q_ASSERT(module); //why? the existense of the module is tested later
CTextRendering::KeyTreeItem::Settings settings (
false,
CTextRendering::KeyTreeItem::Settings::CompleteShort
);
if (module && (module->type() == CSwordModuleInfo::Bible)) {
VerseKey vk;
sword::ListKey refs = vk.ParseVerseList((const char*)data.mid((pos == -1) ? 0 : pos+1).toUtf8(), "Gen 1:1", true);
for (int i = 0; i < refs.Count(); ++i) {
SWKey* key = refs.getElement(i);
Q_ASSERT(key);
VerseKey* vk = dynamic_cast<VerseKey*>(key);
CTextRendering::KeyTreeItem* itm = (CTextRendering::KeyTreeItem*)0; //explicit conversion for MS VS
if (vk && vk->isBoundSet()) { //render a range of keys
itm = new CTextRendering::KeyTreeItem(
QString::fromUtf8(vk->LowerBound().getText()),
QString::fromUtf8(vk->UpperBound().getText()),
module,
settings
);
}
else {
itm = new CTextRendering::KeyTreeItem(
QString::fromUtf8(key->getText()),
QString::fromUtf8(key->getText()),
module,
settings
);
}
Q_ASSERT(itm);
tree.append( itm );
}
}
else if (module) {
CTextRendering::KeyTreeItem* itm = new CTextRendering::KeyTreeItem(
data.mid((pos == -1) ? 0 : pos+1),
module,
settings
);
tree.append( itm );
}
// qWarning("rendered the tree: %s", renderer.renderKeyTree(tree).latin1());
//spanns containing rtl text need dir=rtl on their parent tag to be aligned properly
QString lang = "en"; // default english
if (module)
lang = module->language()->abbrev();
return QString("<div class=\"crossrefinfo\" lang=\"%1\"><h3>%2</h3><div class=\"para\" dir=\"%3\">%4</div></div>")
//.........这里部分代码省略.........
示例2: 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>";