Index Source Files Annotated Class List Alphabetical Class List Class Hierarchy Graphical Class Hierarchy

# HttpParser.h

Go to the documentation of this file.

    00001 /* -*- C++ -*- */
    00002
    00003 /****************************************************************************
    00004 ** Copyright (c) quickfixengine.org  All rights reserved.
    00005 **
    00006 ** This file is part of the QuickFIX FIX Engine
    00007 **
    00008 ** This file may be distributed under the terms of the quickfixengine.org
    00009 ** license as defined by quickfixengine.org and appearing in the file
    00010 ** LICENSE included in the packaging of this file.
    00011 **
    00012 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    00013 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    00014 **
    00015 ** See http://www.quickfixengine.org/LICENSE for licensing information.
    00016 **
    00017 ** Contact ask@quickfixengine.org if any conditions of this licensing are
    00018 ** not clear to you.
    00019 **
    00020 ****************************************************************************/
    00021
    00022 #ifndef FIX_HTTPPARSER_H
    00023 #define FIX_HTTPPARSER_H
    00024
    00025 #ifdef _MSC_VER
    00026 #pragma warning( disable : 4503 4355 4786 4290 )
    00027 #endif
    00028
    00029 #include "Exceptions.h"
    00030 #include <iostream>
    00031 #include <string>
    00032
    00033 namespace FIX
    00034 {
    00036 class HttpParser
    00037 {
    00038 public:
    00039   HttpParser()
    00040   : m_bufferSize( 0 ) {}
    00041   ~HttpParser() {}
    00042
    00043   bool readHttpMessage( std::string& str )
    00044   throw ( MessageParseError );
    00045
    00046   void addToStream( const char* str, size_t len )
    00047   { m_buffer.append( str, len ); }
    00048   void addToStream( const std::string& str )
    00049   { m_buffer.append( str ); }
    00050
    00051 private:
    00052   std::string m_buffer;
    00053   int m_bufferSize;
    00054 };
    00055 }
    00056 #endif //FIX_HTTPPARSER_H