Annwvyn::AnnFilesystemManager Class Reference

Manage where and how files will be wrote and read from the OS file-system. More...

#include <AnnFilesystem.hpp>

Inheritance diagram for Annwvyn::AnnFilesystemManager:
Collaboration diagram for Annwvyn::AnnFilesystemManager:

Public Member Functions

 AnnFilesystemManager (std::string title)
 Construct FileSystem manager. More...
 
void setSaveDirectoryName (std::string name)
 Set the name of the app directory. More...
 
std::string getPathForFileName (std::string fileName) const
 Get the path to the file name. More...
 
std::string getSaveDirectoryFullPath () const
 Get the path to the directory where save are read/written. More...
 
void createSaveDirectory () const
 Create the save directory (should be done at least once) More...
 
AnnSaveFileDataPtr crateSaveFileDataObject (std::string filename)
 Create en empty SaveFileData Object for a specific file. More...
 
AnnSaveFileDataPtr getCachedSaveFileDataObject (std::string filename)
 Get an already existing SaveFileData object for this filename. More...
 
void releaseSaveFileDataObject (std::shared_ptr< AnnSaveFileData > data)
 Destroy this SaveFileData Object. Will loose cached data if this file didn't go through the FileWriter. More...
 
AnnFileReaderPtr getFileReader () const
 Get the FileReader object. More...
 
AnnFileWriterPtr getFileWriter () const
 Get the FileWriter object. More...
 
- Public Member Functions inherited from Annwvyn::AnnSubSystem
 AnnSubSystem (const std::string &systemName)
 Construct a SubSystem. More...
 
virtual ~AnnSubSystem ()
 Destruct a SubSystem. More...
 

Static Public Member Functions

static void createDirectory (std::string path)
 Create the given directory (OS call) More...
 

Static Public Attributes

static std::vector< char > charToEscape
 Escape map. More...
 
static std::vector< char > charToStrip
 Strip map. More...
 

Private Attributes

std::string saveDirectoryName
 Name of the save directory. More...
 
std::string pathToUserDir
 Path to the save directory. More...
 
AnnFileWriterPtr fileWriter
 File writer. More...
 
AnnFileReaderPtr fileReader
 File reader. More...
 
std::list< AnnSaveFileDataPtrcachedData
 Data cache for saves. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Annwvyn::AnnSubSystem
virtual void update ()
 To be called by AnnEngine : update the subsystem for the next frame. More...
 
virtual bool needUpdate ()
 To be called by AnnEngine : Return if the subsystem wants to be updated. More...
 
- Protected Attributes inherited from Annwvyn::AnnSubSystem
std::string name
 Name of the subsystem. More...
 

Detailed Description

Manage where and how files will be wrote and read from the OS file-system.

Definition at line 65 of file AnnFilesystem.hpp.

Constructor & Destructor Documentation

◆ AnnFilesystemManager()

AnnFilesystemManager::AnnFilesystemManager ( std::string  title)

Construct FileSystem manager.

Definition at line 94 of file AnnFilesystem.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ crateSaveFileDataObject()

AnnSaveFileDataPtr AnnFilesystemManager::crateSaveFileDataObject ( std::string  filename)

Create en empty SaveFileData Object for a specific file.

Definition at line 188 of file AnnFilesystem.cpp.

◆ createDirectory()

void AnnFilesystemManager::createDirectory ( std::string  path)
static

Create the given directory (OS call)

Definition at line 163 of file AnnFilesystem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSaveDirectory()

void AnnFilesystemManager::createSaveDirectory ( ) const

Create the save directory (should be done at least once)

Definition at line 178 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ getCachedSaveFileDataObject()

AnnSaveFileDataPtr AnnFilesystemManager::getCachedSaveFileDataObject ( std::string  filename)

Get an already existing SaveFileData object for this filename.

Definition at line 195 of file AnnFilesystem.cpp.

◆ getFileReader()

AnnFileReaderPtr AnnFilesystemManager::getFileReader ( ) const

Get the FileReader object.

Definition at line 203 of file AnnFilesystem.cpp.

◆ getFileWriter()

AnnFileWriterPtr AnnFilesystemManager::getFileWriter ( ) const

Get the FileWriter object.

Definition at line 208 of file AnnFilesystem.cpp.

◆ getPathForFileName()

string AnnFilesystemManager::getPathForFileName ( std::string  fileName) const

Get the path to the file name.

Definition at line 151 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ getSaveDirectoryFullPath()

string AnnFilesystemManager::getSaveDirectoryFullPath ( ) const

Get the path to the directory where save are read/written.

Definition at line 158 of file AnnFilesystem.cpp.

Here is the caller graph for this function:

◆ releaseSaveFileDataObject()

void AnnFilesystemManager::releaseSaveFileDataObject ( std::shared_ptr< AnnSaveFileData data)

Destroy this SaveFileData Object. Will loose cached data if this file didn't go through the FileWriter.

Definition at line 183 of file AnnFilesystem.cpp.

◆ setSaveDirectoryName()

void AnnFilesystemManager::setSaveDirectoryName ( std::string  name)

Set the name of the app directory.

Definition at line 137 of file AnnFilesystem.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cachedData

std::list<AnnSaveFileDataPtr> Annwvyn::AnnFilesystemManager::cachedData
private

Data cache for saves.

Definition at line 112 of file AnnFilesystem.hpp.

◆ charToEscape

vector< char > AnnFilesystemManager::charToEscape
static

Escape map.

Definition at line 116 of file AnnFilesystem.hpp.

◆ charToStrip

vector< char > AnnFilesystemManager::charToStrip
static

Strip map.

Definition at line 119 of file AnnFilesystem.hpp.

◆ fileReader

AnnFileReaderPtr Annwvyn::AnnFilesystemManager::fileReader
private

File reader.

Definition at line 109 of file AnnFilesystem.hpp.

◆ fileWriter

AnnFileWriterPtr Annwvyn::AnnFilesystemManager::fileWriter
private

File writer.

Definition at line 106 of file AnnFilesystem.hpp.

◆ pathToUserDir

std::string Annwvyn::AnnFilesystemManager::pathToUserDir
private

Path to the save directory.

Definition at line 103 of file AnnFilesystem.hpp.

◆ saveDirectoryName

std::string Annwvyn::AnnFilesystemManager::saveDirectoryName
private

Name of the save directory.

Definition at line 100 of file AnnFilesystem.hpp.


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