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 /utilities/addcomment.cpp | |
parent | 6d6973e035aac5ec1676efccd5b8ada70c40b639 (diff) | |
download | sword-sf-cvs-import-1.1.1.tar.gz |
Initial import from crosswire CVS for syncingimport-1.1.1
Diffstat (limited to 'utilities/addcomment.cpp')
-rw-r--r-- | utilities/addcomment.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/utilities/addcomment.cpp b/utilities/addcomment.cpp new file mode 100644 index 0000000..e52b87a --- /dev/null +++ b/utilities/addcomment.cpp @@ -0,0 +1,40 @@ +#include <stdio.h> +#include <iostream> +#include <versekey.h> +#include <rawtext.h> +#include <zcom.h> +#include <rawcom.h> +#include <rawgbf.h> +#include <rawfiles.h> +#include <stdlib.h> + +int main(int argc, char **argv) +{ + int loop; + int max; + RawFiles personal("modules/comments/rawfiles/personal/", "MINE", "Personal Comments"); + VerseKey mykey; + + if (argc < 3) { + fprintf(stderr, "usage: %s <\"comment\"> <\"verse\"> [count] [disable AutoNormalization]\n", argv[0]); + exit(-1); + } + + if (argc > 4) + mykey.AutoNormalize(0); // Turn off autonormalize if 3 args to allow for intros + // This is kludgy but at lease you can try it + // with something like: sword "Matthew 1:0" 1 1 + + mykey = argv[2]; + mykey.Persist(1); + personal.SetKey(mykey); + + max = (argc < 4) ? 1 : atoi(argv[3]); + + for (loop = 0; loop < max; loop++) { + personal << argv[1]; + mykey++; + } + std::cout << "Added Comment" << std::endl; + return 0; +} |