📄 wtfield.h
字号:
/*
* 文件名: WTField.h
*
* 作者: 施立虹
*
* 描述: 用来保存从 oracle 中读取到的表的字段和字段的信息
*
* 全局变量: 无
*
* 修订记录:
* 日期 修订者 修订描述
* 2004-06-16 施立虹 创建本文件
*/
// WTField.h: interface for the CWTField class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_WTFIELD_H__32BBE5CB_B435_41CB_8DC7_17817E6F03C9__INCLUDED_)
#define AFX_WTFIELD_H__32BBE5CB_B435_41CB_8DC7_17817E6F03C9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//class CWTValue;
////////////////////////////////////////////////////////////////////////
// value type ////
////////////////////////////////////////////////////////////////////////
enum ValType
{
WTINT,
WTLONG,
WTFLOAT,
WTDOUBLE,
WTCSTRING,
WTDATE,
WTOBJECT
};
//////////////////////////////////////////////////////////////////////////
// value class ///
//////////////////////////////////////////////////////////////////////////
#include "Geometry.h"
class AFX_EXT_CLASS CWTValue
{
public:
CWTValue();
virtual ~CWTValue();
public:
int m_nVal;
long m_lVal;
float m_flVal;
double m_dlVal;
CString m_strVal;
CGeometry m_CGeotry;
protected:
ValType m_valType;
CString m_strBuffer;
unsigned short m_nValPrecision;
unsigned short m_nValSize;
public:
//设置数据类型
virtual void SetValueType(ValType valType)
{
m_valType = valType;
};
//获取数据类型
ValType GetValueType()
{
return m_valType;
};
virtual CWTValue GetVal()
{
return *this;
};
//设置数据长度
void SetSize(unsigned short nSize);
//获取数据长度
unsigned short GetSize();
//设置精度
void SetPrecision(unsigned short nPrecision);
//获取精度
unsigned short GetPrecision();
//以字符串的形式获取数据 :只对某些数据有效
void SetValueFromString(CString strValue);
//以了符串的形式设置数据 :只对某些数据有效
CString GetValueAsString();
public:
//运算符重载
CWTValue& operator = (const int &nValue);
CWTValue& operator = (const long &lValue);
CWTValue& operator = (const double &dlValue);
CWTValue& operator = (const char* pszValue);
CWTValue& operator = (const CString &strValue);
};
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
class CWTRecordSet;
class AFX_EXT_CLASS CWTField :public CWTValue
{
public:
CWTField();
CWTField(ValType valType);
virtual ~CWTField();
private:
CString m_strFieldName;
public:
//设置字段名
void SetFieldName(CString strName) {m_strFieldName = strName;};
//获取字段名
CString GetFieldName(){return m_strFieldName;};
public:
CWTField& operator = (const int &nValue);
CWTField& operator = (const long &lValue);
CWTField& operator = (const float &flValue);
CWTField& operator = (const double &dlValue);
CWTField& operator = (const char* pszValue);
CWTField& operator = (const CString &strValue);
CWTField& operator = (const CGeometry &Geometry);
};
#endif // !defined(AFX_WTFIELD_H__32BBE5CB_B435_41CB_8DC7_17817E6F03C9__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -