diff options
author | Max Horn | 2002-09-09 11:42:24 +0000 |
---|---|---|
committer | Max Horn | 2002-09-09 11:42:24 +0000 |
commit | 22e2df20c2aeb78c9b7bac513aa0d45e75faa433 (patch) | |
tree | d1c77230407c7f4a537321ce6509f26638f9cafe /common/str.h | |
parent | f277bb9fcd853dc1d647467a38bc49fc51d28543 (diff) | |
download | scummvm-rg350-22e2df20c2aeb78c9b7bac513aa0d45e75faa433.tar.gz scummvm-rg350-22e2df20c2aeb78c9b7bac513aa0d45e75faa433.tar.bz2 scummvm-rg350-22e2df20c2aeb78c9b7bac513aa0d45e75faa433.zip |
added String constructor which takes (and clones) a ConstString
svn-id: r4918
Diffstat (limited to 'common/str.h')
-rw-r--r-- | common/str.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/str.h b/common/str.h index fdcd70a154..b35c42d0e5 100644 --- a/common/str.h +++ b/common/str.h @@ -39,13 +39,14 @@ namespace ScummVM { */ class ConstString { + friend class String; protected: char *_str; int _len; public: ConstString() : _str(0), _len(0) {} - ConstString(const char *str) : _str((char*)str) { _len = str ? strlen(str) : 0;} + ConstString(const char *str) : _str((char*)str) { _len = str ? strlen(str) : 0; } virtual ~ConstString() {} bool operator ==(const ConstString& x) const; @@ -71,6 +72,7 @@ protected: public: String() : _capacity(0) { _refCount = new int(1); } String(const char *str); + String(const ConstString &str); String(const String &str); virtual ~String(); |