}\r
\r
// Save: saves XML tree data structure to file. \r
-void XMLTree::Save(int fd) \r
+void XMLTree::Save(int fd, char *filename) \r
{\r
FILE *fp;\r
char filenameaux[1024];\r
\r
// stores the texts \r
if (!disable_tc) {\r
- Text->Save(fp);\r
+ Text->Save(fp, filename);\r
};\r
-\r
-\r
}\r
\r
\r
// Load: loads XML tree data structure from file. Returns\r
// a pointer to the loaded data structure\r
-XMLTree *XMLTree::Load(int fd, bool load_tc,int sample_factor) \r
+XMLTree *XMLTree::Load(int fd, char *filename, bool load_tc,int sample_factor) \r
{\r
\r
FILE *fp;\r
// Not used \r
// loads the texts\r
if (!XML_Tree->disable_tc){\r
- XML_Tree->Text = TextCollection::Load(fp, TextCollection::index_mode_default, sample_factor);\r
+ XML_Tree->Text = TextCollection::Load(fp, filename, TextCollection::index_mode_default, sample_factor);\r
}\r
else XML_Tree->Text = NULL;\r
STOPTIMER(Loading);\r
}\r
\r
/** Save: saves XML tree data structure to file. */\r
- void Save(int fd);\r
+ void Save(int fd, char *filename);\r
\r
/** Load: loads XML tree data structure from file. sample_rate_text \r
* indicates the sample rate for the text search data structure. */\r
- static XMLTree *Load(int fd,bool load_tc, int sample_factor); \r
+ static XMLTree *Load(int fd, char *filename, bool load_tc, int sample_factor); \r
\r
void insertTag(TagType tag, uint position);\r
\r
if (disable_tc)\r
TextBuilder = 0;\r
else \r
- TextBuilder = new TextCollectionBuilder((unsigned)sample_rate_text);\r
+ TextBuilder = TextCollectionBuilder::create((unsigned)sample_rate_text, TextCollectionBuilder::index_type_default);\r
Text = 0;\r
empty_texts_aux = (unsigned int *)ucalloc(sizeof(unsigned int),1);\r
eta_size = sizeof(unsigned int);\r