File: introtest.cpp

package info (click to toggle)
sword 1.6.2%2Bdfsg-5
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 12,512 kB
  • sloc: cpp: 39,310; sh: 10,791; ansic: 5,043; makefile: 1,258; objc: 1,209; java: 818; perl: 784; pascal: 681; tcl: 350
file content (127 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society
 *	P. O. Box 2528
 *	Tempe, AZ  85280-2528
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation version 2.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 */

#include <swmgr.h>
#include <iostream>
#include <versekey.h>
#include <rawtext.h>
#ifndef NO_SWORD_NAMESPACE
using namespace sword;
#endif

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

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

	VerseKey vk;
	vk.Headings(1);
	vk.AutoNormalize(0);
	vk.Persist(1);
	mod.setKey(vk);

	vk.Verse(0);
	vk.Chapter(0);
	vk.Book(0);
	vk.Testament(0);

	mod << "Module heading text";

	vk.Verse(0);
	vk.Chapter(0);
	vk.Book(0);
	vk.Testament(1);

	mod << "OT heading text";

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(0);
	vk.Verse(0);

	mod << "Gen heading text";

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(1);
	vk.Verse(0);

	mod << "Gen 1 heading text";

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(1);
	vk.Verse(1);

	mod << "Gen 1:1 text";

	
	vk.Testament(0);
	vk.Book(0);
	vk.Chapter(0);
	vk.Verse(0);

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

	vk.Testament(1);
	vk.Book(0);
	vk.Chapter(0);
	vk.Verse(0);

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

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(0);
	vk.Verse(0);

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

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(1);
	vk.Verse(0);

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

	vk.Testament(1);
	vk.Book(1);
	vk.Chapter(1);
	vk.Verse(1);

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

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

	if (mhc) {
		VerseKey vk;
		vk.Headings(1);
		vk.AutoNormalize(0);
		vk.Persist(1);
		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;
}