xoreos  0.0.5
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::LTRFile Class Reference

LTR File, which is used when generating player names. More...

#include <ltrfile.h>

Inheritance diagram for Aurora::LTRFile:
Inheritance graph
[legend]
Collaboration diagram for Aurora::LTRFile:
Collaboration graph
[legend]

Classes

struct  LetterSet
 

Public Member Functions

 LTRFile (const Common::UString &ltr)
 
 LTRFile (Common::SeekableReadStream &stream)
 
size_t getLetterCount () const
 Get the letter count utilized by the ltr file. More...
 
Common::UString generateRandomName (size_t maxLetters) const
 Generate a random name from the ltr file. More...
 
- Public Member Functions inherited from Aurora::AuroraFile
 AuroraFile ()
 
void clear ()
 
uint32 getID () const
 Return the file's ID. More...
 
uint32 getVersion () const
 Return the file's version. More...
 
bool isUTF16LE () const
 Were the ID and version encoded in little-endian UTF-16 in the file? More...
 

Private Member Functions

void load (Common::SeekableReadStream &stream)
 

Private Attributes

Common::ScopedArray< char > _alphabet
 
uint8 _letterCount
 
LetterSet _singleLetters
 
Common::ScopedArray< LetterSet_doubleLetters
 
Common::ScopedArray< Common::ScopedArray< LetterSet > > _tripleLetters
 

Additional Inherited Members

- Static Public Member Functions inherited from Aurora::AuroraFile
static void readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version, bool &utf16le)
 Read the header out of a stream. More...
 
static void readHeader (Common::ReadStream &stream, uint32 &id, uint32 &version)
 Read the ID and version out of a stream. More...
 
static uint32 readHeaderID (Common::ReadStream &stream)
 Read the ID out of a stream. More...
 
- Protected Member Functions inherited from Aurora::AuroraFile
void readHeader (Common::ReadStream &stream)
 
- Static Protected Member Functions inherited from Aurora::AuroraFile
static uint32 convertUTF16LE (uint32 x1, uint32 x2)
 
- Protected Attributes inherited from Aurora::AuroraFile
uint32 _id
 The file's ID. More...
 
uint32 _version
 The file's version. More...
 
bool _utf16le
 The file's ID and version are in little-endian UTF-16. More...
 

Detailed Description

LTR File, which is used when generating player names.

Information about the file structure was taken from https://github.com/mtijanic/nwn-misc

Definition at line 44 of file ltrfile.h.

Constructor & Destructor Documentation

◆ LTRFile() [1/2]

Aurora::LTRFile::LTRFile ( const Common::UString ltr)

Definition at line 39 of file ltrfile.cpp.

References Aurora::kFileTypeLTR, load(), and ResMan.

Here is the call graph for this function:

◆ LTRFile() [2/2]

Aurora::LTRFile::LTRFile ( Common::SeekableReadStream stream)

Definition at line 44 of file ltrfile.cpp.

References load().

Here is the call graph for this function:

Member Function Documentation

◆ generateRandomName()

Common::UString Aurora::LTRFile::generateRandomName ( size_t  maxLetters) const

◆ getLetterCount()

size_t Aurora::LTRFile::getLetterCount ( ) const

Get the letter count utilized by the ltr file.

Definition at line 48 of file ltrfile.cpp.

References _letterCount.

◆ load()

void Aurora::LTRFile::load ( Common::SeekableReadStream stream)
private

Member Data Documentation

◆ _alphabet

Common::ScopedArray<char> Aurora::LTRFile::_alphabet
private

Definition at line 64 of file ltrfile.h.

Referenced by generateRandomName(), and load().

◆ _doubleLetters

Common::ScopedArray<LetterSet> Aurora::LTRFile::_doubleLetters
private

Definition at line 68 of file ltrfile.h.

Referenced by generateRandomName(), and load().

◆ _letterCount

uint8 Aurora::LTRFile::_letterCount
private

Definition at line 65 of file ltrfile.h.

Referenced by generateRandomName(), getLetterCount(), and load().

◆ _singleLetters

LetterSet Aurora::LTRFile::_singleLetters
private

Definition at line 67 of file ltrfile.h.

Referenced by generateRandomName(), and load().

◆ _tripleLetters

Common::ScopedArray<Common::ScopedArray<LetterSet> > Aurora::LTRFile::_tripleLetters
private

Definition at line 69 of file ltrfile.h.

Referenced by generateRandomName(), and load().


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