The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 32 of file addcomment.cpp.

33 {
34  int loop;
35  int max;
36  RawFiles personal("modules/comments/rawfiles/personal/", "MINE", "Personal Comments");
37  VerseKey mykey;
38 
39  if (argc < 3) {
40  fprintf(stderr, "usage: %s <\"comment\"> <\"verse\"> [count] [disable AutoNormalization]\n", argv[0]);
41  exit(-1);
42  }
43 
44  if (argc > 4)
45  mykey.AutoNormalize(0); // Turn off autonormalize if 3 args to allow for intros
46  // This is kludgy but at lease you can try it
47  // with something like: sword "Matthew 1:0" 1 1
48 
49  mykey = argv[2];
50  mykey.Persist(1);
51  personal.setKey(mykey);
52 
53  max = (argc < 4) ? 1 : atoi(argv[3]);
54 
55  for (loop = 0; loop < max; loop++) {
56  personal << argv[1];
57  mykey++;
58  }
59  std::cout << "Added Comment" << std::endl;
60  return 0;
61 }
SWDEPRECATED char AutoNormalize(char iautonorm)
Definition: versekey.h:375
SWDEPRECATED char Persist() const
Definition: swkey.h:148