[Scummvm-cvs-logs] CVS: scummvm/common str.cpp,1.30,1.31 str.h,1.21,1.22
Max Horn
fingolfin at users.sourceforge.net
Sun Jun 27 16:59:02 CEST 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.131,1.132 bomp.cpp,2.19,2.20 bomp.h,2.8,2.9
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.225,1.226 script_v8.cpp,2.252,2.253
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4825
Modified Files:
str.cpp str.h
Log Message:
Added operator + for strings
Index: str.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- str.cpp 25 Mar 2004 11:25:50 -0000 1.30
+++ str.cpp 27 Jun 2004 23:58:41 -0000 1.31
@@ -255,6 +255,28 @@
return (x <= *this);
}
+#pragma mark -
+
+String operator +(const String &x, const String &y) {
+ String temp(x);
+ temp += y;
+ return temp;
+}
+
+String operator +(const char *x, const String &y) {
+ String temp(x);
+ temp += y;
+ return temp;
+}
+
+String operator +(const String &x, const char *y) {
+ String temp(x);
+ temp += y;
+ return temp;
+}
+
+#pragma mark -
+
bool operator == (const char* y, const ConstString &x) {
return (x == y);
}
Index: str.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- str.h 9 Apr 2004 15:10:22 -0000 1.21
+++ str.h 27 Jun 2004 23:58:41 -0000 1.22
@@ -122,6 +122,11 @@
void decRefCount();
};
+// Append two strings to form a new (temp) string
+String operator +(const String &x, const String &y);
+String operator +(const char *x, const String &y);
+String operator +(const String &x, const char *y);
+
// Some useful additional comparision operators for Strings
bool operator == (const char *x, const ConstString &y);
bool operator != (const char *x, const ConstString &y);
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.131,1.132 bomp.cpp,2.19,2.20 bomp.h,2.8,2.9
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.225,1.226 script_v8.cpp,2.252,2.253
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list