Version: 6.3.1
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes

LightApp_Driver Class Reference

#include <LightApp_Driver.h>

Inheritance diagram for LightApp_Driver:
Inheritance graph

Public Types

typedef std::vector< std::string > ListOfFiles

Public Member Functions

 LightApp_Driver ()
virtual ~LightApp_Driver ()
virtual bool SaveDatasInFile (const char *theFileName, bool isMultiFile)
virtual bool ReadDatasFromFile (const char *theFileName, bool isMultiFile)
virtual std::string GetTmpDir (const char *theURL, const bool isMultiFile)
ListOfFiles GetListOfFiles (const char *theModuleName)
virtual void SetListOfFiles (const char *theModuleName, const ListOfFiles theListOfFiles)
virtual void RemoveTemporaryFiles (const char *theModuleName, const bool IsDirDeleted)
void RemoveFiles (const ListOfFiles &theFiles, const bool IsDirDeleted)
virtual void ClearDriverContents ()

Protected Types

typedef std::map< std::string,
ListOfFiles
MapOfListOfFiles

Protected Member Functions

void PutFilesToStream (const std::string &theModuleName, unsigned char *&theBuffer, long &theBufferSize, bool theNamesOnly=false)
ListOfFiles PutStreamToFiles (const unsigned char *theBuffer, const long theBufferSize, bool theNamesOnly=false)
std::string GetTmpDir ()
std::string GetDirFromPath (const std::string &thePath)
void SetIsTemporary (bool theFlag)
bool IsTemporary () const

Protected Attributes

MapOfListOfFiles myMap
std::string myTmpDir

Private Attributes

bool myIsTemp

Detailed Description

Description : Driver can save to file and read from file list of files for light modules


Member Typedef Documentation

typedef std::vector<std::string> LightApp_Driver.ListOfFiles
typedef std::map<std::string, ListOfFiles> LightApp_Driver.MapOfListOfFiles [protected]

Constructor & Destructor Documentation

LightApp_Driver::LightApp_Driver ( )

Constructor.

LightApp_Driver::~LightApp_Driver ( ) [virtual]

Destructor.


Member Function Documentation

bool LightApp_Driver::SaveDatasInFile ( const char *  theFileName,
bool  isMultiFile 
) [virtual]

Save in file 'theFileName' datas from this driver

Reimplemented in LightApp_HDFDriver.

References test_big_table.aName.

bool LightApp_Driver::ReadDatasFromFile ( const char *  theFileName,
bool  isMultiFile 
) [virtual]

Filling current driver from file 'theFileName'

Reimplemented in LightApp_HDFDriver.

std::string LightApp_Driver::GetTmpDir ( const char *  theURL,
const bool  isMultiFile 
) [virtual]
Returns:
temp directory for path 'theURL'
LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles ( const char *  theModuleName)
Returns:
list of files for module with name 'theModuleName'

References test_big_table.aName.

void LightApp_Driver::SetListOfFiles ( const char *  theModuleName,
const ListOfFiles  theListOfFiles 
) [virtual]

Sets list of files for module with name 'theModuleName'

References test_big_table.aName.

void LightApp_Driver::RemoveTemporaryFiles ( const char *  theModuleName,
const bool  IsDirDeleted 
) [virtual]

Removes files which was created from module theModuleName if <IsDirDeleted> is true tmp directory is also deleted if it is empty

void LightApp_Driver::RemoveFiles ( const ListOfFiles theFiles,
const bool  IsDirDeleted 
)

Remove files. First item in <theFiles> is a directory with slash at the end. Other items are names of files. If <IsDirDeleted> is true, then the directory is also deleted.

References TCollection_AsciiString.

void LightApp_Driver::ClearDriverContents ( ) [virtual]

Clears map of list files

void LightApp_Driver::PutFilesToStream ( const std::string &  theModuleName,
unsigned char *&  theBuffer,
long &  theBufferSize,
bool  theNamesOnly = false 
) [protected]

Converts files which was created from module <theModuleName> into a byte sequence unsigned char

References test_big_table.aName, and TCollection_AsciiString.

LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles ( const unsigned char *  theBuffer,
const long  theBufferSize,
bool  theNamesOnly = false 
) [protected]

Converts a byte sequence <theBuffer> to files and return list of them

References TCollection_AsciiString.

std::string LightApp_Driver::GetTmpDir ( ) [protected]
Returns:
a temp directory to store created files like "/tmp/sub_dir/"

References TCollection_AsciiString.

std::string LightApp_Driver::GetDirFromPath ( const std::string &  thePath) [protected]
Returns:
the dir by the path

References TCollection_AsciiString.

void LightApp_Driver.SetIsTemporary ( bool  theFlag) [protected]
bool LightApp_Driver.IsTemporary ( ) const [protected]

Field Documentation

std::string LightApp_Driver.myTmpDir [protected]
bool LightApp_Driver.myIsTemp [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS