22 #ifndef __CmdResourceHandlers_h__
23 #define __CmdResourceHandlers_h__
39 class RedirectHandlerNode;
40 class ResourceHandlerNode;
46 RedirectHandler(
const std::string& urlRe,
const std::string& appId,
bool schemeform,
const std::string& handler_tag);
50 const std::string&
urlRe()
const {
return m_urlRe; }
51 const std::string&
appId()
const {
return m_appId; }
52 bool matches(
const std::string& url)
const;
55 bool addVerb(
const std::string& verb,
const std::string& jsonizedParams);
60 return ((m_urlRe == c.m_urlRe) && (m_appId == c.m_appId));
64 return ((m_urlRe != c.m_urlRe) || (m_appId != c.m_appId));
66 bool equals(
const std::string& url,
const std::string& appId)
68 return ((m_urlRe == url) && (m_appId == appId));
76 bool valid()
const {
return m_valid;}
80 const std::string&
tag()
const {
return m_tag; }
81 void setTag(
const std::string& newtag) { m_tag = newtag;}
82 uint32_t
index() {
return m_index; }
83 uint32_t
setIndex(uint32_t newindex) { uint32_t t = m_index; m_index = newindex;
return t;}
86 struct json_object *
toJson();
88 const std::map<std::string,std::string>&
verbs() {
return m_verbs;}
99 std::map<std::string,std::string> m_verbs;
112 const std::string&
appId,
115 const std::string& contentType,
116 const std::string& appId,
118 const std::string& handler_tag);
128 return ((m_fileExt == c.m_fileExt) && (m_contentType == c.m_contentType) && (m_appId == c.m_appId) && (m_stream == c.m_stream));
133 return ((m_fileExt != c.m_fileExt) || (m_contentType != c.m_contentType) || (m_appId != c.m_appId) || (m_stream != c.m_stream));
136 bool match(
const std::string& extension,
const std::string& appId,
const std::string& mimeType,
bool stream)
const
138 return ((m_fileExt == extension) && (m_contentType == mimeType) && (m_appId == appId) && (m_stream == stream));
140 bool match(
const std::string& extension,
const std::string& appId,
const std::string& mimeType)
const
142 return ((m_fileExt == extension) && (m_contentType == mimeType) && (m_appId == appId));
144 bool match(
const std::string& appId,
const std::string& mimeType)
const
146 return ((m_contentType == mimeType) && (m_appId == appId));
149 const std::string&
appId()
const {
return m_appId; }
150 const std::string&
fileExt()
const {
return m_fileExt; }
152 const std::string&
tag()
const {
return m_tag; }
153 void setTag(
const std::string& newtag) { m_tag = newtag;}
154 uint32_t
index() {
return m_index; }
155 uint32_t
setIndex(uint32_t newindex) { uint32_t t = m_index; m_index = newindex;
return t;}
162 bool addVerb(
const std::string& verb,
const std::string& jsonizedParams);
166 struct json_object *
toJson();
168 const std::map<std::string,std::string>&
verbs() {
return m_verbs;}
171 std::string m_fileExt;
172 std::string m_contentType;
178 std::map<std::string,std::string> m_verbs;