diff options
author | danglassey <danglassey> | 2002-08-14 09:57:17 +0000 |
---|---|---|
committer | danglassey <danglassey> | 2002-08-14 09:57:17 +0000 |
commit | daa67ff1f728c07f2a116ee9a9f4505479ca6808 (patch) | |
tree | c224a537d30480002ae0560cc9104b543b4d1b5e /tests/parsekey.cpp | |
parent | 6d6973e035aac5ec1676efccd5b8ada70c40b639 (diff) | |
download | sword-sf-cvs-daa67ff1f728c07f2a116ee9a9f4505479ca6808.tar.gz |
Initial import from crosswire CVS for syncingimport-1.1.1
Diffstat (limited to 'tests/parsekey.cpp')
-rw-r--r-- | tests/parsekey.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/parsekey.cpp b/tests/parsekey.cpp new file mode 100644 index 0000000..277abb5 --- /dev/null +++ b/tests/parsekey.cpp @@ -0,0 +1,34 @@ +#include <iostream> +#include <stdio.h> +#include <stdlib.h> + +#include <versekey.h> +#include <localemgr.h> + +int main(int argc, char **argv) { + if ((argc != 2) && (argc != 3)) { + fprintf(stderr, "usage: %s <\"string to parse\"> [locale name]\n", *argv); + exit(-1); + } + + if (argc == 3) + LocaleMgr::systemLocaleMgr.setDefaultLocaleName(argv[2]); + + VerseKey DefaultVSKey; + + DefaultVSKey = "jas3:1"; + + ListKey verses = DefaultVSKey.ParseVerseList(argv[1], DefaultVSKey, true); + + for (int i = 0; i < verses.Count(); i++) { + VerseKey *element = dynamic_cast<VerseKey *>(verses.GetElement(i)); + if (element) { + std::cout << (string(element->LowerBound()) + " - " + string(element->UpperBound())).c_str() << "\n"; + } + else std::cout << (const char *)*verses.GetElement(i) << "\n"; +// else { +// std::cout << VerseKey(verses.GetElement(i)).getOSISRef() << "\n"; +// } + } + return 0; +} |