HCoop
/
clinton
/
bobotpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove String->const char* conversion operator in favor of c_str method
[clinton/bobotpp.git]
/
source
/
String.C
diff --git
a/source/String.C
b/source/String.C
index
d60d0d5
..
05acdff
100644
(file)
--- a/
source/String.C
+++ b/
source/String.C
@@
-17,13
+17,16
@@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "String.H"
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "String.H"
-#include "Utils.H"
-#include <cstring>
-#include <cctype>
#include <sstream>
#include <iostream>
#include <sstream>
#include <iostream>
+#include <cstdlib>
+#include <cstring>
+#include <cctype>
+
+#include "Utils.H"
+
String::String()
{
}
String::String()
{
}
@@
-189,7
+192,7
@@
String::operator[](int i_) const
if (i < 0 || my_string.length () < i) {
std::cerr << "String index out of range\n";
if (i < 0 || my_string.length () < i) {
std::cerr << "String index out of range\n";
- exit(1);
+
std::
exit(1);
}
return my_string[i];
}
}
return my_string[i];
}
@@
-289,10
+292,11
@@
String::operator+(const std::string & s)
return my_string + s;
}
return my_string + s;
}
-String::operator const char *() const
-{
- return my_string.c_str ();
-}
+const char*
+String::c_str () const
+ {
+ return my_string.c_str ();
+ }
String::operator std::string () const
{
String::operator std::string () const
{