writer Class Reference
[SimString SWIG interface]


Detailed Description

SimString database writer.


Public Member Functions

 writer (const char *filename, int n=3, bool be=false, bool unicode=false)
 Creates a new database.
virtual ~writer ()
 Destructs the writer.
void insert (const char *string)
 Inserts a string into the database.
void close ()
 Closes the database.


Constructor & Destructor Documentation

writer::writer ( const char *  filename,
int  n = 3,
bool  be = false,
bool  unicode = false 
)

Creates a new database.

This function creates an instance of SimString database writer for creating a new database. If this function failes to open the database, it throws SWIG_IOError.

Parameters:
filename The database filename.
n The unit of character n-grams.
be true to represent a begin and end of strings in character n-grams.
unicode true to use Unicode mode. In Unicode mode, wide (wchar_t) characters are used in n-grams.
Exceptions:
SWIG_IOError 

virtual writer::~writer (  )  [virtual]

Destructs the writer.

Destructing a writer object automatically closes the database.

Exceptions:
SWIG_IOError 


Member Function Documentation

void writer::insert ( const char *  string  ) 

Inserts a string into the database.

Parameters:
string A string to be inserted to the database. This argument must be a null-terminated byte stream. If the database is created with Unicode mode, this function assumes that the byte stream is encoded in UTF-8, and converts it into a wchar_t string.
Exceptions:
SWIG_IOError 

void writer::close (  ) 

Closes the database.

This function flushes and closes the database. If this function failes to close the database, it throws SWIG_IOError.

Exceptions:
SWIG_IOError 


Copyright (c) 2002-2010 by Naoaki Okazaki
Sun Mar 7 18:18:45 2010