CppCMS
cppcms/http_content_type.h
00001 
00002 //                                                                             
00003 //  Copyright (C) 2008-2012  Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>     
00004 //                                                                             
00005 //  See accompanying file COPYING.TXT file for licensing details.
00006 //
00008 #ifndef CPPCMS_HTTP_CONTENT_TYPE_H
00009 #define CPPCMS_HTTP_CONTENT_TYPE_H
00010 
00011 #include <cppcms/defs.h>
00012 #include <booster/shared_ptr.h>
00013 #include <string>
00014 #include <map>
00015 
00016 namespace cppcms { namespace http {
00017 
00018 
00023 class CPPCMS_API content_type {
00024 public:
00028         std::string type() const;
00032         std::string subtype() const;
00036         std::string media_type() const;
00041         std::string charset() const;
00045         std::map<std::string,std::string> parameters() const;
00049         std::string parameter_by_key(std::string const &key) const;
00053         bool parameter_is_set(std::string const &key) const;
00054 
00058         content_type(std::string const &ct);
00062         content_type(char const *ct);
00066         content_type(char const *begin,char const *end);
00070         content_type();
00074         content_type(content_type const &);
00078         content_type const &operator=(content_type const &);
00082         ~content_type();
00083 private:
00084         struct data;
00085         void parse(char const *b,char const *e);
00086         booster::shared_ptr<data> d;
00087 };
00088 
00089 
00090 } } //::cppcms::http
00091 
00092 
00093 #endif