[Scummvm-cvs-logs] CVS: scummvm/common str.cpp,1.23,1.24 str.h,1.15,1.16
Max Horn
fingolfin at users.sourceforge.net
Wed Oct 8 14:03:05 CEST 2003
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv27769
Modified Files:
str.cpp str.h
Log Message:
add String::lastChar() method
Index: str.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- str.cpp 6 Oct 2003 23:19:01 -0000 1.23
+++ str.cpp 8 Oct 2003 21:01:50 -0000 1.24
@@ -140,6 +140,10 @@
return *this;
}
+char lastChar() const {
+ return (_len > 0) ? _str[_len-1] : 0;
+}
+
void String::deleteLastChar() {
if (_len > 0) {
ensureCapacity(_len - 1, true);
Index: str.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- str.h 6 Oct 2003 23:19:01 -0000 1.15
+++ str.h 8 Oct 2003 21:01:50 -0000 1.16
@@ -108,6 +108,7 @@
return _str[idx];
}
+ char lastChar() const;
void deleteLastChar();
void deleteChar(int p);
void clear();
More information about the Scummvm-git-logs
mailing list