Annwvyn::AnnSaveFileData Class Reference

Class that holds data to read or write. More...

#include <AnnFilesystem.hpp>

Collaboration diagram for Annwvyn::AnnSaveFileData:

Public Member Functions

 AnnSaveFileData (std::string name)
 Private constructor of SaveFileData class. More...
 
std::string getFilename () const
 Get the name of this file. More...
 
std::string getValue (std::string key)
 Get the value of this key. Return empty if key doesn't exist. More...
 
void setValue (std::string key, std::string value)
 Set the value for this key (string) More...
 
void setValue (std::string, const char *value)
 Set the value for this key (C style const string) More...
 
void setValue (std::string key, int value)
 Set the value for this key (integer) More...
 
void setValue (std::string key, float value)
 Set the value for this key (floating point) More...
 
void setValue (std::string key, AnnVect3 vector)
 Set the value for this key (vector as 3 floating point at key.x, key.y, key.z) More...
 
void setValue (std::string key, AnnQuaternion quaternion)
 Set the value for this key (quaternion as 4 floating point at key.w, key.x, key.y, key.z) More...
 
void clearValue (std::string key)
 Remove the key and it's value from the stored data. More...
 
void clearVectorValue (std::string key)
 Vectors are stored under 3 keys because they are 3 floats. More...
 
void clearQuaternionValue (std::string key)
 Quaternions are stored under 4 keys because they are 4 floats. More...
 
bool hasUnsavedChanges () const
 Return true if keys were manipulated but changes weren't wrote to disk yet. More...
 

Private Attributes

std::string fileName
 Name of the file. More...
 
std::map< std::string, std::stringstoredTextData
 Stored data. More...
 
bool changed
 If true, the content of this object should be wrote to disk when possible. More...
 

Friends

class AnnFileWriter
 
class AnnFileReader
 
class AnnFilesystemManager
 

Detailed Description

Class that holds data to read or write.

Definition at line 125 of file AnnFilesystem.hpp.

Constructor & Destructor Documentation

◆ AnnSaveFileData()

AnnSaveFileData::AnnSaveFileData ( std::string  name)

Private constructor of SaveFileData class.

Definition at line 213 of file AnnFilesystem.cpp.

Member Function Documentation

◆ clearQuaternionValue()

void AnnSaveFileData::clearQuaternionValue ( std::string  key)

Quaternions are stored under 4 keys because they are 4 floats.

Definition at line 298 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ clearValue()

void AnnSaveFileData::clearValue ( std::string  key)

Remove the key and it's value from the stored data.

Definition at line 285 of file AnnFilesystem.cpp.

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

◆ clearVectorValue()

void AnnSaveFileData::clearVectorValue ( std::string  key)

Vectors are stored under 3 keys because they are 3 floats.

Definition at line 291 of file AnnFilesystem.cpp.

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

◆ getFilename()

string AnnSaveFileData::getFilename ( ) const

Get the name of this file.

Definition at line 225 of file AnnFilesystem.cpp.

◆ getValue()

string AnnSaveFileData::getValue ( std::string  key)

Get the value of this key. Return empty if key doesn't exist.

Definition at line 230 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ hasUnsavedChanges()

bool AnnSaveFileData::hasUnsavedChanges ( ) const

Return true if keys were manipulated but changes weren't wrote to disk yet.

Definition at line 220 of file AnnFilesystem.cpp.

◆ setValue() [1/6]

void AnnSaveFileData::setValue ( std::string  key,
std::string  value 
)

Set the value for this key (string)

Definition at line 239 of file AnnFilesystem.cpp.

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

◆ setValue() [2/6]

void AnnSaveFileData::setValue ( std::string  key,
const char *  value 
)

Set the value for this key (C style const string)

Definition at line 280 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ setValue() [3/6]

void AnnSaveFileData::setValue ( std::string  key,
int  value 
)

Set the value for this key (integer)

Definition at line 250 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ setValue() [4/6]

void AnnSaveFileData::setValue ( std::string  key,
float  value 
)

Set the value for this key (floating point)

Definition at line 257 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ setValue() [5/6]

void AnnSaveFileData::setValue ( std::string  key,
AnnVect3  vector 
)

Set the value for this key (vector as 3 floating point at key.x, key.y, key.z)

Definition at line 265 of file AnnFilesystem.cpp.

Here is the call graph for this function:

◆ setValue() [6/6]

void AnnSaveFileData::setValue ( std::string  key,
AnnQuaternion  quaternion 
)

Set the value for this key (quaternion as 4 floating point at key.w, key.x, key.y, key.z)

Definition at line 272 of file AnnFilesystem.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ AnnFileReader

friend class AnnFileReader
friend

Definition at line 162 of file AnnFilesystem.hpp.

◆ AnnFilesystemManager

friend class AnnFilesystemManager
friend

Definition at line 163 of file AnnFilesystem.hpp.

◆ AnnFileWriter

friend class AnnFileWriter
friend

Definition at line 161 of file AnnFilesystem.hpp.

Member Data Documentation

◆ changed

bool Annwvyn::AnnSaveFileData::changed
private

If true, the content of this object should be wrote to disk when possible.

Definition at line 172 of file AnnFilesystem.hpp.

◆ fileName

std::string Annwvyn::AnnSaveFileData::fileName
private

Name of the file.

Definition at line 166 of file AnnFilesystem.hpp.

◆ storedTextData

std::map<std::string, std::string> Annwvyn::AnnSaveFileData::storedTextData
private

Stored data.

Definition at line 169 of file AnnFilesystem.hpp.


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