diff options
author | Max Horn | 2009-04-22 17:52:56 +0000 |
---|---|---|
committer | Max Horn | 2009-04-22 17:52:56 +0000 |
commit | b98f79fe120f3859cace579d21731f137376d5fb (patch) | |
tree | 04b9e855ba6d5f53bbdd228fa5db3826c563168e /common | |
parent | ab05e797157890f4f33c9b9e98c84174bd9bec22 (diff) | |
download | scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.tar.gz scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.tar.bz2 scummvm-rg350-b98f79fe120f3859cace579d21731f137376d5fb.zip |
COMMON: changed class StringList to a simple typedef; enhanced the Common::Array constructor which converts regular arrays to Array objects to be more flexible in its type (allows e.g. to assign an array of char* to a StringList
svn-id: r40077
Diffstat (limited to 'common')
-rw-r--r-- | common/array.h | 3 | ||||
-rw-r--r-- | common/str.h | 11 |
2 files changed, 3 insertions, 11 deletions
diff --git a/common/array.h b/common/array.h index 2db0ed2a8b..491ed138a2 100644 --- a/common/array.h +++ b/common/array.h @@ -54,7 +54,8 @@ public: /** * Construct an array by copying data from a regular array. */ - Array(const T *data, int n) { + template<class T2> + Array(const T2 *data, int n) { _capacity = _size = n; _storage = new T[_capacity]; copy(data, data + _size, _storage); diff --git a/common/str.h b/common/str.h index 5792692030..9c5e267f1c 100644 --- a/common/str.h +++ b/common/str.h @@ -314,16 +314,7 @@ Common::String normalizePath(const Common::String &path, const char sep); bool matchString(const char *str, const char *pat, bool pathMode = false); -class StringList : public Array<String> { -public: - void push_back(const char *str) { - Array<String>::push_back(str); - } - - void push_back(const String &str) { - Array<String>::push_back(str); - } -}; +typedef Array<String> StringList; } // End of namespace Common |