X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fexception.hpp;h=963f383588f52919b7515204d6198606170d50d3;hb=ab40ca3627fc4f5fe7a020a92fcdb925e108a7af;hp=8fb952e15f6a1577320c8ed724d0b1c84529544d;hpb=498a29bcc235aa3bd8999d73095df8b8cbb10413;p=m6w6%2Flibmemcached diff --git a/libmemcached/exception.hpp b/libmemcached/exception.hpp index 8fb952e1..963f3835 100644 --- a/libmemcached/exception.hpp +++ b/libmemcached/exception.hpp @@ -1,11 +1,8 @@ /* - * Drizzle Client & Protocol Library + * Summary: Exceptions for the C++ interface * - * Copyright (C) 2009 Patrick Galbraith (patg@patg.net) - * All rights reserved. + * Copy: See Copyright for the status of this software. * - * Use and distribution licensed under the BSD license. See - * the COPYING file in this directory for full text. */ /** @@ -19,35 +16,45 @@ #include -namespace memcache { - +namespace memcache +{ class Exception : public std::runtime_error { public: - Exception(const std::string& msg, bool errno) - : std::runtime_error(msg), _errno(errno) {} - Exception(const char *msg, bool errno) - : std::runtime_error(msg), _errno(errno) {} + Exception(const std::string& msg, bool in_errno) + : + std::runtime_error(msg), + errno(in_errno) + {} + + Exception(const char *msg, bool in_errno) + : + std::runtime_error(msg), + errno(in_errno) {} + virtual ~Exception() throw() {} - int getErrno() const { return _errno; } - private: - int _errno; + int getErrno() const + { + return errno; + } + private: + int errno; }; class Warning : public Exception { public: - Warning(const std::string& msg, bool errno) : Exception(msg, errno) {} - Warning(const char *msg, bool errno) : Exception(msg, errno) {} + Warning(const std::string& msg, bool in_errno) : Exception(msg, in_errno) {} + Warning(const char *msg, bool in_errno) : Exception(msg, in_errno) {} }; class Error : public Exception { public: - Error(const std::string& msg, bool errno) : Exception(msg, errno) {} - Error(const char *msg, bool errno) : Exception(msg, errno) {} + Error(const std::string& msg, bool in_errno) : Exception(msg, in_errno) {} + Error(const char *msg, bool in_errno) : Exception(msg, in_errno) {} virtual ~Error() throw() {} };