diff options
| author | Max Horn | 2010-03-18 15:09:24 +0000 |
|---|---|---|
| committer | Max Horn | 2010-03-18 15:09:24 +0000 |
| commit | c934642bdb7e6747a20054d7cc7b079e69bc22c2 (patch) | |
| tree | 190d12bad5ed1cbabbd498d310f261c3a1c25bc9 /common | |
| parent | 30c84d2cff41924e6229d0cacd3d36ce1c2bf6ac (diff) | |
| download | scummvm-rg350-c934642bdb7e6747a20054d7cc7b079e69bc22c2.tar.gz scummvm-rg350-c934642bdb7e6747a20054d7cc7b079e69bc22c2.tar.bz2 scummvm-rg350-c934642bdb7e6747a20054d7cc7b079e69bc22c2.zip | |
COMMON: Move typedef StringList from str.h to new header str-array.h
This removes the dependency on array.h from str.h.
Also, begun migration from the confusing type name "StringList" to
the more appropriate StringArray.
svn-id: r48282
Diffstat (limited to 'common')
| -rw-r--r-- | common/config-manager.cpp | 2 | ||||
| -rw-r--r-- | common/config-manager.h | 2 | ||||
| -rw-r--r-- | common/savefile.h | 5 | ||||
| -rw-r--r-- | common/str-array.h | 49 | ||||
| -rw-r--r-- | common/str.h | 8 |
5 files changed, 54 insertions, 12 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 9d8281a748..5bb764bbb2 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -217,7 +217,7 @@ void ConfigManager::flushToDisk() { // First write the domains in _domainSaveOrder, in that order. // Note: It's possible for _domainSaveOrder to list domains which // are not present anymore. - StringList::const_iterator i; + Array<String>::const_iterator i; for (i = _domainSaveOrder.begin(); i != _domainSaveOrder.end(); ++i) { if (kApplicationDomain == *i) { writeDomain(*stream, *i, _appDomain); diff --git a/common/config-manager.h b/common/config-manager.h index 699774dfcd..68c6c4f5ee 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -159,7 +159,7 @@ private: Domain _keymapperDomain; #endif - StringList _domainSaveOrder; + Array<String> _domainSaveOrder; String _activeDomainName; Domain * _activeDomain; diff --git a/common/savefile.h b/common/savefile.h index d8d2dbc9c2..39be661b45 100644 --- a/common/savefile.h +++ b/common/savefile.h @@ -29,11 +29,12 @@ #include "common/noncopyable.h" #include "common/scummsys.h" #include "common/stream.h" -#include "common/str.h" +#include "common/str-array.h" #include "common/error.h" namespace Common { + /** * A class which allows game engines to load game state data. * That typically means "save games", but also includes things like the @@ -142,7 +143,7 @@ public: * @return list of strings for all present file names. * @see Common::matchString() */ - virtual StringList listSavefiles(const String &pattern) = 0; + virtual StringArray listSavefiles(const String &pattern) = 0; }; } // End of namespace Common diff --git a/common/str-array.h b/common/str-array.h new file mode 100644 index 0000000000..b8630bfadb --- /dev/null +++ b/common/str-array.h @@ -0,0 +1,49 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef COMMON_STRING_ARRAY_H +#define COMMON_STRING_ARRAY_H + +#include "common/array.h" +#include "common/str.h" + +namespace Common { + +/** + * An array of of strings. + */ +typedef Array<String> StringArray; + + +/** + * Alias for type StringArray. For backwards compatibility only. + * @deprecated Use StringArray instead! + */ +typedef StringArray StringList; + + +} // End of namespace Common + +#endif diff --git a/common/str.h b/common/str.h index 829348a870..0cdd3e8c10 100644 --- a/common/str.h +++ b/common/str.h @@ -26,7 +26,6 @@ #define COMMON_STRING_H #include "common/scummsys.h" -#include "common/array.h" namespace Common { @@ -320,13 +319,6 @@ bool matchString(const char *str, const char *pat, bool ignoreCase = false, bool /** - * A 'list' of strings. Actually, this is nowadays an array, and hence misnamed. - */ -typedef Array<String> StringList; - - - -/** * Take a 32 bit value and turn it into a four character string, where each of * the four bytes is turned into one character. Most significant byte is printed * first. |
