utilities/addcomment.cpp File Reference

#include <stdio.h>
#include <iostream>
#include <versekey.h>
#include <rawtext.h>
#include <zcom.h>
#include <rawcom.h>
#include <rawfiles.h>
#include <stdlib.h>
Include dependency graph for addcomment.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 27 of file addcomment.cpp.

00028 {
00029     int loop;
00030     int max;
00031     RawFiles  personal("modules/comments/rawfiles/personal/", "MINE", "Personal Comments");
00032     VerseKey mykey;
00033 
00034     if (argc < 3) {
00035         fprintf(stderr, "usage: %s <\"comment\"> <\"verse\"> [count] [disable AutoNormalization]\n", argv[0]);
00036         exit(-1);
00037     }
00038 
00039     if (argc > 4)
00040         mykey.AutoNormalize(0);  // Turn off autonormalize if 3 args to allow for intros
00041                 // This is kludgy but at lease you can try it
00042                 // with something like: sword "Matthew 1:0" 1 1
00043 
00044     mykey = argv[2];
00045     mykey.Persist(1);
00046     personal.setKey(mykey);
00047 
00048     max = (argc < 4) ? 1 : atoi(argv[3]);
00049 
00050     for (loop = 0; loop < max; loop++) {
00051         personal << argv[1];
00052         mykey++;
00053     }
00054     std::cout << "Added Comment" << std::endl;
00055     return 0;
00056 }


Generated on 18 Mar 2013 for The SWORD Project by  doxygen 1.6.1