📄 nrdb.h
字号:
//////////////////////////////////////////////////////
//
// NRDB Pro - Spatial database and mapping application
//
// Copyright (c) 1989-2004 Richard D. Alexander
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// NRDB Pro is part of the Natural Resources Database Project
//
// Homepage: http://www.nrdb.co.uk/
// Users' Forum: http://nrdb.mypalawan.info/
//
#ifndef _BEMDB_H_
#define _BEMDB_H_
#include "maplines.h"
#include "attribute.h"
// Data access constants
#define BDGETINIT 1 // Prepare query and get 1st value in data set
#define BDGETNEXT 2 // Get next value in data set
#define BDADD 4 // Add to data set
#define BDUPDATE 3 // Update data set
#define BDDELETE 5 // Delete from data set
#define BDINSERTINIT 16 // Prepare insert and insert 1st row in data set
#define BDINSERTNEXT 17 // Add next row in data set
#define BDSELECT 19 // Do a query that will return a subset of the data
#define BDSELECT2 20 // Do a query that will return a subset of the data
#define BDSELECT3 25 // Do a query that will return a subset of the data
#define BDSELECT4 26 // Do a query that will return a subset of the data
#define BDSELECT5 28 // Do a query that will return a subset of the data
#define BDDELETEALL 27 // Delete all records of a given type
#define BDINTERNAL 1024 // Use internal handle
#define BDDELDATA 0x0001 // Parameters for BDFTypeDelete
#define BDDELFEATURE 0x0002
#define BDDELFTYPE 0x0004
// Messages
#define BDRESETPROGRESS WM_USER+1
#define BDUPDATEPROGESS WM_USER+2
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Connection handle type
typedef HANDLE BDHANDLE;
///////////////////////////////////////////////////////////////////////////////
class CFeatureType
{
public:
CFeatureType();
long m_lId;
CString m_sDesc;
CString m_sInternal;
long m_lParentFType;
BOOL m_bManyToOne;
long m_lDictionary;
};
typedef CArray <CFTypeAttr, CFTypeAttr> CFTypeAttrArray;
struct CFTypeMap
{
BOOL m_bMap;
long m_lFType;
};
class CFeature
{
public:
CFeature();
CFeature(CFeature&);
long m_lId;
long m_lFeatureTypeId;
CString m_sName;
long m_lParentFeature;
};
class CDictionary
{
public:
CDictionary();
long m_lId;
CString m_sDesc;
};
class CBDMain
{
public:
CString m_Country;
CString m_Province;
CString m_City;
CString m_Organization;
CString m_Address;
CString m_Telephone;
CString m_Fax;
CString m_Email;
CString m_Logo;
int m_nVersion;
BOOL m_bCoordAsLatLon;
BOOL m_bCustomHeader;
BOOL m_bCustomFooter;
CString m_sCustomHeader;
CString m_sCustomFooter;
CString m_sStyleSheet;
};
class CBDProjection
{
public:
long m_nID;
CString m_sName;
double m_dSemiMajorAxis;
double m_dSemiMinorAxis;
double m_dLatitudeOrigin;
double m_dLongitudeOrigin;
double m_dFalseEasting;
double m_dFalseNorthing;
double m_dScaleFactorAtOrigin;
long m_lScaleCoords;
double m_dMinEasting;
double m_dMaxEasting;
double m_dMinNorthing;
double m_dMaxNorthing;
BOOL m_bDefault;
CBDProjection();
};
class CBDSymbol
{
public:
long m_lId;
CLongBinary m_symbol;
};
enum OnError {DisplayMessage,ThrowException};
///////////////////////////////////////////////////////////////////////////////
extern "C"
{
BOOL BDConnect(LPCSTR psDBase, BDHANDLE* pDBHandle);
BOOL BDDisconnect(BDHANDLE);
BOOL BDFeatureType(BDHANDLE hConnect, CFeatureType* pFeatureType, int iFlag);
BOOL BDFTypeAttr(BDHANDLE hConnect, CFTypeAttr* pFTypeAttr, int iFlag);
BOOL BDFeature(BDHANDLE hConnect, CFeature* pFeature, int iFlag);
BOOL BDDictionary(BDHANDLE, CDictionary* pDictionary, int iFlag);
BOOL BDMain(BDHANDLE hConnect, CBDMain* pMain, int iFlag);
BOOL BDProjection(BDHANDLE hConnect, CBDProjection* pProjection, int iFlag);
BOOL BDSymbol(BDHANDLE hConnect, CBDSymbol *pSymbol, int iFlag);
BOOL BDGetNext(BDHANDLE hConnect);
BOOL BDEnd(BDHANDLE hConnect);
BOOL BDNextId(BDHANDLE hConnect, int nType, long lId, LPLONG plNextId);
BOOL BDFTypeCreate(BDHANDLE hConnect, long lFType);
BOOL BDFTypeUpdate(BDHANDLE hConnect, long lFType, CAttrArray* pArray);
BOOL BDFTypeDelete(BDHANDLE hConnect, long lFType, int iFlag);
BOOL BDFTypeParentI(BDHANDLE hConnect, long lFType, CFeatureType*);
BOOL BDFTypeI(BDHANDLE hConnect, long lFType, CFeatureType*);
BOOL BDFTypeAttrInit(BDHANDLE hConnect, long lFType, CAttrArray* pArray);
BOOL BDAttribute(BDHANDLE hConnect, CAttrArray* pArray, int iFlag);
BOOL BDAttributeRange(BDHANDLE hConnect, CAttrArray* pArray, long lFeatureMin, long lFeatureMax, int iFlag = BDGETINIT);
BOOL BDAttributeCond(BDHANDLE hConnect, CAttrArray* pArray, long lFeatureMin, long lFeatureMax, LPCSTR sFilter, int iFlag);
BOOL BDBeginTrans(BDHANDLE hConnect);
BOOL BDCommit(BDHANDLE hConnect);
BOOL BDRollBack(BDHANDLE hConnect);
void BDOnError(BDHANDLE hConnect, int);
void BDSetActiveWnd(HWND);
void BDGetError(BDHANDLE hConnect, CString&);
int BDGetTransLevel(BDHANDLE);
BOOL BDInitialise(LPCSTR sDSN);
BOOL BDGetDriver(BDHANDLE, CString&);
int BDGetVersion(BDHANDLE hConnect);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -