Parser.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIX_PARSER_H
00023 #define FIX_PARSER_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 Parser
00037 {
00038 public:
00039 Parser()
00040 : m_bufferSize( 0 ) {}
00041 ~Parser() {}
00042
00043 bool extractLength( int& length, std::string::size_type& pos,
00044 const std::string& buffer )
00045 throw ( MessageParseError );
00046 bool readFixMessage( std::string& str )
00047 throw ( MessageParseError );
00048
00049 void addToStream( const char* str, size_t len )
00050 { m_buffer.append( str, len ); }
00051 void addToStream( const std::string& str )
00052 { m_buffer.append( str ); }
00053
00054 private:
00055 std::string m_buffer;
00056 int m_bufferSize;
00057 };
00058 }
00059 #endif //FIX_PARSER_H