summaryrefslogtreecommitdiff
path: root/klm/util/exception.cc
diff options
context:
space:
mode:
authorKenneth Heafield <kheafiel@cluster10.lti.ece.cmu.local>2011-03-09 13:40:23 -0500
committerKenneth Heafield <kheafiel@cluster10.lti.ece.cmu.local>2011-03-09 13:40:23 -0500
commit6c923d45f2aaf960806429d36ca58a41b3a39740 (patch)
tree9d8c5bf26189e9e8e6c12c199a5925c5ca6046a9 /klm/util/exception.cc
parent95ea293005f74a627fdd2aae318d5746fa8c4e6c (diff)
kenlm sync
Diffstat (limited to 'klm/util/exception.cc')
-rw-r--r--klm/util/exception.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/klm/util/exception.cc b/klm/util/exception.cc
index de6dd43c..077405f4 100644
--- a/klm/util/exception.cc
+++ b/klm/util/exception.cc
@@ -8,6 +8,20 @@ namespace util {
Exception::Exception() throw() {}
Exception::~Exception() throw() {}
+Exception::Exception(const Exception &from) : std::exception() {
+ stream_.str(from.stream_.str());
+}
+
+Exception &Exception::operator=(const Exception &from) {
+ stream_.str(from.stream_.str());
+ return *this;
+}
+
+const char *Exception::what() const throw() {
+ text_ = stream_.str();
+ return text_.c_str();
+}
+
namespace {
// The XOPEN version.
const char *HandleStrerror(int ret, const char *buf) {
@@ -16,7 +30,7 @@ const char *HandleStrerror(int ret, const char *buf) {
}
// The GNU version.
-const char *HandleStrerror(const char *ret, const char *buf) {
+const char *HandleStrerror(const char *ret, const char * /*buf*/) {
return ret;
}
} // namespace