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


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

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


在下文中一共展示了VerseKey::setBook方法的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


//.........这里部分代码省略.........
        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

示例3: main

int main(int argc, char **argv) {
	SWMgr mymgr;

	RawText::createModule(".");
	RawText mod(".");

	VerseKey vk;
	vk.setIntros(true);
	vk.setAutoNormalize(false);
	vk.setPersist(true);
	mod.setKey(vk);

	vk.setVerse(0);
	vk.setChapter(0);
	vk.setBook(0);
	vk.setTestament(0);

	mod << "Module heading text";

	vk.setVerse(0);
	vk.setChapter(0);
	vk.setBook(0);
	vk.setTestament(1);

	mod << "OT heading text";

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(0);
	vk.setVerse(0);

	mod << "Gen heading text";

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(1);
	vk.setVerse(0);

	mod << "Gen 1 heading text";

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(1);
	vk.setVerse(1);

	mod << "Gen 1:1 text";

	
	vk.setTestament(0);
	vk.setBook(0);
	vk.setChapter(0);
	vk.setVerse(0);

	std::cout << "Module heading text ?= " << (const char*)mod << std::endl;

	vk.setTestament(1);
	vk.setBook(0);
	vk.setChapter(0);
	vk.setVerse(0);

	std::cout << "OT heading text ?= " << (const char*)mod << std::endl;

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(0);
	vk.setVerse(0);

	std::cout << "Gen heading text ?= " << (const char*)mod << std::endl;

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(1);
	vk.setVerse(0);

	std::cout << "Gen 1 heading text ?= " << (const char*)mod << std::endl;

	vk.setTestament(1);
	vk.setBook(1);
	vk.setChapter(1);
	vk.setVerse(1);

	std::cout << "Gen 1:1 text ?= " << (const char*)mod << std::endl;

	  /* old introtest
	SWModule *mhc = mymgr.Modules["MHC"];

	if (mhc) {
		VerseKey vk;
		vk.setIntros(true);
		vk.setAutoNormalize(false);
		vk.setPersist(true);
		vk = "jas 0:0";
		std::cout << vk << ":\n";
		mhc->setKey(vk);
		std::cout << (const char *) mhc->Key() << ":\n";
		std::cout << (const char *) *mhc << "\n";
	}
	  */
	return 0;
}
开发者ID:raphink,项目名称:sword,代码行数:100,代码来源:introtest.cpp


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