HttpParser.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* -*- C++ -*- */
  2. /****************************************************************************
  3. ** Copyright (c) 2001-2014
  4. **
  5. ** This file is part of the QuickFIX FIX Engine
  6. **
  7. ** This file may be distributed under the terms of the quickfixengine.org
  8. ** license as defined by quickfixengine.org and appearing in the file
  9. ** LICENSE included in the packaging of this file.
  10. **
  11. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  12. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  13. **
  14. ** See http://www.quickfixengine.org/LICENSE for licensing information.
  15. **
  16. ** Contact ask@quickfixengine.org if any conditions of this licensing are
  17. ** not clear to you.
  18. **
  19. ****************************************************************************/
  20. #ifndef FIX_HTTPPARSER_H
  21. #define FIX_HTTPPARSER_H
  22. #ifdef _MSC_VER
  23. #pragma warning( disable : 4503 4355 4786 4290 )
  24. #endif
  25. #include "Exceptions.h"
  26. #include <iostream>
  27. #include <string>
  28. namespace FIX
  29. {
  30. /// Parses HTTP messages off an input stream.
  31. class HttpParser
  32. {
  33. public:
  34. HttpParser() {}
  35. ~HttpParser() {}
  36. bool readHttpMessage( std::string& str )
  37. throw ( MessageParseError );
  38. void addToStream( const char* str, size_t len )
  39. { m_buffer.append( str, len ); }
  40. void addToStream( const std::string& str )
  41. { m_buffer.append( str ); }
  42. private:
  43. std::string m_buffer;
  44. };
  45. }
  46. #endif //FIX_HTTPPARSER_H