⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbpostgress.h

📁 电梯模拟程序 用C++编写,可以模拟电梯的常用功能 有借鉴意义
💻 H
字号:
/* -*- Mode: C++;tab-width: 4 ;indent-tabs-mode: t; c-basic-offset: 4 -*- *//*** Copyright (c) 2001 Oleg Shalnev                                    ***//***                                                                    ***//*** 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., 675 Mass Ave, Cambridge, MA 02139, USA.          ***//***                                                                    ***/#ifndef __DBPOSTGRESS_H__#define __DBPOSTGRESS_H__#include <GlanStd.h>#include <libpq-fe.h>#include <wx/string.h>namespace GlanGen{	class dbPostgres	{	public:		PGconn   *Connection;		PGresult *Result;		bool      ConnectionFlag;		dbPostgres();		~dbPostgres();			Glan_int4 Connect(const char*);		Glan_int4 Close();		Glan_int4 Exec(const char*);		Glan_int4 Exec(const wxString&);		Glan_int4 ExecCommandOK(const char*);		Glan_int4 ExecCommandOK(const wxString&);			Glan_int4 ExecTuplesOK(const char*);		Glan_int4 ExecTuplesOK(const wxString&);		void  BeginTransaction();		void  EndTransaction();		void  AbortTransaction();		void ClearResult()		{			if(Result)				{					PQclear(Result);					Result=NULL;				}		}	};	/******************************************************************* 	 * Create Date: Mon Dec  4 08:06:00 2000	 * Description: 	 *******************************************************************/	class dbPostgresCursor	{	public:		PGconn   *Connection;		PGresult *Result;		wxString  CursorName;		bool      CreateCursorFlag;		dbPostgresCursor();		dbPostgresCursor(dbPostgres*);		~dbPostgresCursor();		Glan_int4 Exec(const char*);		Glan_int4 Exec(const wxString&);		bool SetPostgres(dbPostgres*);		bool SetConnection(dbPostgres* Con){return SetPostgres(Con);}		Glan_int4 DeclareCursor(const char* CursorName, const char* Command);		Glan_int4 DeclareBinaryCursor(const char* CursorName, const char* Command);		Glan_int4 CloseCursor();		Glan_int4 Fetch();		Glan_int4 Tuples();		Glan_int4 Fields();		const char* FieldName(Glan_int4 FieldNum);		Glan_int4   FieldNum(const char* FieldName);		Oid FieldType(Glan_int4 FieldNum);		Oid FieldType(const char* FieldName);		Glan_short2 FieldSize(Glan_int4 FieldNum);		Glan_short2 FieldSize(const char* FieldName);		bool BinaryTuple();		bool IsNULL(Glan_int4 TupleNumber, Glan_int4 FieldNumber);		bool IsNULL(Glan_int4 TupleNumber, const char* FieldName);		void* GetValue(Glan_int4 TupleNumber, Glan_int4 FieldNumber);		void* GetValue(Glan_int4 TupleNumber, const char* FieldName);	};}#endif

⌨️ 快捷键说明

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