Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

test-index.C

// $Id: test-index.C,v 1.1.1.1 2002/03/24 12:37:03 dvermeir Exp $
#include <fstream>
#include <iterator>
#include "index.h"
#include "word.h"

int
main() {
try {
  static const string ifn("stringpool.C");
  static const string ofn("test-index.index");
  {
  
  ifstream ifs(ifn.c_str());
  ofstream ofs(ofn.c_str());
  Index index(6);

  index.insert(ifn, ifs);
  ofs << index;
  cout << index;
  }
  {
  ifstream ifs(ofn.c_str());
  Index index(6);
  ifs >> index;
  cout << index;
  }
  }
catch (exception& e) {
  cerr << e.what() << endl;
  return 1;
  }
return 0;
}

textindexer-0.2 [27 March, 2002]