Skip to content

Instantly share code, notes, and snippets.

@greg-hellings
Last active December 15, 2015 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greg-hellings/5218094 to your computer and use it in GitHub Desktop.
Save greg-hellings/5218094 to your computer and use it in GitHub Desktop.
#include <swmgr.h>
#include <swmodule.h>
#include <versekey.h>
#include <stdio.h>
void out(sword::VerseKey* key, int expected) {
printf("intro: %i\nbk (%i): %i\nch (%i): %i\nvs (%i): %i\n-----------------\n",
key->isIntros(),
expected, key->getBook(),
expected, key->getChapter(),
expected, key->getVerse());
}
int main(void) {
sword::SWMgr* mgr = new sword::SWMgr();
sword::SWModule* mod = mgr->getModule("KJV");
sword::VerseKey* key = (sword::VerseKey*) mod->getKey();
key->setText("Genesis 1:1");
key->setAutoNormalize(0);
// Original setting
out(key, 1);
// Set value directly
key->setBook(0);
key->setChapter(0);
key->setVerse(0);
out(key, 1);
key->setText("Genesis 1:1");
key->setIntros(1);
// Set value directly
key->setVerse(0);
key->setChapter(0);
key->setBook(0);
out(key, 0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment