xoreos
0.0.5
|
A localized string. More...
#include <locstring.h>
Public Member Functions | |
LocString () | |
~LocString () | |
void | clear () |
bool | empty () const |
Is this localized string empty, without any strings whatsoever? More... | |
void | swap (LocString &str) |
Swap the contents of the LocString with this LocString's. More... | |
uint32 | getNumStrings () const |
Get the number of strings. More... | |
uint32 | getID () const |
Return the string ID / StrRef. More... | |
void | setID (uint32 id) |
Set the string ID / StrRef. More... | |
bool | hasString (Language language, LanguageGender gender=kLanguageGenderCurrent) const |
Does the LocString have a string of this language? More... | |
const Common::UString & | getString (Language language, LanguageGender gender=kLanguageGenderCurrent) const |
Get the string of that language. More... | |
void | setString (Language language, LanguageGender gender, const Common::UString &str) |
Set the string of that language. More... | |
void | setString (Language language, const Common::UString &str) |
Set the string of that language (for all genders). More... | |
const Common::UString & | getStrRefString () const |
Get the string the StrRef points to. More... | |
const Common::UString & | getFirstString () const |
Get the first available string. More... | |
const Common::UString & | getString () const |
Try to get the most appropriate string. More... | |
void | readString (uint32 languageID, Common::SeekableReadStream &stream) |
Read a string out of a stream. More... | |
void | readLocSubString (Common::SeekableReadStream &stream) |
Read a LocSubString (substring of a LocString in game data) out of a stream. More... | |
void | readLocString (Common::SeekableReadStream &stream, uint32 id, uint32 count) |
Read a LocString out of a stream. More... | |
void | readLocString (Common::SeekableReadStream &stream) |
Read a LocString out of a stream. More... | |
uint32 | getWrittenSize (bool withNullTerminate=false) const |
Get the size, the string table will consume after being written. More... | |
void | writeLocString (Common::WriteStream &stream, bool withNullTerminate=false) const |
Write the LocString to a write stream. More... | |
Private Types | |
typedef std::map< uint32, Common::UString > | StringMap |
Private Member Functions | |
bool | hasString (uint32 languageID) const |
const Common::UString & | getString (uint32 languageID) const |
void | setString (uint32 languageID, const Common::UString &str) |
Private Attributes | |
uint32 | _id |
The string's ID / StrRef. More... | |
StringMap | _strings |
A localized string.
Definition at line 43 of file locstring.h.
|
private |
Definition at line 99 of file locstring.h.
Aurora::LocString::LocString | ( | ) |
Definition at line 40 of file locstring.cpp.
Aurora::LocString::~LocString | ( | ) |
Definition at line 43 of file locstring.cpp.
void Aurora::LocString::clear | ( | ) |
Definition at line 46 of file locstring.cpp.
References _id, _strings, and Aurora::kStrRefInvalid.
Referenced by Aurora::IFOFile::clear(), Aurora::ERFFile::readDescription(), and Engines::Witcher::Campaign::unload().
bool Aurora::LocString::empty | ( | ) | const |
Is this localized string empty, without any strings whatsoever?
Definition at line 52 of file locstring.cpp.
References _id, _strings, Common::UString::empty(), getString(), and Aurora::kStrRefInvalid.
const Common::UString & Aurora::LocString::getFirstString | ( | ) | const |
Get the first available string.
Definition at line 115 of file locstring.cpp.
References _strings, and getStrRefString().
Referenced by getString().
uint32 Aurora::LocString::getID | ( | ) | const |
Return the string ID / StrRef.
Definition at line 66 of file locstring.cpp.
References _id.
Referenced by Aurora::ERFWriter::ERFWriter().
uint32 Aurora::LocString::getNumStrings | ( | ) | const |
Get the number of strings.
Definition at line 62 of file locstring.cpp.
References _strings.
Referenced by Aurora::ERFWriter::ERFWriter().
const Common::UString & Aurora::LocString::getString | ( | Language | language, |
LanguageGender | gender = kLanguageGenderCurrent |
||
) | const |
Get the string of that language.
Definition at line 82 of file locstring.cpp.
References getString(), and LangMan.
Referenced by Engines::Witcher::Console::cmdListAreas(), Engines::DragonAge::Creature::createFakePC(), Engines::DragonAge2::Creature::createFakePC(), Engines::DragonAge2::Placeable::enter(), Engines::DragonAge::Placeable::enter(), Engines::DragonAge::Creature::enter(), Engines::DragonAge2::Creature::enter(), Engines::Witcher::Module::enter(), Engines::NWN::Module::enter(), Engines::Witcher::Module::enterArea(), Engines::NWN::Module::getDescriptionCampaign(), Engines::NWN::Module::getDescriptionExtra(), Aurora::GFF3Struct::getString(), Engines::DragonAge::Campaign::load(), Engines::DragonAge2::Campaign::load(), Engines::DragonAge::Campaigns::loadCampaign(), Engines::DragonAge2::Campaigns::loadCampaign(), Engines::Witcher::Campaign::loadCampaignFile(), Engines::KotOR2::Module::loadIFO(), Engines::KotOR::Module::loadIFO(), Engines::Witcher::Situated::loadModel(), Engines::NWN2::Module::loadModule(), Engines::NWN::Module::loadModule(), Engines::KotOR::DialogGUIBase::refresh(), Engines::Witcher::Functions::sendMessageToPC(), Engines::Witcher::Object::speakOneLiner(), Engines::NWN2::Object::speakOneLiner(), Engines::NWN::Object::speakOneLiner(), and Engines::NWN::Dialog::updateBox().
const Common::UString & Aurora::LocString::getString | ( | ) | const |
Try to get the most appropriate string.
Definition at line 122 of file locstring.cpp.
References getFirstString(), getStrRefString(), hasString(), and LangMan.
Referenced by empty(), and getString().
|
private |
Definition at line 87 of file locstring.cpp.
References _strings, and Aurora::kEmpty.
const Common::UString & Aurora::LocString::getStrRefString | ( | ) | const |
Get the string the StrRef points to.
Definition at line 108 of file locstring.cpp.
References _id, Aurora::kEmpty, Aurora::kStrRefInvalid, and TalkMan.
Referenced by getFirstString(), and getString().
uint32 Aurora::LocString::getWrittenSize | ( | bool | withNullTerminate = false | ) | const |
Get the size, the string table will consume after being written.
Definition at line 179 of file locstring.cpp.
References _strings.
Referenced by Aurora::ERFWriter::ERFWriter().
bool Aurora::LocString::hasString | ( | Language | language, |
LanguageGender | gender = kLanguageGenderCurrent |
||
) | const |
Does the LocString have a string of this language?
Definition at line 74 of file locstring.cpp.
References LangMan.
Referenced by getString().
|
private |
Definition at line 78 of file locstring.cpp.
References _strings.
void Aurora::LocString::readLocString | ( | Common::SeekableReadStream & | stream, |
uint32 | id, | ||
uint32 | count | ||
) |
Read a LocString out of a stream.
Definition at line 165 of file locstring.cpp.
References _id, and readLocSubString().
Referenced by Aurora::GFF3Struct::getLocString(), Aurora::ERFFile::readDescription(), and readLocString().
void Aurora::LocString::readLocString | ( | Common::SeekableReadStream & | stream | ) |
Read a LocString out of a stream.
Definition at line 172 of file locstring.cpp.
References readLocString(), and Common::ReadStream::readUint32LE().
void Aurora::LocString::readLocSubString | ( | Common::SeekableReadStream & | stream | ) |
Read a LocSubString (substring of a LocString in game data) out of a stream.
Definition at line 159 of file locstring.cpp.
References readString(), and Common::ReadStream::readUint32LE().
Referenced by readLocString().
void Aurora::LocString::readString | ( | uint32 | languageID, |
Common::SeekableReadStream & | stream | ||
) |
Read a string out of a stream.
Definition at line 142 of file locstring.cpp.
References _strings, Common::kEncodingInvalid, LangMan, Common::ReadStream::readStream(), Common::readString(), and Common::ReadStream::readUint32LE().
Referenced by readLocSubString().
void Aurora::LocString::setID | ( | uint32 | id | ) |
void Aurora::LocString::setString | ( | Language | language, |
LanguageGender | gender, | ||
const Common::UString & | str | ||
) |
Set the string of that language.
Definition at line 95 of file locstring.cpp.
References LangMan.
Referenced by Engines::DragonAge::Creature::createFakePC(), Engines::DragonAge2::Creature::createFakePC(), Engines::DragonAge::Campaign::readCIFStatic(), Engines::DragonAge2::Campaign::readCIFStatic(), and setString().
void Aurora::LocString::setString | ( | Language | language, |
const Common::UString & | str | ||
) |
Set the string of that language (for all genders).
Definition at line 99 of file locstring.cpp.
References Aurora::kLanguageGenderFemale, Aurora::kLanguageGenderMale, and setString().
|
private |
Definition at line 104 of file locstring.cpp.
References _strings.
void Aurora::LocString::swap | ( | LocString & | str | ) |
Swap the contents of the LocString with this LocString's.
Definition at line 56 of file locstring.cpp.
References _id, _strings, and SWAP().
Referenced by Aurora::GFF3Struct::getLocString().
void Aurora::LocString::writeLocString | ( | Common::WriteStream & | stream, |
bool | withNullTerminate = false |
||
) | const |
Write the LocString to a write stream.
Definition at line 193 of file locstring.cpp.
References _strings, Common::WriteStream::write(), Common::WriteStream::writeByte(), and Common::WriteStream::writeUint32LE().
Referenced by Aurora::ERFWriter::ERFWriter().
|
private |
The string's ID / StrRef.
Definition at line 101 of file locstring.h.
Referenced by clear(), empty(), getID(), getStrRefString(), readLocString(), setID(), and swap().
|
private |
Definition at line 103 of file locstring.h.
Referenced by clear(), empty(), getFirstString(), getNumStrings(), getString(), getWrittenSize(), hasString(), readString(), setString(), swap(), and writeLocString().