Creates a XML index file or linear buffer (LB) index file.
Example:
SmartPtr< IndexWriter > writer = new WISHIndexWriter( dir_name , "WISH" );
writer->writeXMLFile( "wish_index.xml" );
where dir_name is the directory name and 'WISH' is tab name in display.
Public Member Functions | |
IndexWriter (const std::string &dir_name, const std::string &tab_name, bool allow_remoteAccess=false) throw ( code::Exception ) | |
Looks for the files in a given directory, creates and stores information from file names as Records. | |
IndexWriter (const std::string &dir_name, const std::string &file_name, const std::string &tab_name, bool allow_remote_access=false) | |
Does not look for all files in the file_dir. | |
virtual | ~IndexWriter () |
virtual bool | writeXMLFile (const std::string &file_name)=0 |
Returns whether or not the XML writing succeeded. | |
virtual bool | writeXMLLinearBuffer (const std::string &lb_name, size_t numExtraMessages=1000)=0 |
Returns whether or not the XML LB writing succeeded. | |
Static Public Member Functions | |
static std::string | add_mach_name (const std::string &dir_name, bool allow_remote_access) |
Creates a new string with the machine name prepended if allow_remote_access is set to true. | |
Protected Attributes | |
std::string | dir_name_ |
std::string | tab_name_ |
std::string | machine_name_ |
code::IndexWriter::IndexWriter | ( | const std::string & | dir_name, | |
const std::string & | tab_name, | |||
bool | allow_remoteAccess = false | |||
) | throw ( code::Exception ) |
Looks for the files in a given directory, creates and stores information from file names as Records.
dir_name | data directory to search. | |
tab_name | tab name in the GUI | |
remote_access | It has default value 'false'. It means local. If your file is located in a remote machine, it should be set to true. |
Example:
SmartPtr< IndexWriter > writer = new WISHIndexWriter( dir_name , "WISH" ); writer->writeXMLFile( "wish_index.xml" ); or writer->writeXMLLinearBuffer( "wish_index.lb" );
Exception | with a descriptive message. |
code::IndexWriter::IndexWriter | ( | const std::string & | dir_name, | |
const std::string & | file_name, | |||
const std::string & | tab_name, | |||
bool | allow_remote_access = false | |||
) |
Does not look for all files in the file_dir.
But extracts information from given file name to create a Index::Record. Then this IndexWriter is ready to write out the LB.
dir_name | directory name where given file is at. | |
file_name | file name of product. | |
tab_name | tab name in the GUI. | |
remote_access | It has default value 'false'. It means local. If your file is located in a remote machine, it should be set to true. |
void notifySystem(const std::string& file_name) { SmartPtr< IndexWriter > writer = new HiresIndexWriter("/mnt/display",file_name,"May3",true); writer->writeXMLLinearBuffer("/mnt/display/code_index.lb"); }
virtual code::IndexWriter::~IndexWriter | ( | ) | [inline, virtual] |
static std::string code::IndexWriter::add_mach_name | ( | const std::string & | dir_name, | |
bool | allow_remote_access | |||
) | [static] |
Creates a new string with the machine name prepended if allow_remote_access is set to true.
virtual bool code::IndexWriter::writeXMLFile | ( | const std::string & | file_name | ) | [pure virtual] |
Returns whether or not the XML writing succeeded.
virtual bool code::IndexWriter::writeXMLLinearBuffer | ( | const std::string & | lb_name, | |
size_t | numExtraMessages = 1000 | |||
) | [pure virtual] |
Returns whether or not the XML LB writing succeeded.
This method creates the LB if it doesn't already exist, but merely appends to an existing LB in that directory. If this is not the behaviour you want, you should consider removing any existing LB in that directory or placing an LB of your specifications in there.
numExtraMessages | How many more messages to leave room for when creating a brand new LB. |
std::string code::IndexWriter::dir_name_ [protected] |
std::string code::IndexWriter::machine_name_ [protected] |
std::string code::IndexWriter::tab_name_ [protected] |