NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
YCompoundFiles::CompoundFile Class Reference

#include <BasicExcel.hpp>

Collaboration diagram for YCompoundFiles::CompoundFile:

Classes

class  Header
 
class  Property
 
class  PropertyTree
 

Public Types

enum  {
  DUPLICATE_PROPERTY =-6 , NAME_TOO_LONG =-5 , FILE_NOT_FOUND =-4 , DIRECTORY_NOT_EMPTY =-3 ,
  DIRECTORY_NOT_FOUND =-2 , INVALID_PATH =-1 , SUCCESS =1
}
 

Public Member Functions

 CompoundFile ()
 
 ~CompoundFile ()
 
bool Create (const wchar_t *filename)
 
bool Open (const wchar_t *filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
 
bool Close ()
 
bool IsOpen ()
 
int ChangeDirectory (const wchar_t *path)
 
int MakeDirectory (const wchar_t *path)
 
int PresentWorkingDirectory (wchar_t *path)
 
int PresentWorkingDirectory (std::vector< wchar_t > &path)
 
int RemoveDirectory (const wchar_t *path)
 
int DelTree (const wchar_t *path)
 
int DirectoryList (std::vector< std::vector< wchar_t > > &list, const wchar_t *path=0)
 
int MakeFile (const wchar_t *path)
 
int RemoveFile (const wchar_t *path)
 
int FileSize (const wchar_t *path, size_t &size)
 
int ReadFile (const wchar_t *path, char *data)
 
int ReadFile (const wchar_t *path, std::vector< char > &data)
 
int WriteFile (const wchar_t *path, const char *data, size_t size)
 
int WriteFile (const wchar_t *path, const std::vector< char > &data, size_t size)
 
bool Create (const char *filename)
 
bool Open (const char *filename, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
 
int ChangeDirectory (const char *path)
 
int MakeDirectory (const char *path)
 
int PresentWorkingDirectory (char *path)
 
int PresentWorkingDirectory (std::vector< char > &path)
 
int RemoveDirectory (const char *path)
 
int DelTree (const char *path)
 
int MakeFile (const char *path)
 
int RemoveFile (const char *path)
 
int FileSize (const char *path, size_t &size)
 
int ReadFile (const char *path, char *data)
 
int ReadFile (const char *path, std::vector< char > &data)
 
int WriteFile (const char *path, char *data, size_t size)
 
int WriteFile (const char *path, std::vector< char > &data, size_t size)
 

Protected Member Functions

void IncreaseLocationReferences (std::vector< size_t > indices)
 
void DecreaseLocationReferences (std::vector< size_t > indices)
 
void SplitPath (const wchar_t *path, wchar_t *&parentpath, wchar_t *&propertyname)
 
bool LoadHeader ()
 
void SaveHeader ()
 
void LoadBAT ()
 
void SaveBAT ()
 
size_t DataSize (size_t startIndex, bool isBig)
 
size_t ReadData (size_t startIndex, char *data, bool isBig)
 
size_t WriteData (const char *data, size_t size, int startIndex, bool isBig)
 
void GetBlockIndices (size_t startIndex, std::vector< size_t > &indices, bool isBig)
 
size_t GetFreeBlockIndex (bool isBig)
 
void ExpandBATArray (bool isBig)
 
void LinkBlocks (size_t from, size_t to, bool isBig)
 
void FreeBlocks (std::vector< size_t > &indices, bool isBig)
 
void LoadProperties ()
 
void SaveProperties ()
 
int MakeProperty (const wchar_t *path, Property *property)
 
PropertyTreeFindProperty (size_t index)
 
PropertyTreeFindProperty (const wchar_t *path)
 
PropertyTreeFindProperty (PropertyTree *parentTree, wchar_t *name)
 
void InsertPropertyTree (PropertyTree *parentTree, Property *property, size_t index)
 
void DeletePropertyTree (PropertyTree *tree)
 
void UpdateChildrenIndices (PropertyTree *parentTree)
 
void IncreasePropertyReferences (PropertyTree *parentTree, size_t index)
 
void DecreasePropertyReferences (PropertyTree *parentTree, size_t index)
 

Protected Attributes

std::vector< char > block_
 
Block file_
 
Header header_
 
std::vector< int > blocksIndices_
 
std::vector< int > sblocksIndices_
 
PropertyTreepropertyTrees_
 
PropertyTreecurrentDirectory_
 
std::vector< Property * > properties_
 
std::vector< PropertyTree * > previousDirectories_
 

Detailed Description

Definition at line 239 of file BasicExcel.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DUPLICATE_PROPERTY 
NAME_TOO_LONG 
FILE_NOT_FOUND 
DIRECTORY_NOT_EMPTY 
DIRECTORY_NOT_FOUND 
INVALID_PATH 
SUCCESS 

Definition at line 242 of file BasicExcel.hpp.

Constructor & Destructor Documentation

◆ CompoundFile()

YCompoundFiles::CompoundFile::CompoundFile ( )

Definition at line 424 of file BasicExcel.cpp.

◆ ~CompoundFile()

YCompoundFiles::CompoundFile::~CompoundFile ( )

Definition at line 428 of file BasicExcel.cpp.

References Close().

Here is the call graph for this function:

Member Function Documentation

◆ ChangeDirectory() [1/2]

int YCompoundFiles::CompoundFile::ChangeDirectory ( const char *  path)

Definition at line 910 of file BasicExcel.cpp.

References ChangeDirectory().

Here is the call graph for this function:

◆ ChangeDirectory() [2/2]

int YCompoundFiles::CompoundFile::ChangeDirectory ( const wchar_t *  path)

Definition at line 523 of file BasicExcel.cpp.

References currentDirectory_, DIRECTORY_NOT_FOUND, FindProperty(), YCompoundFiles::CompoundFile::PropertyTree::parent_, previousDirectories_, propertyTrees_, and SUCCESS.

Referenced by ChangeDirectory(), DirectoryList(), FindProperty(), and MakeProperty().

Here is the call graph for this function:

◆ Close()

bool YCompoundFiles::CompoundFile::Close ( )

Definition at line 488 of file BasicExcel.cpp.

References blocksIndices_, YCompoundFiles::Block::Close(), currentDirectory_, file_, previousDirectories_, properties_, propertyTrees_, and sblocksIndices_.

Referenced by Create(), and ~CompoundFile().

Here is the call graph for this function:

◆ Create() [1/2]

bool YCompoundFiles::CompoundFile::Create ( const char *  filename)

Definition at line 888 of file BasicExcel.cpp.

References Create().

Here is the call graph for this function:

◆ Create() [2/2]

bool YCompoundFiles::CompoundFile::Create ( const wchar_t *  filename)

◆ DataSize()

size_t YCompoundFiles::CompoundFile::DataSize ( size_t  startIndex,
bool  isBig 
)
protected

Definition at line 1408 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::Header::bigBlockSize_, GetBlockIndices(), header_, and YCompoundFiles::CompoundFile::Header::smallBlockSize_.

Referenced by LoadProperties(), ReadData(), and ReadFile().

Here is the call graph for this function:

◆ DecreaseLocationReferences()

◆ DecreasePropertyReferences()

void YCompoundFiles::CompoundFile::DecreasePropertyReferences ( CompoundFile::PropertyTree parentTree,
size_t  index 
)
protected

◆ DeletePropertyTree()

void YCompoundFiles::CompoundFile::DeletePropertyTree ( CompoundFile::PropertyTree tree)
protected

Definition at line 2176 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::PropertyTree::children_, DecreasePropertyReferences(), YCompoundFiles::CompoundFile::PropertyTree::index_, YCompoundFiles::CompoundFile::PropertyTree::parent_, properties_, propertyTrees_, and UpdateChildrenIndices().

Referenced by RemoveDirectory(), and RemoveFile().

Here is the call graph for this function:

◆ DelTree() [1/2]

int YCompoundFiles::CompoundFile::DelTree ( const char *  path)

Definition at line 972 of file BasicExcel.cpp.

References DelTree().

Here is the call graph for this function:

◆ DelTree() [2/2]

int YCompoundFiles::CompoundFile::DelTree ( const wchar_t *  path)

◆ DirectoryList()

int YCompoundFiles::CompoundFile::DirectoryList ( std::vector< std::vector< wchar_t > > &  list,
const wchar_t *  path = 0 
)

Definition at line 717 of file BasicExcel.cpp.

References ChangeDirectory(), YCompoundFiles::CompoundFile::PropertyTree::children_, currentDirectory_, name, previousDirectories_, and SUCCESS.

Here is the call graph for this function:

◆ ExpandBATArray()

void YCompoundFiles::CompoundFile::ExpandBATArray ( bool  isBig)
protected

◆ FileSize() [1/2]

int YCompoundFiles::CompoundFile::FileSize ( const char *  path,
size_t &  size 
)

Definition at line 1005 of file BasicExcel.cpp.

References FileSize().

Here is the call graph for this function:

◆ FileSize() [2/2]

int YCompoundFiles::CompoundFile::FileSize ( const wchar_t *  path,
size_t &  size 
)

Definition at line 772 of file BasicExcel.cpp.

References FILE_NOT_FOUND, FindProperty(), propertyTrees_, YCompoundFiles::CompoundFile::PropertyTree::self_, YCompoundFiles::CompoundFile::Property::size_, and SUCCESS.

Referenced by FileSize(), and ReadFile().

Here is the call graph for this function:

◆ FindProperty() [1/3]

CompoundFile::PropertyTree * YCompoundFiles::CompoundFile::FindProperty ( const wchar_t *  path)
protected

Definition at line 2056 of file BasicExcel.cpp.

References ChangeDirectory(), currentDirectory_, FindProperty(), previousDirectories_, propertyTrees_, SplitPath(), and SUCCESS.

Here is the call graph for this function:

◆ FindProperty() [2/3]

◆ FindProperty() [3/3]

CompoundFile::PropertyTree * YCompoundFiles::CompoundFile::FindProperty ( size_t  index)
protected

Definition at line 2026 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::PropertyTree::children_, FindProperty(), YCompoundFiles::CompoundFile::PropertyTree::index_, previousDirectories_, and propertyTrees_.

Referenced by ChangeDirectory(), DelTree(), FileSize(), FindProperty(), MakeProperty(), ReadFile(), RemoveDirectory(), RemoveFile(), and WriteFile().

Here is the call graph for this function:

◆ FreeBlocks()

◆ GetBlockIndices()

void YCompoundFiles::CompoundFile::GetBlockIndices ( size_t  startIndex,
std::vector< size_t > &  indices,
bool  isBig 
)
protected

Definition at line 1653 of file BasicExcel.cpp.

References blocksIndices_, and sblocksIndices_.

Referenced by DataSize(), ReadData(), and WriteData().

◆ GetFreeBlockIndex()

size_t YCompoundFiles::CompoundFile::GetFreeBlockIndex ( bool  isBig)
protected

Definition at line 1670 of file BasicExcel.cpp.

References blocksIndices_, ExpandBATArray(), and sblocksIndices_.

Referenced by ExpandBATArray(), and WriteData().

Here is the call graph for this function:

◆ IncreaseLocationReferences()

◆ IncreasePropertyReferences()

void YCompoundFiles::CompoundFile::IncreasePropertyReferences ( CompoundFile::PropertyTree parentTree,
size_t  index 
)
protected

◆ InsertPropertyTree()

◆ IsOpen()

bool YCompoundFiles::CompoundFile::IsOpen ( )

Definition at line 515 of file BasicExcel.cpp.

References file_, and YCompoundFiles::Block::IsOpen().

Here is the call graph for this function:

◆ LinkBlocks()

void YCompoundFiles::CompoundFile::LinkBlocks ( size_t  from,
size_t  to,
bool  isBig 
)
protected

Definition at line 1777 of file BasicExcel.cpp.

References blocksIndices_, and sblocksIndices_.

Referenced by WriteData().

◆ LoadBAT()

◆ LoadHeader()

bool YCompoundFiles::CompoundFile::LoadHeader ( )
protected

Definition at line 1313 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::Header::bigBlockSize_, block_, file_, YCompoundFiles::CompoundFile::Header::fileType_, header_, YCompoundFiles::CompoundFile::Header::Read(), YCompoundFiles::Block::Read(), and YCompoundFiles::Block::SetBlockSize().

Here is the call graph for this function:

◆ LoadProperties()

void YCompoundFiles::CompoundFile::LoadProperties ( )
protected

◆ MakeDirectory() [1/2]

int YCompoundFiles::CompoundFile::MakeDirectory ( const char *  path)

Definition at line 921 of file BasicExcel.cpp.

References MakeDirectory().

Here is the call graph for this function:

◆ MakeDirectory() [2/2]

int YCompoundFiles::CompoundFile::MakeDirectory ( const wchar_t *  path)

Definition at line 591 of file BasicExcel.cpp.

References currentDirectory_, MakeProperty(), previousDirectories_, YCompoundFiles::CompoundFile::Property::propertyType_, SaveBAT(), SaveHeader(), and SaveProperties().

Referenced by MakeDirectory(), and MakeProperty().

Here is the call graph for this function:

◆ MakeFile() [1/2]

int YCompoundFiles::CompoundFile::MakeFile ( const char *  path)

Definition at line 983 of file BasicExcel.cpp.

References MakeFile().

Here is the call graph for this function:

◆ MakeFile() [2/2]

int YCompoundFiles::CompoundFile::MakeFile ( const wchar_t *  path)

Definition at line 740 of file BasicExcel.cpp.

References currentDirectory_, MakeProperty(), previousDirectories_, YCompoundFiles::CompoundFile::Property::propertyType_, SaveBAT(), SaveHeader(), and SaveProperties().

Referenced by MakeFile().

Here is the call graph for this function:

◆ MakeProperty()

int YCompoundFiles::CompoundFile::MakeProperty ( const wchar_t *  path,
CompoundFile::Property property 
)
protected

Definition at line 1955 of file BasicExcel.cpp.

References ChangeDirectory(), currentDirectory_, DUPLICATE_PROPERTY, FindProperty(), IncreasePropertyReferences(), InsertPropertyTree(), INVALID_PATH, MakeDirectory(), YCompoundFiles::CompoundFile::Property::name_, NAME_TOO_LONG, properties_, propertyTrees_, SplitPath(), and SUCCESS.

Referenced by MakeDirectory(), and MakeFile().

Here is the call graph for this function:

◆ Open() [1/2]

bool YCompoundFiles::CompoundFile::Open ( const char *  filename,
std::ios_base::openmode  mode = std::ios_base::in|std::ios_base::out 
)

◆ Open() [2/2]

bool YCompoundFiles::CompoundFile::Open ( const wchar_t *  filename,
std::ios_base::openmode  mode = std::ios_base::in|std::ios_base::out 
)

◆ PresentWorkingDirectory() [1/4]

int YCompoundFiles::CompoundFile::PresentWorkingDirectory ( char *  path)

Definition at line 932 of file BasicExcel.cpp.

References PresentWorkingDirectory(), SUCCESS, and wcstombs().

Here is the call graph for this function:

◆ PresentWorkingDirectory() [2/4]

int YCompoundFiles::CompoundFile::PresentWorkingDirectory ( std::vector< char > &  path)

Definition at line 947 of file BasicExcel.cpp.

References PresentWorkingDirectory(), SUCCESS, and wcstombs().

Here is the call graph for this function:

◆ PresentWorkingDirectory() [3/4]

int YCompoundFiles::CompoundFile::PresentWorkingDirectory ( std::vector< wchar_t > &  path)

◆ PresentWorkingDirectory() [4/4]

◆ ReadData()

size_t YCompoundFiles::CompoundFile::ReadData ( size_t  startIndex,
char *  data,
bool  isBig 
)
protected

Definition at line 1427 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::Header::bigBlockSize_, DataSize(), file_, GetBlockIndices(), header_, properties_, YCompoundFiles::Block::Read(), ReadData(), and YCompoundFiles::CompoundFile::Header::smallBlockSize_.

Referenced by FreeBlocks(), LoadProperties(), ReadData(), ReadFile(), and WriteData().

Here is the call graph for this function:

◆ ReadFile() [1/4]

int YCompoundFiles::CompoundFile::ReadFile ( const char *  path,
char *  data 
)

Definition at line 1015 of file BasicExcel.cpp.

References ReadFile().

Here is the call graph for this function:

◆ ReadFile() [2/4]

int YCompoundFiles::CompoundFile::ReadFile ( const char *  path,
std::vector< char > &  data 
)

Definition at line 1025 of file BasicExcel.cpp.

References ReadFile().

Here is the call graph for this function:

◆ ReadFile() [3/4]

int YCompoundFiles::CompoundFile::ReadFile ( const wchar_t *  path,
char *  data 
)

Definition at line 794 of file BasicExcel.cpp.

References DataSize(), FILE_NOT_FOUND, FindProperty(), propertyTrees_, ReadData(), YCompoundFiles::CompoundFile::PropertyTree::self_, YCompoundFiles::CompoundFile::Property::size_, YCompoundFiles::CompoundFile::Property::startBlock_, and SUCCESS.

Referenced by ReadFile().

Here is the call graph for this function:

◆ ReadFile() [4/4]

int YCompoundFiles::CompoundFile::ReadFile ( const wchar_t *  path,
std::vector< char > &  data 
)

Definition at line 834 of file BasicExcel.cpp.

References FileSize(), ReadFile(), and SUCCESS.

Here is the call graph for this function:

◆ RemoveDirectory() [1/2]

int YCompoundFiles::CompoundFile::RemoveDirectory ( const char *  path)

Definition at line 961 of file BasicExcel.cpp.

References RemoveDirectory().

Here is the call graph for this function:

◆ RemoveDirectory() [2/2]

int YCompoundFiles::CompoundFile::RemoveDirectory ( const wchar_t *  path)

Definition at line 657 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::Property::childProp_, DeletePropertyTree(), DIRECTORY_NOT_EMPTY, DIRECTORY_NOT_FOUND, FindProperty(), SaveBAT(), SaveHeader(), SaveProperties(), YCompoundFiles::CompoundFile::PropertyTree::self_, and SUCCESS.

Referenced by DelTree(), and RemoveDirectory().

Here is the call graph for this function:

◆ RemoveFile() [1/2]

int YCompoundFiles::CompoundFile::RemoveFile ( const char *  path)

Definition at line 994 of file BasicExcel.cpp.

References RemoveFile().

Here is the call graph for this function:

◆ RemoveFile() [2/2]

int YCompoundFiles::CompoundFile::RemoveFile ( const wchar_t *  path)

Definition at line 757 of file BasicExcel.cpp.

References DeletePropertyTree(), FindProperty(), SaveBAT(), SaveHeader(), SaveProperties(), SUCCESS, and WriteFile().

Referenced by DelTree(), and RemoveFile().

Here is the call graph for this function:

◆ SaveBAT()

◆ SaveHeader()

void YCompoundFiles::CompoundFile::SaveHeader ( )
protected

Definition at line 1328 of file BasicExcel.cpp.

References block_, file_, header_, YCompoundFiles::CompoundFile::Header::Write(), and YCompoundFiles::Block::Write().

Referenced by Create(), MakeDirectory(), MakeFile(), RemoveDirectory(), RemoveFile(), and WriteFile().

Here is the call graph for this function:

◆ SaveProperties()

void YCompoundFiles::CompoundFile::SaveProperties ( )
protected

Definition at line 1933 of file BasicExcel.cpp.

References YCompoundFiles::CompoundFile::Header::bigBlockSize_, header_, properties_, YCompoundFiles::CompoundFile::Header::propertiesStart_, and WriteData().

Referenced by Create(), MakeDirectory(), MakeFile(), RemoveDirectory(), RemoveFile(), and WriteFile().

Here is the call graph for this function:

◆ SplitPath()

void YCompoundFiles::CompoundFile::SplitPath ( const wchar_t *  path,
wchar_t *&  parentpath,
wchar_t *&  propertyname 
)
protected

Definition at line 1280 of file BasicExcel.cpp.

Referenced by FindProperty(), and MakeProperty().

◆ UpdateChildrenIndices()

void YCompoundFiles::CompoundFile::UpdateChildrenIndices ( CompoundFile::PropertyTree parentTree)
protected

◆ WriteData()

size_t YCompoundFiles::CompoundFile::WriteData ( const char *  data,
size_t  size,
int  startIndex,
bool  isBig 
)
protected

◆ WriteFile() [1/4]

int YCompoundFiles::CompoundFile::WriteFile ( const char *  path,
char *  data,
size_t  size 
)

Definition at line 1035 of file BasicExcel.cpp.

References WriteFile().

Here is the call graph for this function:

◆ WriteFile() [2/4]

int YCompoundFiles::CompoundFile::WriteFile ( const char *  path,
std::vector< char > &  data,
size_t  size 
)

Definition at line 1045 of file BasicExcel.cpp.

References WriteFile().

Here is the call graph for this function:

◆ WriteFile() [3/4]

int YCompoundFiles::CompoundFile::WriteFile ( const wchar_t *  path,
const char *  data,
size_t  size 
)

Definition at line 848 of file BasicExcel.cpp.

References FILE_NOT_FOUND, FindProperty(), SaveBAT(), SaveHeader(), SaveProperties(), SUCCESS, and WriteData().

Referenced by RemoveFile(), and WriteFile().

Here is the call graph for this function:

◆ WriteFile() [4/4]

int YCompoundFiles::CompoundFile::WriteFile ( const wchar_t *  path,
const std::vector< char > &  data,
size_t  size 
)

Definition at line 880 of file BasicExcel.cpp.

References WriteFile().

Here is the call graph for this function:

Member Data Documentation

◆ block_

std::vector<char> YCompoundFiles::CompoundFile::block_
protected

Definition at line 301 of file BasicExcel.hpp.

Referenced by ExpandBATArray(), LoadBAT(), LoadHeader(), SaveBAT(), SaveHeader(), and WriteData().

◆ blocksIndices_

std::vector<int> YCompoundFiles::CompoundFile::blocksIndices_
protected

◆ currentDirectory_

PropertyTree* YCompoundFiles::CompoundFile::currentDirectory_
protected

◆ file_

Block YCompoundFiles::CompoundFile::file_
protected

◆ header_

◆ previousDirectories_

std::vector<PropertyTree*> YCompoundFiles::CompoundFile::previousDirectories_
protected

◆ properties_

◆ propertyTrees_

PropertyTree* YCompoundFiles::CompoundFile::propertyTrees_
protected

◆ sblocksIndices_

std::vector<int> YCompoundFiles::CompoundFile::sblocksIndices_
protected

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