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


C++ VerseKey::getBook方法代码示例

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


在下文中一共展示了VerseKey::getBook方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char **argv)
{
	long pos, offset;
	int num1, num2, rangemax;
	char startflag = 0;
	short size;

	checkparams(argc, argv);

	openfiles(argv[1]);

	testmnt = key1.getTestament();
	num1 = key1.getChapter();
	num2 = key1.getVerse();
	pos  = 0;
	write(bfp, &pos, 4);  /* Book    offset for testament intros */
	pos = 4;
	write(cfp, &pos, 4);  /* Chapter offset for testament intro */


/*	Right now just zero out intros until parsing correctly */
	pos = 0;
	size = 0;
	write(vfp, &pos, 4);  /* Module intro */
	write(vfp, &size, 2);
	write(vfp, &pos, 4);  /* Testament intro */
	write(vfp, &size, 2);

	while(!findbreak(fp, &offset, &num1, &num2, &rangemax, &size)) {
		if (!startflag) {
			startflag = 1;
		}
		else {
			if (num2 < key2.getVerse()) {            // new chapter
				if (num1 <= key2.getChapter()) { // new book
					key2.setVerse(1);
					key2.setChapter(1);
					key2.setBook(key2.getBook()+1);
				}
				printf("Found Chapter Break: %d ('%s')\n", num1, (const char *)key2);
				chapoffset = offset;
				chapsize = size;
//				continue;
			}
		}
		key2.setVerse(1);
		key2.setChapter(num1);
		key2.setVerse(num2);

		key3 = key2;
//		key3 += (rangemax - key3.getVerse());

		writeidx(key1, key2, key3, offset, size);
	}
	close(vfp);
	close(cfp);
	close(bfp);
	close(fp);
	return 0;
}
开发者ID:bluehavana,项目名称:sword,代码行数:60,代码来源:gbfidx.cpp

示例2: main

int main(int argc, char **argv) {

	SWMgr library;
	SWModule *kjv = library.getModule((argc > 1)?argv[1]:"KJV");

	kjv->setKey(argc > 2 ? argv[2] : "Jn.3.16");

	VerseKey *key = (VerseKey *)kjv->getKey();

	int curVerse = key->getVerse();
	int curChapter = key->getChapter();
	int curBook = key->getBook();

	for (key->setVerse(1);
				(key->getBook()    == curBook)    &&
				(key->getChapter() == curChapter) &&
				!kjv->popError();
				(*kjv)++) {
		if (key->getVerse() == curVerse) cout << "* ";
		cout << key->getVerse() << " " << kjv->stripText() << "\n";
	}

	return 0;
}
开发者ID:bluehavana,项目名称:sword,代码行数:24,代码来源:simplechapter.cpp

示例3: main


//.........这里部分代码省略.........
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "-----------------\n";

    if (argc < 2)
        bla = "Malachi  4:2";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla++) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "-----------------\n";

    if (argc < 2)
        bla = "Revelation of John  22:17";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla++) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }


    std::cout << "-----------------\n";
    std::cout << "-------- Headings ---------\n";

    bla.setIntros(true);

    if (argc < 2)
        bla = "Matthew  1:5";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla--) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "-----------------\n";

    if (argc < 2)
        bla = "Genesis  1:5";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla--) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "-----------------\n";

    if (argc < 2)
        bla = "Malachi  4:2";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla++) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "-----------------\n";

    if (argc < 2)
        bla = "Revelation of John  22:17";
    else	bla = argv[2];

    for (loop = max; loop; loop--, bla++) {
        index = bla.getIndex();
        std::cout << (const char *)bla << "(" << index << ")\n";
    }

    std::cout << "\n\n";

    std::cout << "-------- Error Check ------------\n\n";
    bla = "Revelation of John 23:19";
    std::cout << "bla = \"Revelation of John 23:19\"\n";
    std::cout << "(const char *)bla = " << (const char *)bla << "\n";
    std::cout << "bla.popError() = " << (int)bla.popError() << " \n";
    std::cout << "bla++ \n";
    bla++;
    std::cout << "bla.popError() = " << (int)bla.popError() << " \n";

    bla.setIntros(false);
    for (bla = BOTTOM; !bla.popError(); bla.setBook(bla.getBook()-1))
        std::cout << (const char *)bla << "\n";
    bla.setTestament(1);
    bla = BOTTOM;
    std::cout << bla.getTestamentIndex() << "\n";
    std::cout << bla.getIndex() << "\n";
    std::cout << bla << "\n";
    bla.setTestament(2);
    bla = BOTTOM;
    std::cout << bla.getTestamentIndex() << "\n";
    std::cout << bla.getIndex() << "\n";
    std::cout << bla << "\n";
    return 0;
}
开发者ID:raphink,项目名称:sword,代码行数:101,代码来源:keytest.cpp


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