DbOutput Class Reference

Base class for all output formats. More...

#include <DbOutput.h>

Inherited by BcpOutput, SqlOutput, and XmlOutput.

Inheritance diagram for DbOutput:

Inheritance graph
[legend]
Collaboration diagram for DbOutput:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DbOutput (Db &db)
virtual ~DbOutput ()
virtual void WriteSchema (const std::string &path=std::string())
virtual void WriteDataLoadingScripts (const std::string &path=std::string())
virtual void WriteData (Block &block, const std::string &path=std::string())
void SetInputFile (const std::string &inpFile)
const std::string & GetCommandScriptName ()

Public Attributes

Db_db

Protected Member Functions

void WriteDbExec (std::ostream &io, const std::string &fileName, const unsigned int indentLevel=0)
void WriteDbExecOnly (std::ostream &io, const std::string &fileName, const unsigned int indentLevel=1)
void WriteHeader (std::ostream &io)
void _FormatNumericData (std::ostream &io, const std::string &cs)
void _FormatStringData (std::ostream &io, const std::string &cs, const unsigned int maxWidth)
void _FormatTextData (std::ostream &io, const std::string &cs)
void _FormatDateData (std::ostream &io, const std::string &cs, const unsigned int maxWidth)
void _FormatData (std::ostream &io, const std::string &cs, const unsigned int type, const unsigned int witdh)
bool IsSpecialChar (const char &character)
bool IsSpecialDateChar (const char &character)
virtual void WriteEmptyNumeric (std::ostream &io)
virtual void WriteEmptyString (std::ostream &io)
virtual void WriteSpecialChar (std::ostream &io, const char &specChar)
virtual void WriteEmptyDate (std::ostream &io)
virtual void WriteSpecialDateChar (std::ostream &io, const char &specDateChar)
virtual bool IsFirstTextNewLineSpecial ()
virtual void WriteNewLine (std::ostream &io, bool special=false)
virtual void GetTableStart (std::string &tableStart, const std::string &tableName)
virtual void GetTableEnd (std::string &tableEnd)
const std::string & GetItemSeparator ()
const std::string & GetRowSeparator ()
void GetMasterIndexAttribValue (std::string &masterIndexAttribValue, Block &block, const std::string &masterIndexAttribName, const std::vector< std::string > &tableNames)
virtual void _WriteTable (std::ostream &io, ISTable *tIn, std::vector< unsigned int > &widths, const bool reCalcWidth=false, const std::vector< eTypeCode > &typeCodes=std::vector< eTypeCode >(0))

Protected Attributes

std::string _SCHEMA_FILE
std::string _INPUT_FILE
std::string _stringDelimiter
std::vector< char > _specialChars
std::string _dateDelimiter
std::vector< char > _specialDateChars
std::string _itemSeparator
std::string _rowSeparator

Static Protected Attributes

static const std::string _DATA_LOADING_SCRIPT = "DB_LOADER_COMMANDS.csh"

Static Private Member Functions

static void _FormatStringDataSql (std::ostream &io, const std::string &cs, unsigned int maxWidth)

Detailed Description

Base class for all output formats.

This class encapsulates general characteristics of each kind of output. It contains virtual methods for generating the schema, data and loading scripts.


Constructor & Destructor Documentation

DbOutput::DbOutput ( Db db  ) 

DbOutput::~DbOutput (  )  [virtual]


Member Function Documentation

void DbOutput::_FormatData ( std::ostream &  io,
const std::string &  cs,
const unsigned int  type,
const unsigned int  witdh 
) [protected]

void DbOutput::_FormatDateData ( std::ostream &  io,
const std::string &  cs,
const unsigned int  maxWidth 
) [protected]

void DbOutput::_FormatNumericData ( std::ostream &  io,
const std::string &  cs 
) [protected]

void DbOutput::_FormatStringData ( std::ostream &  io,
const std::string &  cs,
const unsigned int  maxWidth 
) [protected]

static void DbOutput::_FormatStringDataSql ( std::ostream &  io,
const std::string &  cs,
unsigned int  maxWidth 
) [static, private]

void DbOutput::_FormatTextData ( std::ostream &  io,
const std::string &  cs 
) [protected]

virtual void DbOutput::_WriteTable ( std::ostream &  io,
ISTable *  tIn,
std::vector< unsigned int > &  widths,
const bool  reCalcWidth = false,
const std::vector< eTypeCode > &  typeCodes = std::vector< eTypeCode >(0) 
) [protected, virtual]

Reimplemented in XmlOutput.

const string & DbOutput::GetCommandScriptName (  ) 

const string & DbOutput::GetItemSeparator (  )  [protected]

void DbOutput::GetMasterIndexAttribValue ( std::string &  masterIndexAttribValue,
Block &  block,
const std::string &  masterIndexAttribName,
const std::vector< std::string > &  tableNames 
) [protected]

const string & DbOutput::GetRowSeparator (  )  [protected]

virtual void DbOutput::GetTableEnd ( std::string &  tableEnd  )  [protected, virtual]

virtual void DbOutput::GetTableStart ( std::string &  tableStart,
const std::string &  tableName 
) [protected, virtual]

bool DbOutput::IsFirstTextNewLineSpecial (  )  [protected, virtual]

Reimplemented in SqlOutput.

bool DbOutput::IsSpecialChar ( const char &  character  )  [protected]

bool DbOutput::IsSpecialDateChar ( const char &  character  )  [protected]

void DbOutput::SetInputFile ( const std::string &  inpFile  ) 

virtual void DbOutput::WriteData ( Block &  block,
const std::string &  path = std::string() 
) [virtual]

Reimplemented in XmlOutput.

virtual void DbOutput::WriteDataLoadingScripts ( const std::string &  path = std::string()  )  [virtual]

void DbOutput::WriteDbExec ( std::ostream &  io,
const std::string &  fileName,
const unsigned int  indentLevel = 0 
) [protected]

void DbOutput::WriteDbExecOnly ( std::ostream &  io,
const std::string &  fileName,
const unsigned int  indentLevel = 1 
) [protected]

virtual void DbOutput::WriteEmptyDate ( std::ostream &  io  )  [protected, virtual]

Reimplemented in SqlOutput.

virtual void DbOutput::WriteEmptyNumeric ( std::ostream &  io  )  [protected, virtual]

Reimplemented in SqlOutput.

virtual void DbOutput::WriteEmptyString ( std::ostream &  io  )  [protected, virtual]

Reimplemented in BcpOutput, and SqlOutput.

void DbOutput::WriteHeader ( std::ostream &  io  )  [protected]

virtual void DbOutput::WriteNewLine ( std::ostream &  io,
bool  special = false 
) [protected, virtual]

Reimplemented in SqlOutput.

virtual void DbOutput::WriteSchema ( const std::string &  path = std::string()  )  [virtual]

Reimplemented in XmlOutput.

virtual void DbOutput::WriteSpecialChar ( std::ostream &  io,
const char &  specChar 
) [protected, virtual]

virtual void DbOutput::WriteSpecialDateChar ( std::ostream &  io,
const char &  specDateChar 
) [protected, virtual]

Reimplemented in BcpOutput.


Member Data Documentation

const string DbOutput::_DATA_LOADING_SCRIPT = "DB_LOADER_COMMANDS.csh" [static, protected]

std::string DbOutput::_dateDelimiter [protected]

Db& DbOutput::_db

std::string DbOutput::_INPUT_FILE [protected]

std::string DbOutput::_itemSeparator [protected]

std::string DbOutput::_rowSeparator [protected]

std::string DbOutput::_SCHEMA_FILE [protected]

std::vector<char> DbOutput::_specialChars [protected]

std::vector<char> DbOutput::_specialDateChars [protected]

std::string DbOutput::_stringDelimiter [protected]


The documentation for this class was generated from the following files:
Generated on Thu Oct 6 10:15:57 2011 for db-loader-v4.1.0 by  doxygen 1.4.7