| 1 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 2 | // Zen Enterprise Framework |
|---|
| 3 | // |
|---|
| 4 | // Copyright (C) 2001 - 2008 Tony Richards |
|---|
| 5 | // Copyright (C) 2008 - 2009 Matthew Alan Gray |
|---|
| 6 | // |
|---|
| 7 | // This software is provided 'as-is', without any express or implied |
|---|
| 8 | // warranty. In no event will the authors be held liable for any damages |
|---|
| 9 | // arising from the use of this software. |
|---|
| 10 | // |
|---|
| 11 | // Permission is granted to anyone to use this software for any purpose, |
|---|
| 12 | // including commercial applications, and to alter it and redistribute it |
|---|
| 13 | // freely, subject to the following restrictions: |
|---|
| 14 | // |
|---|
| 15 | // 1. The origin of this software must not be misrepresented; you must not |
|---|
| 16 | // claim that you wrote the original software. If you use this software |
|---|
| 17 | // in a product, an acknowledgment in the product documentation would be |
|---|
| 18 | // appreciated but is not required. |
|---|
| 19 | // 2. Altered source versions must be plainly marked as such, and must not be |
|---|
| 20 | // misrepresented as being the original software. |
|---|
| 21 | // 3. This notice may not be removed or altered from any source distribution. |
|---|
| 22 | // |
|---|
| 23 | // Tony Richards trichards@indiezen.com |
|---|
| 24 | // Matthew Alan Gray mgray@indiezen.org |
|---|
| 25 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 26 | #ifndef ZEN_ENTERPRISE_APPSERVER_XML_REQUEST_PARSER_HPP_INCLUDED |
|---|
| 27 | #define ZEN_ENTERPRISE_APPSERVER_XML_REQUEST_PARSER_HPP_INCLUDED |
|---|
| 28 | |
|---|
| 29 | #include <Zen/Core/Memory/managed_ptr.hpp> |
|---|
| 30 | |
|---|
| 31 | #include <boost/spirit/include/classic_core.hpp> |
|---|
| 32 | #include <boost/spirit/include/classic_scanner.hpp> |
|---|
| 33 | #include <boost/logic/tribool.hpp> |
|---|
| 34 | #include <boost/tuple/tuple.hpp> |
|---|
| 35 | #include <boost/array.hpp> |
|---|
| 36 | |
|---|
| 37 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 38 | namespace Zen { |
|---|
| 39 | namespace Enterprise { |
|---|
| 40 | namespace AppServer { |
|---|
| 41 | class I_Request; |
|---|
| 42 | namespace XML { |
|---|
| 43 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 44 | |
|---|
| 45 | class RequestHandler; |
|---|
| 46 | |
|---|
| 47 | class RequestParser |
|---|
| 48 | { |
|---|
| 49 | /// @name Types |
|---|
| 50 | /// @{ |
|---|
| 51 | public: |
|---|
| 52 | //typedef Memory::managed_ptr<I_Request> pRequest_type; |
|---|
| 53 | |
|---|
| 54 | typedef char char_t; |
|---|
| 55 | typedef boost::array<char, 8192>::iterator iterator_t; |
|---|
| 56 | typedef boost::spirit::classic::scanner<iterator_t> scanner_t; |
|---|
| 57 | typedef boost::spirit::classic::rule<scanner_t> rule_t; |
|---|
| 58 | /// @} |
|---|
| 59 | |
|---|
| 60 | /// @name RequestParser implementation |
|---|
| 61 | /// @{ |
|---|
| 62 | public: |
|---|
| 63 | void parse(RequestHandler* _pHandler, iterator_t _begin, iterator_t _end); |
|---|
| 64 | /// @} |
|---|
| 65 | |
|---|
| 66 | /// @name 'Structors |
|---|
| 67 | /// @{ |
|---|
| 68 | public: |
|---|
| 69 | RequestParser(); |
|---|
| 70 | virtual ~RequestParser(); |
|---|
| 71 | /// @} |
|---|
| 72 | |
|---|
| 73 | }; // class RequestParser |
|---|
| 74 | |
|---|
| 75 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 76 | } // namespace XML |
|---|
| 77 | } // namespace AppServer |
|---|
| 78 | } // namespace Enterprise |
|---|
| 79 | } // namespace Zen |
|---|
| 80 | //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | #endif // ZEN_ENTERPRISE_APPSERVER_XML_REQUEST_PARSER_HPP_INCLUDED |
|---|