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

📄 umysqlclient.hpp

📁 MYSQL 连接控件 MYSQL 连接控件
💻 HPP
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'uMysqlClient.pas' rev: 6.00

#ifndef uMysqlClientHPP
#define uMysqlClientHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <SyncObjs.hpp>	// Pascal unit
#include <uMysqlNewPassword.hpp>	// Pascal unit
#include <uMysqlNet.hpp>	// Pascal unit
#include <uMysqlErrors.hpp>	// Pascal unit
#include <uMysqlCT.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Umysqlclient
{
//-- type declarations -------------------------------------------------------
typedef unsigned *PCardinal;

typedef char * *TMysql_Row;

struct TMysql_Rows;
typedef TMysql_Rows *PMysql_Rows;

#pragma pack(push, 4)
struct TMysql_Rows
{
	TMysql_Rows *prior;
	TMysql_Rows *next;
	char * *data;
} ;
#pragma pack(pop)

struct TMYSQL_DATA
{
	__int64 rows;
	int fields;
	TMysql_Rows *data;
} ;

typedef TMYSQL_DATA *PMYSQL_DATA;

struct TMysql_FieldDef;
typedef TMysql_FieldDef *PMysql_FieldDef;

#pragma pack(push, 1)
struct TMysql_FieldDef
{
	char *name;
	char *org_name;
	char *table;
	char *org_table;
	char *db;
	char *catalog;
	char *def;
	unsigned length;
	unsigned max_length;
	unsigned name_length;
	unsigned org_name_length;
	unsigned table_length;
	unsigned org_table_length;
	unsigned db_length;
	unsigned catalog_length;
	unsigned def_length;
	unsigned flags;
	unsigned decimals;
	unsigned charsetnr;
	Byte FieldType;
} ;
#pragma pack(pop)

#pragma option push -b-
enum TResultType { rtUsed, rtStored };
#pragma option pop

class DELPHICLASS TMysqlResult;
class DELPHICLASS TMysqlClient;
typedef TMetaClass*TMySQLResultClass;

class PASCALIMPLEMENTATION TMysqlClient : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	Umysqlnet::TMysqlNet* fnet;
	AnsiString fhost;
	AnsiString fuser;
	AnsiString fpasswd;
	AnsiString funix_socket;
	AnsiString fdb;
	unsigned fport;
	System::SmallString<21>  fscramble_buff;
	unsigned fthread_id;
	__int64 faffected_rows;
	__int64 finsert_id;
	Umysqlct::TMysql_Status fstatus;
	bool freconnect;
	bool fnamed_pipe;
	bool ftrysock;
	unsigned fconnect_timeout;
	bool fsecure_auth;
	bool fcompress;
	unsigned fclient_flag;
	AnsiString fserver_version;
	unsigned fserver_capabilities;
	int fserver_status;
	unsigned fserver_language;
	__int64 fextra_info;
	AnsiString finfo;
	int ffield_count;
	TMysql_FieldDef *ffields;
	TMysqlResult* fusedresult;
	bool fuse_ssl;
	int FNullLength;
	bool FThreaded;
	Syncobjs::TCriticalSection* FCriticalSection;
	TMetaClass*FResultClass;
	int __fastcall send_file_to_server(const AnsiString filename);
	PMYSQL_DATA __fastcall read_rows(PMysql_FieldDef mysql_fields, int fields, bool &hadErrors);
	bool __fastcall protocol41(void);
	int __fastcall read_one_row(int fields, TMysql_Row row, PCardinal lengths);
	int __fastcall simple_command(Umysqlct::TEnumServerCommand command, char * arg, int lengt, bool skipp_check, bool retry);
	int __fastcall read_query_result(void);
	void __fastcall free_old_query(void);
	PMysql_FieldDef __fastcall unpack_fields(PMYSQL_DATA data, int fields, bool long_flag_protocol);
	TMysqlResult* __fastcall store_result(void);
	TMysqlResult* __fastcall use_result(void);
	void __fastcall SetHost(const AnsiString Value);
	void __fastcall SetDb(const AnsiString Value);
	void __fastcall SetPasswd(const AnsiString Value);
	void __fastcall SetPort(const unsigned Value);
	void __fastcall SetUnixSocket(const AnsiString Value);
	void __fastcall SetUser(const AnsiString Value);
	void __fastcall SetClientFlag(const unsigned Value);
	void __fastcall SetNamedPipe(const bool Value);
	void __fastcall SetTrySock(const bool Value);
	void __fastcall setfcompress(const bool Value);
	void __fastcall setfsecureauth(const bool Value);
	void __fastcall SetUseSSL(const bool Value);
	unsigned __fastcall GetLastErrorNo(void);
	AnsiString __fastcall GetLastError();
	AnsiString __fastcall GetClientInfo();
	unsigned __fastcall GetProtocol_version(void);
	bool __fastcall GetConnected(void);
	void __fastcall SetNoTimeOut(const bool Value);
	bool __fastcall GetNoTimeOut(void);
	bool __fastcall mysql_autenticate(void);
	
public:
	__property AnsiString Host = {read=fhost, write=SetHost};
	__property AnsiString User = {read=fuser, write=SetUser};
	__property AnsiString Password = {read=fpasswd, write=SetPasswd};
	__property AnsiString UnixSocket = {read=funix_socket, write=SetUnixSocket};
	__property AnsiString Db = {read=fdb, write=SetDb};
	__property unsigned Port = {read=fport, write=SetPort, nodefault};
	__property unsigned ClientFlag = {read=fclient_flag, write=SetClientFlag, nodefault};
	__property bool ShouldReconnect = {read=freconnect, write=freconnect, nodefault};
	__property bool UseNamedPipe = {read=fnamed_pipe, write=SetNamedPipe, nodefault};
	__property bool TrySockets = {read=ftrysock, write=SetTrySock, nodefault};
	__property unsigned ConnectTimeout = {read=fconnect_timeout, write=fconnect_timeout, nodefault};
	__property bool Compress = {read=fcompress, write=setfcompress, nodefault};
	__property bool SecureAuth = {read=fsecure_auth, write=setfsecureauth, nodefault};
	__property Umysqlct::TMysql_Status Status = {read=fstatus, nodefault};
	__property unsigned ThreadId = {read=fthread_id, nodefault};
	__property __int64 AffectedRows = {read=faffected_rows};
	__property __int64 LastInsertId = {read=finsert_id};
	__property AnsiString ServerVersion = {read=fserver_version};
	__property AnsiString ClientVersion = {read=GetClientInfo};
	__property unsigned ProtocolVersion = {read=GetProtocol_version, nodefault};
	__property unsigned ServerCapabilities = {read=fserver_capabilities, nodefault};
	__property int ServerStatus = {read=fserver_status, nodefault};
	__property unsigned ServerLanguage = {read=fserver_language, nodefault};
	__property __int64 ExtraInfo = {read=fextra_info};
	__property AnsiString Info = {read=finfo};
	__property bool Connected = {read=GetConnected, nodefault};
	__property AnsiString LastError = {read=GetLastError};
	__property unsigned LastErrorNo = {read=GetLastErrorNo, nodefault};
	__property bool NoTimeOut = {read=GetNoTimeOut, write=SetNoTimeOut, nodefault};
	__property bool UseSSL = {read=fuse_ssl, write=SetUseSSL, nodefault};
	__property int NullLength = {read=FNullLength, write=FNullLength, nodefault};
	__property TMetaClass* ResultClass = {read=FResultClass, write=FResultClass};
	__fastcall TMysqlClient(void);
	__fastcall virtual ~TMysqlClient(void);
	bool __fastcall connect(AnsiString ahost, AnsiString auser = "", AnsiString apasswd = "", AnsiString adb = "", unsigned aport = (unsigned)(0xcea), AnsiString aunix_socket = "", bool atrysocket = false, int aclient_flag = 0xa285)/* overload */;
	bool __fastcall connect(void)/* overload */;
	bool __fastcall reconnect(void);
	void __fastcall close(void);
	bool __fastcall select_db(const AnsiString newdb);
	bool __fastcall create_db(const AnsiString db);
	bool __fastcall drop_db(const AnsiString adb);
	bool __fastcall change_user(AnsiString NewUser, AnsiString NewPasswd, AnsiString NewDb = "");
	bool __fastcall refresh(int options);
	bool __fastcall dump_debug_info(void);
	bool __fastcall kill(int pid);
	bool __fastcall ping(void);
	bool __fastcall shutdown(void);
	int __fastcall realquery(const AnsiString aquery);
	TMysqlResult* __fastcall useresult(void);
	TMysqlResult* __fastcall query(const AnsiString aquery, bool StoreResult, bool &ExecutedOk);
	AnsiString __fastcall stat();
	TMysqlResult* __fastcall list_processes(void);
};


class PASCALIMPLEMENTATION TMysqlResult : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	int ffieldscount;
	__int64 frowscount;
	TMysql_FieldDef *ffields;
	TMysqlClient* fhandle;
	TResultType fType;
	unsigned *flengths;
	char * *frow;
	TMYSQL_DATA *fdata;
	TMysql_Rows *fdata_cursor;
	int fRecNo;
	char * *fcurrent_row;
	bool fEOF;
	bool fBOF;
	bool flengthsread;
	int fLastRow;
	void __fastcall SetRecNo(const int Value);
	void __fastcall SetHasLengths(const bool Value);
	bool __fastcall GetHadErrors(void);
	bool __fastcall GetLastRowRead(void);
	
public:
	__property bool Eof = {read=fEOF, nodefault};
	__property bool Bof = {read=fBOF, write=fBOF, nodefault};
	__property int RecNo = {read=fRecNo, write=SetRecNo, nodefault};
	__property bool HasLengths = {read=flengthsread, write=SetHasLengths, nodefault};
	__property int FieldsCount = {read=ffieldscount, nodefault};
	__property __int64 RowsCount = {read=frowscount};
	__property TResultType ResultType = {read=fType, nodefault};
	__property PMysql_FieldDef FieldsDefs = {read=ffields};
	__property PCardinal Lengths = {read=flengths};
	__property TMysql_Row CurrentRow = {read=fcurrent_row};
	__property bool HadErrors = {read=GetHadErrors, nodefault};
	__property bool LastRowRead = {read=GetLastRowRead, nodefault};
	__fastcall TMysqlResult(TMysqlClient* aMysql, TResultType aType);
	__fastcall virtual ~TMysqlResult(void);
	unsigned __fastcall FieldLenght(int aIndex);
	char * __fastcall FieldValue(int aIndex);
	PMysql_FieldDef __fastcall FieldDef(int aIndex);
	char * __fastcall FieldValueByName(AnsiString aName, bool CaseSensitive = false);
	PMysql_FieldDef __fastcall FieldDefByName(AnsiString aName, bool CaseSensitive = false);
	int __fastcall FieldIndexByName(AnsiString aName, bool CaseSensitive = false);
	void __fastcall Next(void);
	void __fastcall Prior(void);
	void __fastcall First(void);
	void __fastcall Last(void);
	void __fastcall FetchLengths(void);
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Umysqlclient */
using namespace Umysqlclient;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// uMysqlClient

⌨️ 快捷键说明

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