本文整理汇总了C++中VerseKey::getVersificationSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ VerseKey::getVersificationSystem方法的具体用法?C++ VerseKey::getVersificationSystem怎么用?C++ VerseKey::getVersificationSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VerseKey
的用法示例。
在下文中一共展示了VerseKey::getVersificationSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
BlockType iType = BOOKBLOCKS;
int compType = 1;
string cipherKey = "";
std::unique_ptr<SWCompress> compressor;
int compLevel = 0;
if ((argc < 3) || (argc > 7)) {
errorOutHelp(argv[0]);
}
if (argc > 3) {
switch (std::atoi(argv[3])) {
case 2: iType = VERSEBLOCKS; break;
case 3: iType = CHAPTERBLOCKS; break;
case 4: iType = BOOKBLOCKS; break;
default:
std::cerr << "Argument 3 must be one of <2|3|4>\n";
errorOutHelp(*argv);
}
if (argc > 4) {
compType = std::atoi(argv[4]);
if (argc > 5) {
compLevel = std::atoi(argv[5]);
if (argc > 6) {
cipherKey = argv[6];
}
}
}
}
if ((iType < 2) || (compType < 1) || (compType > 4) || compLevel < 0 || compLevel > 9 || (!std::strcmp(argv[1], "-h")) || (!std::strcmp(argv[1], "--help")) || (!std::strcmp(argv[1], "/?")) || (!std::strcmp(argv[1], "-?")) || (!std::strcmp(argv[1], "-help"))) {
errorOutHelp(argv[0]);
}
SWMgr mgr;
auto const it = mgr.modules().find(argv[1]);
if (it == mgr.modules().end()) {
fprintf(stderr, "error: %s: couldn't find module: %s\n", argv[0], argv[1]);
std::exit(-2);
}
SWModule & inModule = *it->second;
// Try to initialize a default set of datafiles and indicies at our
// datapath location passed to us from the user.
#define BIBLE 1
#define LEX 2
#define COM 3
int modType = 0;
if (inModule.getType() == "Biblical Texts") {
modType = BIBLE;
} else if (inModule.getType() == "Lexicons / Dictionaries") {
modType = LEX;
} else if (inModule.getType() == "Commentaries") {
modType = COM;
}
switch (compType) { // these are deleted by zText
case 1: compressor = std::make_unique<LZSSCompress>(); break;
case 2: compressor = std::make_unique<ZipCompress>(); break;
case 3: compressor = std::make_unique<Bzip2Compress>(); break;
case 4: compressor = std::make_unique<XzCompress>(); break;
}
if (compressor && compLevel > 0) {
compressor->setLevel(compLevel);
}
int result = 0;
switch (modType) {
case BIBLE:
case COM: {
SWKey *k = inModule.getKey();
VerseKey *vk = dynamic_cast<VerseKey *>(k);
result = zText::createModule(argv[2], iType, vk->getVersificationSystem().c_str());
break;
}
case LEX:
result = zLD::createModule(argv[2]);
break;
}
if (result) {
fprintf(stderr, "error: %s: couldn't create module at path: %s\n", argv[0], argv[2]);
std::exit(-3);
}
std::unique_ptr<SWModule> outModule;
switch (modType) {
case BIBLE:
case COM: {
SWKey *k = inModule.getKey();
VerseKey *vk = dynamic_cast<VerseKey *>(k);
outModule = std::make_unique<zText>(argv[2], nullptr, nullptr, iType, std::move(compressor),
ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, nullptr,
//.........这里部分代码省略.........