molecular
Public Member Functions | List of all members
molecular::util::StringStore Class Reference

Maps hashes to strings. More...

#include <StringStore.h>

Public Member Functions

 StringStore (const void *fileData, size_t fileSize)
 Construct from file data. More...
 
 StringStore ()=default
 Default constructor. More...
 
void LoadFromFile (const void *fileData, size_t fileSize)
 Load from file data. More...
 
void LoadFromText (const char *text, size_t size)
 
const char * GetString (uint32_t hash) const
 Get string corresponding to the given hash. More...
 
const char * FindString (uint32_t hash) const noexcept
 
size_t GetStringCount () const
 Get number of stored strings. More...
 
std::unordered_map< uint32_t, uint32_t >::const_iterator begin () const
 Begin iterator. More...
 
std::unordered_map< uint32_t, uint32_t >::const_iterator end () const
 End iterator. More...
 

Detailed Description

Maps hashes to strings.

Constructor & Destructor Documentation

molecular::util::StringStore::StringStore ( const void *  fileData,
size_t  fileSize 
)

Construct from file data.

See also
StringStoreFile
molecular::util::StringStore::StringStore ( )
default

Default constructor.

Use LoadFromFile() to load data!

Member Function Documentation

std::unordered_map<uint32_t, uint32_t>::const_iterator molecular::util::StringStore::begin ( ) const
inline

Begin iterator.

std::unordered_map<uint32_t, uint32_t>::const_iterator molecular::util::StringStore::end ( ) const
inline

End iterator.

const char * molecular::util::StringStore::FindString ( uint32_t  hash) const
noexcept
const char * molecular::util::StringStore::GetString ( uint32_t  hash) const

Get string corresponding to the given hash.

Throws if string was not found.

size_t molecular::util::StringStore::GetStringCount ( ) const
inline

Get number of stored strings.

void molecular::util::StringStore::LoadFromFile ( const void *  fileData,
size_t  fileSize 
)

Load from file data.

See also
StringStoreFile
void molecular::util::StringStore::LoadFromText ( const char *  text,
size_t  size 
)

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