COMMON: Add ReadStream::readString() and use it in the Ultima engine
This commit is contained in:
parent
6c24e0de98
commit
b5d6716d1d
4 changed files with 19 additions and 27 deletions
|
@ -52,6 +52,16 @@ SeekableReadStream *ReadStream::readStream(uint32 dataSize) {
|
|||
return new MemoryReadStream((byte *)buf, dataSize, DisposeAfterUse::YES);
|
||||
}
|
||||
|
||||
Common::String ReadStream::readString(char terminator) {
|
||||
Common::String result;
|
||||
char c;
|
||||
|
||||
while ((c = (char)readByte()) != terminator && !eos())
|
||||
result += c;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Common::String ReadStream::readPascalString(bool transformCR) {
|
||||
Common::String s;
|
||||
char *buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue