📄 afxcoll.h
字号:
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#ifndef __AFXCOLL_H__
#define __AFXCOLL_H__
#ifndef __AFX_H__
#include <afx.h>
#endif
#ifdef _AFX_MINREBUILD
#pragma component(minrebuild, off)
#endif
#ifndef _AFX_FULLTYPEINFO
#pragma component(mintypeinfo, on)
#endif
#ifdef _AFX_PACKING
#pragma pack(push, _AFX_PACKING)
#endif
/////////////////////////////////////////////////////////////////////////////
// Classes declared in this file
//CObject
// Arrays
class CByteArray; // array of BYTE
class CWordArray; // array of WORD
class CDWordArray; // array of DWORD
class CUIntArray; // array of UINT
class CPtrArray; // array of void*
class CObArray; // array of CObject*
// Lists
class CPtrList; // list of void*
class CObList; // list of CObject*
// Maps (aka Dictionaries)
class CMapWordToOb; // map from WORD to CObject*
class CMapWordToPtr; // map from WORD to void*
class CMapPtrToWord; // map from void* to WORD
class CMapPtrToPtr; // map from void* to void*
// Special String variants
class CStringArray; // array of CStrings
class CStringList; // list of CStrings
class CMapStringToPtr; // map from CString to void*
class CMapStringToOb; // map from CString to CObject*
class CMapStringToString; // map from CString to CString
/////////////////////////////////////////////////////////////////////////////
#undef AFX_DATA
#define AFX_DATA AFX_CORE_DATA
////////////////////////////////////////////////////////////////////////////
class CByteArray : public CObject
{
DECLARE_SERIAL(CByteArray)
public:
// Construction
CByteArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
BYTE GetAt(int nIndex) const;
void SetAt(int nIndex, BYTE newElement);
BYTE& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const BYTE* GetData() const;
BYTE* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, BYTE newElement);
int Add(BYTE newElement);
int Append(const CByteArray& src);
void Copy(const CByteArray& src);
// overloaded operator helpers
BYTE operator[](int nIndex) const;
BYTE& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, BYTE newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CByteArray* pNewArray);
// Implementation
protected:
BYTE* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CByteArray();
void Serialize(CArchive&);
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef BYTE BASE_TYPE;
typedef BYTE BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CWordArray : public CObject
{
DECLARE_SERIAL(CWordArray)
public:
// Construction
CWordArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
WORD GetAt(int nIndex) const;
void SetAt(int nIndex, WORD newElement);
WORD& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const WORD* GetData() const;
WORD* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, WORD newElement);
int Add(WORD newElement);
int Append(const CWordArray& src);
void Copy(const CWordArray& src);
// overloaded operator helpers
WORD operator[](int nIndex) const;
WORD& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, WORD newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CWordArray* pNewArray);
// Implementation
protected:
WORD* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CWordArray();
void Serialize(CArchive&);
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef WORD BASE_TYPE;
typedef WORD BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CDWordArray : public CObject
{
DECLARE_SERIAL(CDWordArray)
public:
// Construction
CDWordArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
DWORD GetAt(int nIndex) const;
void SetAt(int nIndex, DWORD newElement);
DWORD& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const DWORD* GetData() const;
DWORD* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, DWORD newElement);
int Add(DWORD newElement);
int Append(const CDWordArray& src);
void Copy(const CDWordArray& src);
// overloaded operator helpers
DWORD operator[](int nIndex) const;
DWORD& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, DWORD newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CDWordArray* pNewArray);
// Implementation
protected:
DWORD* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CDWordArray();
void Serialize(CArchive&);
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef DWORD BASE_TYPE;
typedef DWORD BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CUIntArray : public CObject
{
DECLARE_DYNAMIC(CUIntArray)
public:
// Construction
CUIntArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
UINT GetAt(int nIndex) const;
void SetAt(int nIndex, UINT newElement);
UINT& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const UINT* GetData() const;
UINT* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, UINT newElement);
int Add(UINT newElement);
int Append(const CUIntArray& src);
void Copy(const CUIntArray& src);
// overloaded operator helpers
UINT operator[](int nIndex) const;
UINT& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, UINT newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CUIntArray* pNewArray);
// Implementation
protected:
UINT* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CUIntArray();
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef UINT BASE_TYPE;
typedef UINT BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CPtrArray : public CObject
{
DECLARE_DYNAMIC(CPtrArray)
public:
// Construction
CPtrArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
void* GetAt(int nIndex) const;
void SetAt(int nIndex, void* newElement);
void*& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const void** GetData() const;
void** GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, void* newElement);
int Add(void* newElement);
int Append(const CPtrArray& src);
void Copy(const CPtrArray& src);
// overloaded operator helpers
void* operator[](int nIndex) const;
void*& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, void* newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CPtrArray* pNewArray);
// Implementation
protected:
void** m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CPtrArray();
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef void* BASE_TYPE;
typedef void* BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CObArray : public CObject
{
DECLARE_SERIAL(CObArray)
public:
// Construction
CObArray();
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
CObject* GetAt(int nIndex) const;
void SetAt(int nIndex, CObject* newElement);
CObject*& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const CObject** GetData() const;
CObject** GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, CObject* newElement);
int Add(CObject* newElement);
int Append(const CObArray& src);
void Copy(const CObArray& src);
// overloaded operator helpers
CObject* operator[](int nIndex) const;
CObject*& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, CObject* newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CObArray* pNewArray);
// Implementation
protected:
CObject** m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CObArray();
void Serialize(CArchive&);
#ifdef _DEBUG
void Dump(CDumpContext&) const;
void AssertValid() const;
#endif
protected:
// local typedefs for class templates
typedef CObject* BASE_TYPE;
typedef CObject* BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
class CStringArray : public CObject
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -