Changeset 1215
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SVN.cc
r1214 r1215 38 38 #include <subversion-1/svn_subst.h> 39 39 40 #include <sstream> 41 #include <string> 42 40 43 namespace theplu { 41 44 namespace svndigest { 45 46 47 SVNException::SVNException(const std::string& msg, svn_error_t* error) 48 : std::runtime_error(""), error_(error), msg_(msg) {} 49 50 51 SVNException::~SVNException(void) throw() {} 52 53 54 const char* SVNException::what(void) const throw() 55 { 56 std::stringstream ss; 57 if (error_) { 58 apr_size_t bufsize=255; 59 char buf[255]; 60 ss << svn_err_best_message(error_, buf, bufsize); 61 } 62 if (msg_.size()) { 63 ss << msg_; 64 } 65 66 return ss.str().c_str(); 67 } 68 69 70 const svn_error_t* SVNException::error(void) const 71 { 72 return error_; 73 } 42 74 43 75 -
trunk/lib/SVN.h
r978 r1215 50 50 /// 51 51 struct SVNException : public std::runtime_error 52 { inline SVNException(const std::string& msg) : runtime_error(msg) {} }; 52 { 53 SVNException(const std::string& msg, svn_error_t* error=NULL); 54 55 virtual ~SVNException(void) throw(); 56 /** 57 override base implementation 58 */ 59 const char* what(void) const throw(); 60 61 /** 62 access svn_error_t 63 */ 64 const svn_error_t* error(void) const; 65 private: 66 svn_error_t* error_; 67 std::string msg_; 68 }; 53 69 54 70 /**
Note: See TracChangeset
for help on using the changeset viewer.