Main Page | Modules | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

omTCPParser.h

Go to the documentation of this file.
00001 
00002 // This code is part of the MaiaProject free software
00003 //
00004 // Keyboard and Mouse Emulator - Virtual keyboard Engine
00005 //
00006 // Copyright (c) 2002-2003 Luca Clivio <luca.clivio@maiaproject.org>
00007 // Tel. +39-347-2538040
00008 // via B.Croce 2, 20037 Paderno Dugnano (Milano) - Italy
00009 //
00010 // Developers:
00011 //    Simone Mangano <simone.mangano@maiaproject.org>
00012 //    Andrea Tosato  <andrea.tosato@maiaproject.org>
00013 //
00014 //  -----------------------------------------------------------------------------
00015 //  This program is free software; This program is free software; 
00016 //  you can redistribute it and/or modify it under the terms of the 
00017 //  GNU General Public License as published by the Free Software Foundation; 
00018 //  either version 2 of the License, or (at your option) any later version.
00019 //  but WITHOUT ANY WARRANTY; without even the implied warranty of                              
00020 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                                
00021 //  GNU General Public License for more details.                                                
00022 //  You should have received a copy of the GNU General Public License                           
00023 //  along with this program; if not, write to the Free Software                                 
00024 //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                                   
00026 
00027 
00028 #ifndef _omTCPParser_
00029 #define _omTCPParser_
00030 
00031 #include <openmaia/omObject.h>
00032 #include <openmaia/omTCPMessage.h>
00033 #include <openmaia/omFunctions.h>
00034 
00035 #include <wx/wx.h>
00036 
00037 #define OM_NO_MESSAGE 0
00038 #define OM_REGISTER_MESSAGE 1
00039 #define OM_GENERIC_MESSAGE 2
00040 
00041 
00060 class omTCPParser: public omObject
00061 {
00062  private:
00063   // status flags
00064   bool messageReceived;             
00065   bool receivingMessage;            
00066   bool registerMessage;             
00067   bool genericMessage;              
00068 
00069   omTCPMessage genericMessageData;  
00070   wxString agentName;               
00071   wxString serviceName;             
00072 
00073   // parser flags and vars and methods
00074   bool receivingEscape;             
00075   bool receivingRegister;           
00076   bool receivingGeneric;            
00077   bool messageStarting;             
00078   bool messageEnding;               
00079   bool messageStarted;              
00080   bool messageEnded;                
00081   int charCounter;                  
00082   wxString partialMessage;          
00083 
00084   bool GetParameterValue(wxString, wxString *);
00085   int GetDecodedParameters(wxString, wxArrayString *); 
00086   void ResetInitialStatus();
00087 
00088  public:
00089   omTCPParser();
00090   int AnalizeChar(char);
00091   bool GetRegisterMessage( wxString *, wxString *);
00092   bool GetGenericMessage( omTCPMessage *);
00093 
00094 };
00095 
00096 #endif 
00097