1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
9 #ifndef anna_http_parser_Abstract_hpp
10 #define anna_http_parser_Abstract_hpp
12 #include <anna/config/defines.hpp>
13 #include <anna/core/define.autoenum.hpp>
14 #include <anna/core/RuntimeException.hpp>
31 enum _v { None = -1, WaitMessage, ReadHeader, WaitEndOfHeader, WaitChunkSize, ReadChunkSize, ReadChunkData, ReadChunkTrailers };
32 anna_declare_enum(ClassType)
36 Abstract(const ClassType::_v classType) : a_classType(classType) {;}
38 static void setState(Transport&, const ClassType::_v) throw();
39 static void setLastChunkedByte(Transport&, const int lastChunkedByte) throw();
40 static const DataBlock& getFullMessage(Transport&) throw();
41 static void appendExtraParameter(Message*, const std::string& extraParameter) throw();
43 virtual int processLine(Transport&, const DataBlock&, const Token& line) const throw(RuntimeException) = 0;
46 const ClassType::_v a_classType;
48 ClassType::_v getClassType() const throw() { return a_classType; }
49 std::string asString() const throw();
51 friend class http::Transport;