/********************************************************************
created: 2001/08/09
created: 9:8:2001 10:19
filename: e:\My Projects\Own\ToDoCached\ToDoSTLDebug.h
file path: e:\My Projects\Own\ToDoCached
file base: ToDoSTLDebug
file ext: h
author: Alex Kucherenko
purpose:
*********************************************************************/
#if !defined(AFX_TODOSTLDEBUG_H__96A5AE81_CF5D_438B_BBA5_F389D13F7F31__INCLUDED_)
#define AFX_TODOSTLDEBUG_H__96A5AE81_CF5D_438B_BBA5_F389D13F7F31__INCLUDED_
# pragma once
#include "..\stldbg\stl_types.h"
#include "..\stldbg\stl_map.h"
#include "..\stldbg\stl_list.h"
#include "..\stldbg\stl_vector.h"
#include "..\stldbg\stl_string.h"
#include "dlg_resize.h"
#include "dlg_init.h"
#include "hhsupp.h"
#include "autofont.h"
//////////////////////////////////////////////////////////////////////////
// Macro which calculate array size
#ifndef SIZEOF_ARRAY
# define SIZEOF_ARRAY(x) ( sizeof( x )/sizeof( x[0] ) )
#endif
#define DEF_OUTPUT_STRING_LENGTH 60
#define DEF_MAX_AUTOEVALUATE m_lAutoExpand
//////////////////////////////////////////////////////////////////////////
// Difinition of suppported types
// NOTE: First must be classes and only after them simple types
typedef enum
{
stdTypeString = 0,
stdTypeVector /*= 1*/,
stdTypeMap /*= 2*/,
stdTypeMultiMap /*= 3*/,
stdTypeSet /*= 4*/,
stdTypeMultiSet /*= 5*/,
stdTypeList /*= 6*/,
stdTypeCString /*= 7*/,
stdTypeComBSTR /*= 8*/,
stdTypeBSTR /*= 9*/,
stdTypetBstr /*=10*/,
stdTypeCharStr, // Must be allways last
} TSTLTypes;
//////////////////////////////////////////////////////////////////////////
//
class CSTLDbgImpl
{
public:
CSTLDbgImpl( IDebugger *pDebug )
: m_pMapDebug( NULL )
, m_pListDebug( NULL )
, m_pVecDebug( NULL )
, m_pBSTR( NULL )
, m_pComBSTR( NULL )
, m_pCString( NULL )
, m_pStdStr( NULL )
, m_pTBSTR( NULL )
, m_pDebugger( pDebug )
{
string name;
m_pMapDebug = new CStdMap( m_pDebugger, name );
m_pListDebug = new CStdList( m_pDebugger, name );
m_pVecDebug = new CStdVector( m_pDebugger, name );
m_pBSTR = new CStdBSTR( m_pDebugger, name );
m_pComBSTR = new CStdComBSTR( m_pDebugger, name );
m_pCString = new CStdCString( m_pDebugger, name );
m_pStdStr = new CStdString( m_pDebugger, name );
m_pTBSTR = new CStdTBSTR( m_pDebugger, name );
m_pChar = new CStdChar( m_pDebugger, name );
};
virtual ~CSTLDbgImpl( )
{
delete m_pMapDebug, m_pMapDebug = NULL;
delete m_pListDebug, m_pListDebug = NULL;
delete m_pVecDebug, m_pVecDebug = NULL;
delete m_pBSTR, m_pBSTR = NULL;
delete m_pComBSTR, m_pComBSTR = NULL;
delete m_pCString, m_pCString = NULL;
delete m_pStdStr, m_pStdStr = NULL;
delete m_pTBSTR, m_pTBSTR = NULL;
delete m_pChar, m_pChar = NULL;
};
virtual IStdTypes *GetByIndex( TSTLTypes index )
{
switch( index )
{
case stdTypeString: return m_pStdStr;
case stdTypeVector: return m_pVecDebug;
case stdTypeMap:
case stdTypeMultiMap:
case stdTypeSet:
case stdTypeMultiSet: return m_pMapDebug;
case stdTypeList: return m_pListDebug;
case stdTypeCString: return m_pCString;
case stdTypeComBSTR: return m_pComBSTR;
case stdTypeBSTR: return m_pBSTR;
case stdTypetBstr: return m_pTBSTR;
case stdTypeCharStr: return m_pChar;
}
return NULL;
};
private:
CStdMap *m_pMapDebug; // std::map and std::set ( +multi )
CStdList *m_pListDebug; // std::list
CStdVector *m_pVecDebug; // std::vector
CStdBSTR *m_pBSTR;
CStdComBSTR *m_pComBSTR;
CStdCString *m_pCString;
CStdString *m_pStdStr;
CStdTBSTR *m_pTBSTR;
CStdChar *m_pChar;
CComPtr<IDebugger> m_pDebugger; // pointer to Debugger interface
};
/////////////////////////////////////////////////////////////////////////////
// CToDoSTLDebug dialog
class CToDoSTLDebug
: public CHHDialog/*CDialog*/
, public CResizeImpl
, public CSTLDbgImpl
, public CInitDialogImpl
{
public:
// standard constructor
CToDoSTLDebug( CWnd* pParent = NULL, IDebugger *pDebug = NULL, CRegistryEx *pReg = NULL );
virtual ~CToDoSTLDebug();
void SetVariable( CString strName )
{
m_strValue = strName;
if( m_cValue.m_hWnd != NULL ) UpdateData( FALSE );
};
//{{AFX_DATA(CToDoSTLDebug)
enum { IDD = IDD_DEBUGSTL_DLG };
CEdit m_cFilterBy;
CComboBox m_cValue;
CProgressCtrl m_cProgress;
CButton m_cCopy;
CEdit m_cSizeTo;
CEdit m_cSizeFrom;
CSpinButtonCtrl m_cSpinTo;
CSpinButtonCtrl m_cSpinFrom;
CComboBox m_cViewType;
CListCtrl m_cResultView;
CComboBox m_cValueType;
CString m_strSizeFrom;
CString m_strSizeTo;
CString m_strValue;
//}}AFX_DATA
protected:
// evaluate functions
virtual CString GetContanerSize( TSTLTypes tType );
virtual void CreateValueView( TSTLTypes tType, long lMin, long lMax );
virtual BOOL ExpandSTLType( long lMin, long lMax );
virtual BOOL ExpandSTLPairShow( void );
virtual BOOL ExpandSTLSingleShow( void );
virtual BOOL ExpandStringsShow( void );
virtual CString CheckSTLType( IStdTypes *pType );
virtual void GetInitSettings();
virtual void SetInitSettings();
private:
const static CString m_strFill[]; // array of supported types
const static ULONG m_lFillSize; // size of array
CAutoFont *m_pFont;
IStdTypes *m_pSTLDebugg; // interface pointer
TStrArray m_arrHistory; // history array
ULONG m_lHistoryLim; // max records in history
ULONG m_lAutoExpand;
BOOL m_bAutoExpand;
ULONG m_lMaxCount; // Max size of element
BOOL m_bAutoFind; // if TRUE class will try to find STL type automaticaly
BOOL m_bChangeToSpc; // if TRUE then symols less 0x20 will be changed to \0xNN
//{{AFX_VIRTUAL(CToDoSTLDebug)
protected:
virtual void DoDataExchange(CDataExchange* pDX);
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CToDoSTLDebug)
afx_msg void OnEvaluate();
virtual void OnCancel();
afx_msg void OnCopy();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeType();
afx_msg void OnAbort();
afx_msg LRESULT OnEvaluateFinish( WPARAM, LPARAM );
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnDestroy();
afx_msg void OnFindAutoType();
afx_msg void OnSelchangeValue();
afx_msg void OnEditchangeValue();
afx_msg void OnChangeFilter();
//}}AFX_MSG
afx_msg void OnGetMinMaxInfo( MINMAXINFO *pMinMax );
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
#endif // !defined(AFX_TODOSTLDEBUG_H__96A5AE81_CF5D_438B_BBA5_F389D13F7F31__INCLUDED_)
//:> end of file