Remove dynamic exceptions
[anna.git] / include / anna / http / internal / Token.hpp
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_internal_Token_hpp
10 #define anna_http_internal_Token_hpp
11
12 #include <string>
13
14 #include <anna/core/DataBlock.hpp>
15
16 namespace anna {
17
18 namespace http {
19
20 class Token : public DataBlock {
21 public:
22   Token() : DataBlock(false) {;}
23
24   const std::string& getStringValue() const ;
25   int getIntegerValue() const ;
26   bool contains(const char byte) const ;
27
28   void setValue(const char* content, const int size) {
29     setBuffer(content);
30     setSize(size);
31   }
32   bool match(const char* str) const ;
33   int calculeOffset(const DataBlock& base) const noexcept(false);
34
35 private:
36   std::string a_aux;
37 };
38
39 }
40 }
41
42 #endif