-rw-r--r-- | include/sitecing/exception.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sitecing/exception.h b/include/sitecing/exception.h index 857a8e6..ccc7edd 100644 --- a/include/sitecing/exception.h +++ b/include/sitecing/exception.h @@ -1,268 +1,271 @@ #ifndef __SITECING_EXCEPTION_H #define __SITECING_EXCEPTION_H +#include <string> + /** * @file * @brief The site-C-ing specific exceptions. */ /** * @brief The main site-C-ing namespace. */ namespace sitecing { + using std::string; // TODO: status specifics /** * The http status to return. */ class http_status { public: /** * The status string. */ string status; /** * The message to follow the status string. */ string message; /** * @param s HTTP status. * @param m HTTP status message. */ http_status(const string& s,const string& m) : status(s), message(m) { } virtual ~http_status() throw() { } }; // per RFC 2616 /** * Informational. */ class http_status_1xx : public http_status { public: /** * @param s HTTP status * @param m HTTP status message */ explicit http_status_1xx(const string &s,const string& m) : http_status(s,m) { } }; /** * Continue. */ class http_status_100 : public http_status_1xx { public: /** * @param m HTTP status message */ explicit http_status_100(const string& m) : http_status_1xx("100",m) { } explicit http_status_100() : http_status_1xx("100","Continue") { } }; /** * Switching protocols. */ class http_status_101 : public http_status_1xx { public: /** * @param m HTTP status message */ explicit http_status_101(const string& m) : http_status_1xx("101",m) { } explicit http_status_101() : http_status_1xx("101","Switching protocols") { } }; /** * Successful. */ class http_status_2xx : public http_status { public: /** * @param s HTTP status message * @param m HTTP status message */ explicit http_status_2xx(const string& s,const string& m) : http_status(s,m) { } }; /** * OK. */ class http_status_200 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_200(const string& m) : http_status_2xx("200",m) { } explicit http_status_200() : http_status_2xx("200","OK") { } }; /** * Created. */ class http_status_201 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_201(const string& m) : http_status_2xx("201",m) { } explicit http_status_201() : http_status_2xx("201","Created") { } }; /** * Accepted. */ class http_status_202 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_202(const string& m) : http_status_2xx("202",m) { } explicit http_status_202() : http_status_2xx("202","Accepted") { } }; /** * Non-authoritative infortmation. */ class http_status_203 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_203(const string& m) : http_status_2xx("203",m) { } explicit http_status_203() : http_status_2xx("203","Non-authoritative information") { } }; /** * No content. */ class http_status_204 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_204(const string& m) : http_status_2xx("204",m) { } explicit http_status_204() : http_status_2xx("204","No content") { } }; /** * Reset content. */ class http_status_205 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_205(const string& m) : http_status_2xx("205",m) { } explicit http_status_205() : http_status_2xx("205","Reset content") { } }; /** * Partial content. */ class http_status_206 : public http_status_2xx { public: /** * @param m HTTP status message */ explicit http_status_206(const string& m) : http_status_2xx("206",m) { } explicit http_status_206() : http_status_2xx("206","Partial content") { } }; /** * Redirection. */ class http_status_3xx : public http_status { public: /** * @param s HTTP status * @param m HTTP status message */ explicit http_status_3xx(const string& s,const string& m) : http_status(s,m) { } }; /** * Multiple choices. */ class http_status_300 : public http_status_3xx { public: /** * @param m HTTP status message */ explicit http_status_300(const string& m) : http_status_3xx("300",m) { } explicit http_status_300() : http_status_3xx("300","Multiple choices") { } }; /** * Moved permanently. */ class http_status_301 : public http_status_3xx { public: /** * @param m HTTP status message */ explicit http_status_301(const string& m) : http_status_3xx("301",m) { } explicit http_status_301() : http_status_3xx("301","Moved permanently") { } }; /** * Found. */ class http_status_302 : public http_status_3xx { public: /** * @param m HTTP status message */ explicit http_status_302(const string& m) : http_status_3xx("302",m) { } explicit http_status_302() : http_status_3xx("302","Found") { } }; /** * See other. */ class http_status_303 : public http_status_3xx { public: /** * @param m HTTP status message */ explicit http_status_303(const string& m) : http_status_3xx("303",m) { } explicit http_status_303() : http_status_3xx("303","See other") { } }; /** * Not modified. */ class http_status_304 : public http_status_3xx { public: /** * @param m HTTP status message */ explicit http_status_304(const string& m) : http_status_3xx("304",m) { } explicit http_status_304() : http_status_3xx("304","Not modified") { } }; /** * Use proxy. */ class http_status_305 : public http_status_3xx { public: /** * @param m HTTP status message */ |