ANNA Suite  2020b
Multipurpose development suite for Telco applications
ServerSide.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_http_wims20_ServerSide_hpp
10 #define anna_http_wims20_ServerSide_hpp
11 
14 
16 
17 namespace anna {
18 
19 namespace http {
20 
21 class Request;
22 
23 namespace wims20 {
24 
48 class ServerSide : public Abstract {
49 public:
56  ServerSide(const std::string& domain, const std::string& path) :
57  Abstract("ServerSide", domain, path) {
58  for(int ii = 0; ii < SplitCode::Max; ii ++)
59  a_tokenizer [ii].activateStrip(true);
60  }
61 
67  explicit ServerSide(const std::string& domain) :
68  Abstract("ServerSide", domain) {
69  for(int ii = 0; ii < SplitCode::Max; ii ++)
70  a_tokenizer [ii].activateStrip(true);
71  }
72 
80  const std::string* getValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false);
81 
89  const char* getCStringValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false);
90 
98  int getIntegerValue(const char* name, const Exception::Mode::_v mode = Exception::Mode::Throw) const noexcept(false);
99 
106  void decode(const http::Request& request) noexcept(false);
107 
108 private:
109  struct SplitCode { enum _v { HierarchyAndParameter, HierarchyItem, Parameters, ParameterAndArgument, Max }; };
110 
111  void decodeHierarchy(const std::string& hierarchy) noexcept(false);
112  void decodeParameters(const std::string& parameters) noexcept(false);
113 
114  const Tokenizer& split(const SplitCode::_v splitZone, const std::string&) noexcept(false);
115 
116  anna::Tokenizer a_tokenizer [SplitCode::Max];
117 };
118 
119 }
120 }
121 }
122 
123 #endif
Definition: Exception.hpp:26
_v
Definition: Exception.hpp:26
Definition: Request.hpp:22
Definition: ServerSide.hpp:48
Definition: Abstract.hpp:46
ServerSide(const std::string &domain, const std::string &path)
Definition: ServerSide.hpp:56
Definition: Tokenizer.hpp:22
int getIntegerValue(const char *name, const Exception::Mode::_v mode=Exception::Mode::Throw) const noexcept(false)
Definition: Tokenizer.hpp:23
const std::string * getValue(const char *name, const Exception::Mode::_v mode=Exception::Mode::Throw) const noexcept(false)
void decode(const http::Request &request) noexcept(false)
const char * getCStringValue(const char *name, const Exception::Mode::_v mode=Exception::Mode::Throw) const noexcept(false)
Definition: app.hpp:12
ServerSide(const std::string &domain)
Definition: ServerSide.hpp:67