Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

void LightApp_Driver::ClearDriverContents ( )
virtual

Clears map of list files

References IsTemporary(), myMap, RemoveTemporaryFiles(), and SetIsTemporary().

std::string LightApp_Driver::GetDirFromPath ( const std::string &  thePath)
protected
Returns
the dir by the path
LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles ( const char *  theModuleName)
Returns
list of files for module with name 'theModuleName'

References myMap.

std::string LightApp_Driver::GetTmpDir ( const char *  theURL,
const bool  isMultiFile 
)
virtual
Returns
temp directory for path 'theURL'

References GetDirFromPath(), and GetTmpDir().

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

References myTmpDir.

bool LightApp_Driver::IsTemporary ( ) const
inlineprotected
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 myMap.

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 GetTmpDir(), and SetIsTemporary().

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

Filling current driver from file 'theFileName'

Reimplemented in LightApp_HDFDriver.

References myTmpDir, PutStreamToFiles(), and SetListOfFiles().

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.

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

References myMap, and RemoveFiles().

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

Save in file 'theFileName' datas from this driver

Reimplemented in LightApp_HDFDriver.

References myMap, myTmpDir, and PutFilesToStream().

void LightApp_Driver::SetIsTemporary ( bool  theFlag)
inlineprotected
void LightApp_Driver::SetListOfFiles ( const char *  theModuleName,
const ListOfFiles  theListOfFiles 
)
virtual

Sets list of files for module with name 'theModuleName'

References myMap.

Member Data Documentation

bool LightApp_Driver::myIsTemp
private
MapOfListOfFiles LightApp_Driver::myMap
protected
std::string LightApp_Driver::myTmpDir
protected

The documentation for this class was generated from the following files: