src/str.cc

changeset 82
841562f5a32f
parent 79
2425fa6a4f21
child 85
264a61e9eba0
--- a/src/str.cc	Sat Jan 18 02:11:45 2014 +0200
+++ b/src/str.cc	Sun Jan 19 20:16:00 2014 +0200
@@ -297,7 +297,7 @@
 
 // =============================================================================
 //
-string string::operator+ (const string data) const
+string string::operator+ (const string& data) const
 {
     string newString = *this;
     newString += data;
@@ -315,6 +315,17 @@
 
 // =============================================================================
 //
+string string::operator+ (int num) const
+{
+	string newstr = *this;
+	string numstr;
+	numstr.sprintf ("%d", num);
+	newstr += numstr;
+	return newstr;
+}
+
+// =============================================================================
+//
 string& string::operator+= (const string data)
 {
     append (data);
@@ -331,6 +342,15 @@
 
 // =============================================================================
 //
+string& string::operator+= (int num)
+{
+	string numstr;
+	numstr.sprintf ("%d", num);
+	return operator+= (numstr);
+}
+
+// =============================================================================
+//
 bool string::is_numeric() const
 {
     bool gotDot = false;

mercurial