diff options
author | Max Horn | 2010-10-28 00:26:25 +0000 |
---|---|---|
committer | Max Horn | 2010-10-28 00:26:25 +0000 |
commit | b2fa7e58a395b883e7c59ecb1f29f8fc6607885b (patch) | |
tree | 01e5d568b0d7fe4b42b0abca5c1f0fa80654e196 /engines/sword25/kernel | |
parent | cf3551525f4583ec8a5feb231cb25d81a9722853 (diff) | |
download | scummvm-rg350-b2fa7e58a395b883e7c59ecb1f29f8fc6607885b.tar.gz scummvm-rg350-b2fa7e58a395b883e7c59ecb1f29f8fc6607885b.tar.bz2 scummvm-rg350-b2fa7e58a395b883e7c59ecb1f29f8fc6607885b.zip |
SWORD25: Start to rename read/write methods of *PersistenceBlock classes
All should be renamed to reduce risk of accidental incorrect use.
svn-id: r53899
Diffstat (limited to 'engines/sword25/kernel')
-rw-r--r-- | engines/sword25/kernel/inputpersistenceblock.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/kernel/inputpersistenceblock.h | 4 | ||||
-rw-r--r-- | engines/sword25/kernel/outputpersistenceblock.cpp | 11 | ||||
-rw-r--r-- | engines/sword25/kernel/outputpersistenceblock.h | 5 |
4 files changed, 8 insertions, 16 deletions
diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index 132e08918d..652c2f362f 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -93,7 +93,7 @@ void InputPersistenceBlock::read(bool &value) { } } -void InputPersistenceBlock::read(Common::String &value) { +void InputPersistenceBlock::readString(Common::String &value) { value = ""; if (checkMarker(STRING_MARKER)) { @@ -107,7 +107,7 @@ void InputPersistenceBlock::read(Common::String &value) { } } -void InputPersistenceBlock::read(Common::Array<byte> &value) { +void InputPersistenceBlock::readByteArray(Common::Array<byte> &value) { if (checkMarker(BLOCK_MARKER)) { uint size; read(size); diff --git a/engines/sword25/kernel/inputpersistenceblock.h b/engines/sword25/kernel/inputpersistenceblock.h index a941d3cb5c..f6ab256460 100644 --- a/engines/sword25/kernel/inputpersistenceblock.h +++ b/engines/sword25/kernel/inputpersistenceblock.h @@ -57,8 +57,8 @@ public: void read(uint &value); void read(float &value); void read(bool &value); - void read(Common::String &value); - void read(Common::Array<byte> &value); + void readString(Common::String &value); + void readByteArray(Common::Array<byte> &value); bool isGood() const { return _errorState == NONE; diff --git a/engines/sword25/kernel/outputpersistenceblock.cpp b/engines/sword25/kernel/outputpersistenceblock.cpp index b81f3c1bbe..b1c3233b59 100644 --- a/engines/sword25/kernel/outputpersistenceblock.cpp +++ b/engines/sword25/kernel/outputpersistenceblock.cpp @@ -72,27 +72,20 @@ void OutputPersistenceBlock::write(bool value) { rawWrite(&uintBool, sizeof(uintBool)); } -void OutputPersistenceBlock::write(const Common::String &string) { +void OutputPersistenceBlock::writeString(const Common::String &string) { writeMarker(STRING_MARKER); write(string.size()); rawWrite(string.c_str(), string.size()); } -void OutputPersistenceBlock::write(Common::Array<byte> &value) { +void OutputPersistenceBlock::writeByteArray(Common::Array<byte> &value) { writeMarker(BLOCK_MARKER); write((uint)value.size()); rawWrite(&value[0], value.size()); } -void OutputPersistenceBlock::write(const void *bufferPtr, size_t size) { - writeMarker(BLOCK_MARKER); - - write((int)size); - rawWrite(bufferPtr, size); -} - void OutputPersistenceBlock::writeMarker(byte marker) { _data.push_back(marker); } diff --git a/engines/sword25/kernel/outputpersistenceblock.h b/engines/sword25/kernel/outputpersistenceblock.h index a7b0673f6f..71dbe68a52 100644 --- a/engines/sword25/kernel/outputpersistenceblock.h +++ b/engines/sword25/kernel/outputpersistenceblock.h @@ -48,9 +48,8 @@ public: void write(uint value); void write(float value); void write(bool value); - void write(const Common::String &string); - void write(Common::Array<byte> &value); - void write(const void *bufferPtr, size_t size); + void writeString(const Common::String &string); + void writeByteArray(Common::Array<byte> &value); const void *getData() const { return &_data[0]; |