本文整理汇总了C++中SWModule::getRawEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ SWModule::getRawEntry方法的具体用法?C++ SWModule::getRawEntry怎么用?C++ SWModule::getRawEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SWModule
的用法示例。
在下文中一共展示了SWModule::getRawEntry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeEntry
void writeEntry(SWModule & module,
std::string const & key,
std::string const & entry,
bool const replace)
{
if (key.size() && entry.size()) {
std::cout << "from file: " << key << std::endl;
VerseKey *vkey = (VerseKey *)module.getKey();
std::unique_ptr<VerseKey> linkMaster(
static_cast<VerseKey *>(module.createKey().release()));
ListKey listKey = vkey->parseVerseList(key.c_str(), "Gen1:1", true);
bool first = true;
for (listKey.positionToTop(); !listKey.popError(); listKey.increment()) {
vkey->positionFrom(listKey);
if (first) {
*linkMaster = *vkey;
std::string text;
if (!replace)
text = module.getRawEntry();
text += entry;
std::cout << "adding entry: " << vkey->getText() << " length " << entry.size() << "/" << (unsigned short)text.size() << std::endl;
module.setEntry(text.c_str());
first = false;
}
else {
std::cout << "linking entry: " << vkey->getText() << " to " << linkMaster->getText() << std::endl;
module.linkEntry(*linkMaster);
}
}
}
}
示例2: sword__Quick_getModuleRawEntry
int sword__Quick_getModuleRawEntry(xsd__string modName, xsd__string modKey, xsd__string &modText) {
SWModule *mod = mgr->Modules[modName];
if (mod) {
mod->setKey(modKey);
modText = mod->getRawEntry();
}
return SOAP_OK;
}
示例3: main
int main(int argc, char **argv) {
SWMgr mgr;
SWModule *mod = mgr.getModule("KJVgb");
VerseKey *key1 = (VerseKey *)mod->createKey();
key1->setTestament(2);
key1->setBook(4);
key1->setChapter(2);
key1->setVerse(3);
cout << "\n" << key1->getText() << ":\n\n";
ListKey keys;
keys << *key1;
cout << "\n" << keys.getRangeText() << ":\n\n";
ListKey keys2 = keys;
cout << "\n" << keys2.getRangeText() << ":\n\n";
keys = key1->parseVerseList("Lk.4.5");
cout << "\n" << key1->getText() << ":\n\n";
key1->setText("jn.6.7");
cout << "\n" << key1->getText() << ":\n\n";
mod->setKey("lk.2.3");
cout << "\n" << mod->getKeyText() << ":\n" << endl;
cout << mod->getRawEntry() << endl;
cout << "\nListkey persist key iteration test\n\n";
keys = key1->parseVerseList("mat1", 0, true);
for (keys = TOP; !keys.popError(); keys++) {
cout << "\n" << keys.getText() << ":\n" << endl;
}
keys.setPersist(true);
mod->setKey(keys);
for ((*mod) = TOP; !mod->popError(); (*mod)++) {
cout << "\n" << mod->getKeyText() << ":\n" << endl;
}
delete key1;
return 0;
}
示例4: getModule
/*
* Class: org_crosswire_android_sword_SWModule
* Method: getRawEntry
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_crosswire_android_sword_SWModule_getRawEntry
(JNIEnv *env, jobject me) {
init();
SWBuf retVal = "";
SWModule *module = getModule(env, me);
if (module) {
retVal = module->getRawEntry();
}
return env->NewStringUTF(assureValidUTF8(retVal));
}