libmoost
/home/mhx/git/github/libmoost/include/moost/murcl/uri_scheme.hpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00037 #ifndef FM_LAST_MOOST_MURCL_URI_SCHEME_HPP__
00038 #define FM_LAST_MOOST_MURCL_URI_SCHEME_HPP__
00039 
00040 #include <string>
00041 
00042 namespace moost { namespace murcl {
00043 
00047 class uri_scheme
00048 {
00049 public:
00053    struct port
00054    {
00055       enum {
00056          HTTP = 80
00057          // add more as required
00058       };
00059    };
00060 
00067    std::string const & get() const
00068    {
00069       return scheme_;
00070    }
00071 
00078    int get_port() const
00079    {
00080       return port_;
00081    }
00082 
00083 protected:
00084    uri_scheme(
00085       std::string const & scheme,
00086       int port
00087       )
00088       : scheme_(scheme)
00089       , port_(port)
00090    {
00091    }
00092 
00093 private:
00094    std::string scheme_;
00095    int port_;
00096 };
00097 
00098 struct http_scheme : uri_scheme
00099 {
00106    http_scheme(int port = uri_scheme::port::HTTP)
00107       : uri_scheme("http://", port)
00108    {
00109    }
00110 };
00111 
00112 }}
00113 
00114 
00115 #endif // FM_LAST_MOOST_MURCL_URI_HPP__