25 #pragma warning( disable: 4251 )
47 #ifndef NO_SWORD_NAMESPACE
48 using sword::TreeKeyIdx;
49 using sword::RawGenBook;
58 unsigned long currentOffset = target->
getOffset();
59 std::cout << ((currentOffset == treeKey.
getOffset()) ?
"==>" :
"");
60 for (
int i = 0; i < level; i++) std::cout <<
"\t";
72 int main(
int argc,
char **argv) {
74 const char * helptext =
"addgb 1.0 General Book module creation tool for the SWORD Project\nUse -a to add a new leaf entry from standard input or a file\n usage:\n %s -a <filename> <key> [</path/to/file/with/entry>]\n";
79 unsigned long entrysize;
82 fprintf(stderr, helptext, argv[0]);
99 if ((mode ==
'a') && (argc == 4 || argc == 5)) {
106 if (argc == 5) infile = fopen(argv[4],
"r");
110 entrysize = fread(buffer,
sizeof(
char),
sizeof(buffer), infile);
135 fprintf(stderr, helptext, argv[0]);
void printTree(TreeKeyIdx treeKey, TreeKeyIdx *target=0, int level=1)
virtual const char * getLocalName()
static char createModule(const char *ipath)
virtual char setKey(const SWKey *ikey)
static signed char create(const char *path)
virtual bool nextSibling()
virtual void setEntry(const char *inbuf, long len=-1)
unsigned long getOffset() const
virtual bool firstChild()