#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <io.h>
#include <entriesblk.h>
#include <iostream>
#include <string>
#include <treekeyidx.h>
#include <rawgenbook.h>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 72 of file addgb.cpp.
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]);
static char createModule(const char *ipath)
virtual char setKey(const SWKey *ikey)
static signed char create(const char *path)
virtual void setEntry(const char *inbuf, long len=-1)
Definition at line 54 of file addgb.cpp.
58 unsigned long currentOffset = target->
getOffset();
59 std::cout << ((currentOffset == treeKey.
getOffset()) ?
"==>" :
"");
60 for (
int i = 0; i < level; i++) std::cout <<
"\t";
void printTree(TreeKeyIdx treeKey, TreeKeyIdx *target=0, int level=1)
virtual const char * getLocalName()
virtual bool nextSibling()
unsigned long getOffset() const
virtual bool firstChild()