Mercurial > archived > louis > epitech > zia-api
changeset 37:a396ce2684cd
Define each handler status return
author | daedric <d43dr1c@gmail.com> |
---|---|
date | Sun, 21 Mar 2010 18:30:02 +0100 |
parents | e141b74019e1 |
children | 75e8a504028e ed739a5746d3 |
files | src/include/handler/IBodyHandler.hpp src/include/handler/IHandler.hpp src/include/handler/IHeaderHandler.hpp |
diffstat | 3 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/include/handler/IBodyHandler.hpp Sun Mar 21 17:35:56 2010 +0100 +++ b/src/include/handler/IBodyHandler.hpp Sun Mar 21 18:30:02 2010 +0100 @@ -31,10 +31,11 @@ * @param [in] transac the transation associated with streams. * @param [in] is the input stream * @param [in] os the output stream - * @return an integer TODO define an enum XXX + * @return an ECode * @see ITransaction + * @see ECode */ - virtual int operator()(zia::api::http::ITransaction & transac, std::istream & is, std::ostream & os) = 0; + virtual ECode operator()(zia::api::http::ITransaction & transac, std::istream & is, std::ostream & os) = 0; };
--- a/src/include/handler/IHandler.hpp Sun Mar 21 17:35:56 2010 +0100 +++ b/src/include/handler/IHandler.hpp Sun Mar 21 18:30:02 2010 +0100 @@ -26,6 +26,17 @@ }; /** + * @brief This enum represents the values that each handler can return. + */ +enum ECode +{ + Ok, /**<It works !*/ + Decline, /**<Not treatment performed */ + ClientError, /**<Client error, module must have set the correct error code in the response headers */ + ServerError /**<Server error, module must have set the correct error code in the response headers */ +}; + +/** * @brief This class represent the interface which all handler has to respect */ class IHandler
--- a/src/include/handler/IHeaderHandler.hpp Sun Mar 21 17:35:56 2010 +0100 +++ b/src/include/handler/IHeaderHandler.hpp Sun Mar 21 18:30:02 2010 +0100 @@ -27,8 +27,9 @@ /** ** @brief method called by the server. ** @param [in] transac the transation associated with streams. - ** @return an integer TODO define an enum XXX + ** @return an ECode ** @see ITransaction + ** @see ECode */ virtual int operator()(zia::api::http::ITransaction & transac) = 0;