88 StringMap::const_iterator s =
_strings.find(languageID);
135 if (!refString.empty())
145 std::pair<StringMap::iterator, bool> s =
_strings.insert(std::make_pair(languageID,
""));
149 s.first->second =
"[???]";
181 for (StringMap::const_iterator iter =
_strings.begin(); iter !=
_strings.end() ; iter++) {
182 size += (*iter).second.size();
184 if (withNullTerminate)
194 for (StringMap::const_iterator iter =
_strings.begin(); iter !=
_strings.end() ; iter++) {
197 stream.
write((*iter).second.c_str(), (*iter).second.size());
198 if (withNullTerminate)
uint32 readUint32LE()
Read an unsigned 32-bit word stored in little endian (LSB first) order from the stream and return it...
#define TalkMan
Shortcut for accessing the talk manager.
void setString(Language language, LanguageGender gender, const Common::UString &str)
Set the string of that language.
A class holding an UTF-8 string.
MemoryReadStream * readStream(size_t dataSize)
Read the specified amount of data into a new[]'ed buffer which then is wrapped into a MemoryReadStrea...
void readLocString(Common::SeekableReadStream &stream, uint32 id, uint32 count)
Read a LocString out of a stream.
const Common::UString & getFirstString() const
Get the first available string.
uint32 getID() const
Return the string ID / StrRef.
Implementing the reading stream interfaces for plain memory blocks.
uint32 getWrittenSize(bool withNullTerminate=false) const
Get the size, the string table will consume after being written.
const Common::UString & getStrRefString() const
Get the string the StrRef points to.
A simple scoped smart pointer template.
void setID(uint32 id)
Set the string ID / StrRef.
Utility templates and functions.
void swap(LocString &str)
Swap the contents of the LocString with this LocString's.
Base for BioWare's Aurora engine files.
bool hasString(Language language, LanguageGender gender=kLanguageGenderCurrent) const
Does the LocString have a string of this language?
static const uint32 kStrRefInvalid
Utility functions for working with differing string encodings.
bool empty() const
Is the string empty?
A scoped plain pointer, allowing pointer-y access and normal deletion.
virtual size_t write(const void *dataPtr, size_t dataSize)=0
Write data into the stream.
void writeByte(byte value)
Handling BioWare's localized strings.
Generic interface for a writable data stream.
uint32 _id
The string's ID / StrRef.
uint32 getNumStrings() const
Get the number of strings.
const Common::UString & getString() const
Try to get the most appropriate string.
#define LangMan
Shortcut for accessing the language manager.
void readLocSubString(Common::SeekableReadStream &stream)
Read a LocSubString (substring of a LocString in game data) out of a stream.
bool empty() const
Is this localized string empty, without any strings whatsoever?
The global talk manager for Aurora strings.
UString readString(SeekableReadStream &stream, Encoding encoding)
Read a string with the given encoding of a stream.
void readString(uint32 languageID, Common::SeekableReadStream &stream)
Read a string out of a stream.
Interface for a seekable & readable data stream.
void writeUint32LE(uint32 value)
void writeLocString(Common::WriteStream &stream, bool withNullTerminate=false) const
Write the LocString to a write stream.
void SWAP(T &a, T &b)
Template method which swaps the values of its two parameters.
static const Common::UString kEmpty