[sword-svn] r2770 - trunk/examples/classes
scribe at crosswire.org
scribe at crosswire.org
Mon Jan 21 07:53:47 MST 2013
Author: scribe
Date: 2013-01-21 07:53:46 -0700 (Mon, 21 Jan 2013)
New Revision: 2770
Modified:
trunk/examples/classes/Makefile
trunk/examples/classes/ciphercng.cpp
trunk/examples/classes/lastVerseInChapter.cpp
trunk/examples/classes/swmgrex.cpp
trunk/examples/classes/verseposition.cpp
trunk/examples/classes/verseranges.cpp
Log:
updated to use new method names over the deprecated names
Modified: trunk/examples/classes/Makefile
===================================================================
--- trunk/examples/classes/Makefile 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/Makefile 2013-01-21 14:53:46 UTC (rev 2770)
@@ -5,6 +5,6 @@
rm $(TARGETS)
.cpp:
- g++ -O0 -g `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
+ g++ -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
Modified: trunk/examples/classes/ciphercng.cpp
===================================================================
--- trunk/examples/classes/ciphercng.cpp 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/ciphercng.cpp 2013-01-21 14:53:46 UTC (rev 2770)
@@ -56,7 +56,7 @@
while (true) {
cout << "\nModule text:\n";
module->setKey("1jn 1:9");
- cout << "[ " << module->KeyText() << " ]\n";
+ cout << "[ " << module->getKeyText() << " ]\n";
cout << (const char *)*module;
cout << "\n\nEnter new cipher key: ";
cin >> key;
Modified: trunk/examples/classes/lastVerseInChapter.cpp
===================================================================
--- trunk/examples/classes/lastVerseInChapter.cpp 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/lastVerseInChapter.cpp 2013-01-21 14:53:46 UTC (rev 2770)
@@ -39,7 +39,7 @@
SWModule *book = library.getModule("KJV");
VerseKey *vk = (VerseKey *) book->getKey();
- for (;!vk->Error();vk->setChapter(vk->getChapter()+1)) {
+ for (;!vk->popError();vk->setChapter(vk->getChapter()+1)) {
vk->setVerse(vk->getVerseMax());
SWBuf text = book->StripText();
text = text.trim();
Modified: trunk/examples/classes/swmgrex.cpp
===================================================================
--- trunk/examples/classes/swmgrex.cpp 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/swmgrex.cpp 2013-01-21 14:53:46 UTC (rev 2770)
@@ -34,7 +34,7 @@
using namespace sword;
using namespace std;
-main() {
+int main(int argc, char **argv) {
SWMgr manager; // create a default manager that looks in the current directory for mods.conf
cout << "\nInstalled Modules:\n\n";
@@ -47,14 +47,14 @@
SWBuf modName = (*modIterator).first; // mod.conf section name (stored in module->Name())
SWModule *module = (*modIterator).second;
- cout << modName << "(" << module->Name() << ") | " << module->Type() << "\n";
+ cout << modName << "(" << module->getName() << ") | " << module->getType() << "\n";
}
// Print out a verse from the first module:
- cout << "\n" << manager.Modules.begin()->second->KeyText() << ":\n";
+ cout << "\n" << manager.Modules.begin()->second->getKeyText() << ":\n";
cout << (const char *)(*manager.Modules.begin()->second);
- cout << " (" << manager.Modules.begin()->second->Name() << ")\n";
+ cout << " (" << manager.Modules.begin()->second->getName() << ")\n";
// Print out the same verse from the second module (less confusing):
@@ -63,9 +63,9 @@
SWModule *mod = modIterator->second;
- cout << "\n" << mod->KeyText() << ":\n";
+ cout << "\n" << mod->getKeyText() << ":\n";
// cout << (const char *)(*mod); // we could do this, the same as above
- mod->Display(); // instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout;
- cout << " (" << mod->Name() << ")\n\n";
+ mod->display(); // instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout;
+ cout << " (" << mod->getName() << ")\n\n";
}
Modified: trunk/examples/classes/verseposition.cpp
===================================================================
--- trunk/examples/classes/verseposition.cpp 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/verseposition.cpp 2013-01-21 14:53:46 UTC (rev 2770)
@@ -17,7 +17,7 @@
}
VerseKey* key = ((VerseKey *)book->getKey());
- key->Headings(true);
+ key->setIntros(true);
book->setSkipConsecutiveLinks(true);
book->setPosition(TOP);
Modified: trunk/examples/classes/verseranges.cpp
===================================================================
--- trunk/examples/classes/verseranges.cpp 2013-01-21 11:52:47 UTC (rev 2769)
+++ trunk/examples/classes/verseranges.cpp 2013-01-21 14:53:46 UTC (rev 2770)
@@ -42,52 +42,52 @@
exit(-1);
}
- VerseKey *vk = (VerseKey *)bible->CreateKey();
+ VerseKey *vk = (VerseKey *)bible->createKey();
// let's set verse ranges for a variety of different contiguous regions
// set a verse range for the whole Bible
- vk->LowerBound(*vk); // vk initially points to TOP, so we don't need to set position first
+ vk->setLowerBound(*vk); // vk initially points to TOP, so we don't need to set position first
vk->setPosition(BOTTOM);
- vk->UpperBound(*vk);
+ vk->setUpperBound(*vk);
cout << vk->getRangeText() << "\n";
- vk->ClearBounds();
+ vk->clearBounds();
// Old Testament
vk->setPosition(TOP);
- vk->LowerBound(*vk);
+ vk->setLowerBound(*vk);
vk->setTestament(2);
(*vk)--;
- vk->UpperBound(*vk);
+ vk->setUpperBound(*vk);
cout << vk->getRangeText() << "\n";
- vk->ClearBounds();
+ vk->clearBounds();
// New Testament
vk->setPosition(TOP);
vk->setTestament(2);
- vk->LowerBound(*vk);
+ vk->setLowerBound(*vk);
vk->setPosition(BOTTOM);
- vk->UpperBound(*vk);
+ vk->setUpperBound(*vk);
cout << vk->getRangeText() << "\n";
- vk->ClearBounds();
+ vk->clearBounds();
// Current Book
vk->setText("John 3:16");
vk->setChapter(1); vk->setVerse(1);
- vk->LowerBound(*vk);
+ vk->setLowerBound(*vk);
vk->setChapter(vk->getChapterMax()); vk->setVerse(vk->getVerseMax());
- vk->UpperBound(*vk);
+ vk->setUpperBound(*vk);
cout << vk->getRangeText() << "\n";
More information about the sword-cvs
mailing list