StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Utilities::KeyValueStore Class Reference

Public Member Functions

template<typename T>
Read (const std::string &key) const
 Read data of specified type.
 
template<typename T>
void Write (const std::string &key, const T &input)
 Write data of specified type.
 
void Erase (std::string key)
 Erase key from store.
 
bool Contains (std::string key) const
 Erase key from store.
 
void WriteToFile (const char *path) const
 Write full content to a file.
 
void ReadFromFile (const Resources::Resource &file)
 Read content from a file.
 
void ReadFromFile (std::ifstream &file)
 Read content from an input file stream.
 

Member Function Documentation

◆ Contains()

bool StevEngine::Utilities::KeyValueStore::Contains ( std::string key) const

Erase key from store.

Parameters
keyKey to data
Returns
Boolean showing if key contains any data

◆ Erase()

void StevEngine::Utilities::KeyValueStore::Erase ( std::string key)

Erase key from store.

Parameters
keyKey to data

◆ Read()

template<typename T>
T StevEngine::Utilities::KeyValueStore::Read ( const std::string & key) const
inline

Read data of specified type.

Template Parameters
TType of data to read
Parameters
keyKey to read
Returns
Read value of type T

◆ ReadFromFile() [1/2]

void StevEngine::Utilities::KeyValueStore::ReadFromFile ( const Resources::Resource & file)

Read content from a file.

Parameters
fileFile to read from

◆ ReadFromFile() [2/2]

void StevEngine::Utilities::KeyValueStore::ReadFromFile ( std::ifstream & file)

Read content from an input file stream.

Parameters
fileInput file stream to read from

◆ Write()

template<typename T>
void StevEngine::Utilities::KeyValueStore::Write ( const std::string & key,
const T & input )
inline

Write data of specified type.

Template Parameters
TType of data to write
Parameters
keyKey to data
dataValue to write

◆ WriteToFile()

void StevEngine::Utilities::KeyValueStore::WriteToFile ( const char * path) const

Write full content to a file.

Parameters
pathPath of the file to write to

Writes the full key value store content to a file with the specified path.


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