aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2009-12-29 23:20:23 +0000
committerEugene Sandulenko2009-12-29 23:20:23 +0000
commitfb8ecae7f1904f9d992ce3a01356febcd94d9e36 (patch)
treece5c3960a99c07d4cc8d6b803b49cf17f213e07e /common
parent0ea022d076c491d802431ee90b658d5e8c06d0e0 (diff)
downloadscummvm-rg350-fb8ecae7f1904f9d992ce3a01356febcd94d9e36.tar.gz
scummvm-rg350-fb8ecae7f1904f9d992ce3a01356febcd94d9e36.tar.bz2
scummvm-rg350-fb8ecae7f1904f9d992ce3a01356febcd94d9e36.zip
Add Mohawk engine code. Part 2/3: common code changes.
svn-id: r46728
Diffstat (limited to 'common')
-rw-r--r--common/config-file.cpp6
-rw-r--r--common/stream.h8
2 files changed, 11 insertions, 3 deletions
diff --git a/common/config-file.cpp b/common/config-file.cpp
index 9b69452b2e..159fa778f7 100644
--- a/common/config-file.cpp
+++ b/common/config-file.cpp
@@ -95,7 +95,7 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
if (line.size() == 0) {
// Do nothing
- } else if (line[0] == '#') {
+ } else if (line[0] == '#' || line[0] == ';') {
// Accumulate comments here. Once we encounter either the start
// of a new section, or a key-value-pair, we associate the value
// of the 'comment' variable with that entity.
@@ -116,8 +116,8 @@ bool ConfigFile::loadFromStream(SeekableReadStream &stream) {
const char *p = line.c_str() + 1;
// Get the section name, and check whether it's valid (that
// is, verify that it only consists of alphanumerics,
- // dashes and underscores).
- while (*p && (isalnum(*p) || *p == '-' || *p == '_'))
+ // periods, dashes and underscores).
+ while (*p && (isalnum(*p) || *p == '-' || *p == '_' || *p == '.'))
p++;
if (*p == '\0')
diff --git a/common/stream.h b/common/stream.h
index ca2ad6721e..1294929149 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -388,6 +388,13 @@ public:
* err() or eos() to determine whether an exception occurred.
*/
virtual String readLine();
+
+ /**
+ * Return the beginning offset in the stream, which defaults to 0.
+ *
+ * @return the beginning offset of the stream
+ */
+ virtual uint32 getBeginOffset() { return 0; }
};
@@ -447,6 +454,7 @@ public:
virtual int32 pos() const { return _pos - _begin; }
virtual int32 size() const { return _end - _begin; }
+ virtual uint32 getBeginOffset() { return _begin; }
virtual bool seek(int32 offset, int whence = SEEK_SET);
};