code::IndexWriter Class Reference

List of all members.

Detailed Description

Base class for HiresIndexWriter and WISHIndexWriter.

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.
  

Author:
Lakshman, Lulin Song
Version:
Id
code_IndexWriter.h,v 1.6 2009/06/02 20:17:39 lakshman Exp


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_


Constructor & Destructor Documentation

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.

Parameters:
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.
After IndexWriter is constructed by this constructor, it can be used to write out a XML file or a LB file.

Example:

  SmartPtr< IndexWriter > writer =
                new WISHIndexWriter( dir_name , "WISH" );
  writer->writeXMLFile( "wish_index.xml" );
  or writer->writeXMLLinearBuffer( "wish_index.lb" );
  

Exceptions:
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.

Parameters:
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.

virtual code::IndexWriter::~IndexWriter (  )  [inline, virtual]


Member Function Documentation

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.

Parameters:
numExtraMessages How many more messages to leave room for when creating a brand new LB.


Member Data Documentation

std::string code::IndexWriter::dir_name_ [protected]

std::string code::IndexWriter::machine_name_ [protected]

std::string code::IndexWriter::tab_name_ [protected]


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7