view include/http/IRequest.hpp @ 41:7c8cd74023ce

Rework file layout, fix build, add README and SUPPORT
author Louis Opter <kalessin@kalessin.fr>
date Mon, 22 Mar 2010 02:08:24 +0100
parents src/include/http/IRequest.hpp@cd9942c3faaa
children dad671a5f028
line wrap: on
line source

#ifndef __ZIA_API_REQUEST_HPP__
# define __ZIA_API_REQUEST_HPP__

# include <string>

# include "http/IHeader.hpp"

namespace   zia
{
    namespace   api
    {
        namespace   http
        {
            /**
             * @brief Interface to represent the request received.
             *
             * @see IHeader
             * @see IResponse
             */
            class   IRequest
            {

            public:

                virtual ~IRequest(void) { }

                /**
                 * @brief Get method used.
                 *
                 * @return The name of method.
                 */
                virtual const std::string & getMethod(void) const = 0;
                virtual void                setMethod(const std::string &) = 0;

                /**
                 * @brief Get the uri requested.
                 *
                 * @return The URI.
                 */
                virtual const std::string & getUri(void) const = 0;

                /**
                 * @brief Set the uri requested.
                 *
                 * @param [in] uri The new uri.
                 */
                virtual void                setUri(const std::string & uri) = 0;

                /**
                 * @brief Get the HTTP version.
                 *
                 * It has to be like: '1.1', '1.0' ...
                 */
                virtual const std::string & getVersion(void) const = 0;

                /**
                 * @brief Set the HTTP version.
                 *
                 * @param [in] v The HTTP version to set it has to be like:
                 * 'X.X' where X is a digit.
                 */
                virtual void                setVersion(const std::string & v) = 0;

                /**
                 * @brief Get HTTP header.
                 *
                 * @return The http header.
                 *
                 * @see IHeader
                 */
                virtual const IHeader &     getHeaders(void) const = 0;

                /**
                 * @brief Get HTTP header.
                 *
                 * @return the http header.
                 *
                 * @see IHeader
                 */
                virtual IHeader &           getHeaders(void) = 0;
            };
        };
    };
};

#endif	/* ! __ZIA_API_REQUEST_HPP__ */