stringtableelement.cpp

来自「这是一个用来编译pascal的一个小程序有些还不行但也发了」· C++ 代码 · 共 80 行

CPP
80
字号
// StringTableElement.cpp: implementation of the StringTableElement class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "MyPascal.h"
#include "StringTableElement.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

StringTableElement::StringTableElement()
{
	this->i_type = 0;
	this->s_name = "";
}

StringTableElement::StringTableElement(int type, CString name)
{
	this->i_type = type;
	this->s_name = name;
}

StringTableElement::~StringTableElement()
{

}


StringTableElement::StringTableElement(StringTableElement &te)
{
	this->i_type = te.i_type;
	this->s_name = te.s_name;
}


bool StringTableElement::operator <(StringTableElement te)
{
	return ((this->i_type < te.i_type)
		|| (this->i_type == te.i_type && this->s_name < te.s_name));
}

bool StringTableElement::operator >(StringTableElement te)
{
	return ((this->i_type > te.i_type)
		|| (this->i_type == te.i_type && this->s_name > te.s_name));
}

bool StringTableElement::operator ==(StringTableElement te)
{
	return (this->i_type == te.i_type && this->s_name == te.s_name);
}

bool StringTableElement::operator <=(StringTableElement te)
{
	return ((this->i_type < te.i_type)
		|| (this->i_type == te.i_type && this->s_name <= te.s_name));
}

bool StringTableElement::operator >=(StringTableElement te)
{
	return ((this->i_type > te.i_type)
		|| (this->i_type == te.i_type && this->s_name >= te.s_name));
}

CString StringTableElement::ToString()
// ToString
{
	CString s;
	s.Format("%3d ---- %s\r\n", this->i_type, this->s_name);

	return s;
}

⌨️ 快捷键说明

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