input.h

来自「手机选中奖号器」· C头文件 代码 · 共 69 行

H
69
字号
// Input.h: interface for the Input class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INPUT_H__849DA69B_342F_4D9C_9A09_5598D04C206D__INCLUDED_)
#define AFX_INPUT_H__849DA69B_342F_4D9C_9A09_5598D04C206D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CInputItem
{
public:
	CInputItem () { city = phone = 0;}
	unsigned int city;
	unsigned int phone;
};

typedef CTypedPtrList<CPtrList, CInputItem*> CInputList;



class Input  
{
public:
	void LoadFromFile(CString path = "", int fileformat = 1);
	int  GetSize() { return m_input.GetCount();}
	void Add(unsigned int lcode,unsigned int phone)
	{
		CInputItem *p =  new CInputItem;
		p->city = lcode;
		p->phone = phone;
        m_input.AddTail(p);
	}
	CInputItem * At(int index )
	{
		POSITION  p = m_input.FindIndex(index);
		if ( p != NULL )
		{
			return m_input.GetAt(p);
		}
		else
		{
			return NULL;
		}
	}

    void Del(int index)
	{
        POSITION  p = m_input.FindIndex(index);
		if ( p!= NULL )
		{
			CInputItem *d = m_input.GetAt(p);
			m_input.RemoveAt ( p );
			delete d;
		}
	}

	void RemoveAll();
	Input();
	virtual ~Input();

	int m_fileformat;
	CInputList m_input;
};

#endif // !defined(AFX_INPUT_H__849DA69B_342F_4D9C_9A09_5598D04C206D__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?