Navigation Menu

Skip to content

Commit

Permalink
AURORA: Make LocString write and getWrittenSize const
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius committed Jun 27, 2018
1 parent c64b3b1 commit 061090d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/aurora/locstring.cpp
Expand Up @@ -176,9 +176,9 @@ void LocString::readLocString(Common::SeekableReadStream &stream) {
readLocString(stream, id, count);
}

uint32 LocString::getWrittenSize(bool withNullTerminate) {
uint32 LocString::getWrittenSize(bool withNullTerminate) const {
uint32 size = 0;
for (StringMap::iterator iter = _strings.begin(); iter != _strings.end() ; iter++) {
for (StringMap::const_iterator iter = _strings.begin(); iter != _strings.end() ; iter++) {
size += (*iter).second.size();

if (withNullTerminate)
Expand All @@ -190,8 +190,8 @@ uint32 LocString::getWrittenSize(bool withNullTerminate) {
return size;
}

void LocString::writeLocString(Common::WriteStream &stream, bool withNullTerminate) {
for (StringMap::iterator iter = _strings.begin(); iter != _strings.end() ; iter++) {
void LocString::writeLocString(Common::WriteStream &stream, bool withNullTerminate) const {
for (StringMap::const_iterator iter = _strings.begin(); iter != _strings.end() ; iter++) {
stream.writeUint32LE((*iter).first);
stream.writeUint32LE((*iter).second.size());
stream.write((*iter).second.c_str(), (*iter).second.size());
Expand Down
4 changes: 2 additions & 2 deletions src/aurora/locstring.h
Expand Up @@ -91,9 +91,9 @@ class LocString {
void readLocString(Common::SeekableReadStream &stream);

/** Get the size, the string table will consume after being written. */
uint32 getWrittenSize(bool withNullTerminate = false);
uint32 getWrittenSize(bool withNullTerminate = false) const;
/** Write the LocString to a write stream. */
void writeLocString(Common::WriteStream &stream, bool withNullTerminate = false);
void writeLocString(Common::WriteStream &stream, bool withNullTerminate = false) const;

private:
typedef std::map<uint32, Common::UString> StringMap;
Expand Down

0 comments on commit 061090d

Please sign in to comment.