Click here to Skip to main content
15,886,063 members
Articles / Desktop Programming / MFC

A Great Protocol Analyser

Rate me:
Please Sign up or sign in to vote.
3.39/5 (12 votes)
16 Aug 2007CPOL2 min read 39.8K   2.9K   32  
A programmable, easy-to-use protocol decoder for parsing and displaying binary package
/*==================================================================
====================================================================*/

#if !defined(_STRINGARRAY_H)
#define _STRINGARRAY_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "PubHeader.h"
#include "otstr.h"
#include "ObArray.h"

//////////////////////////////////////////
#ifdef _DLL_PROJECT
class CLASS_EXPORT StringArray
#else
class StringArray
#endif
{
public:
    StringArray();
    virtual ~StringArray();

    int  GetSize();
    void SetSize(long size, char* lpstring="", DWORD param=0);

    void Add(char* lpstring, DWORD param=0);
    void Add(OTSTR& str, DWORD param=0);
    
	OTSTR& GetAt(int nIndex, DWORD* lpParam=NULL);

    int  Find(char* lpstring, bool bcase, DWORD* lpParam=NULL);   // return Index,  -1 mean not found
    int  Find(OTSTR& str,     bool bcase, DWORD* lpParam=NULL);   // return Index,  -1 mean not found
    
    void RemoveAll();

    void   setName(char* szName);
    OTSTR& getName();

protected:
    ObArray m_ObArray;
    OTSTR   m_strRet;
    
protected:
    virtual char* malloc_(long  size);  
    virtual void  free_  (char* pbuffer);
};



#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions