00001 {*********************************************************}
00002 { }
00003 { Zeos Database Objects }
00004 { Interfaces for Native Plain Drivers }
00005 { }
00006 { Originally written by Sergey Seroukhov }
00007 { }
00008 {*********************************************************}
00009
00010 {@********************************************************}
00011 { Copyright (c) 1999-2006 Zeos Development Group }
00012 { }
00013 { License Agreement: }
00014 { }
00015 { This library is distributed in the hope that it will be }
00016 { useful, but WITHOUT ANY WARRANTY; without even the }
00017 { implied warranty of MERCHANTABILITY or FITNESS FOR }
00018 { A PARTICULAR PURPOSE. See the GNU Lesser General }
00019 { Public License for more details. }
00020 { }
00021 { The source code of the ZEOS Libraries and packages are }
00022 { distributed under the Library GNU General Public }
00023 { License (see the file COPYING / COPYING.ZEOS) }
00024 { with the following modification: }
00025 { As a special exception, the copyright holders of this }
00026 { library give you permission to link this library with }
00027 { independent modules to produce an executable, }
00028 { regardless of the license terms of these independent }
00029 { modules, and to copy and distribute the resulting }
00030 { executable under terms of your choice, provided that }
00031 { you also meet, for each linked independent module, }
00032 { the terms and conditions of the license of that module. }
00033 { An independent module is a module which is not derived }
00034 { from or based on this library. If you modify this }
00035 { library, you may extend this exception to your version }
00036 { of the library, but you are not obligated to do so. }
00037 { If you do not wish to do so, delete this exception }
00038 { statement from your version. }
00039 { }
00040 { }
00041 { The project web site is located on: }
00042 { http:
00043 { http:
00044 { svn:
00045 { }
00046 { http:
00047 { http:
00048 { }
00049 { }
00050 { }
00051 { Zeos Development Group. }
00052 {********************************************************@}
00053
00054 unit ZPlainDriver;
00055
00056 interface
00057
00058 {$I ZPlain.inc}
00059
00060 uses ZClasses;
00061
00062 type
00063
00064 {** Represents a generic interface to plain driver. }
00065 IZPlainDriver = interface (IZInterface)
00066 ['{2A0CC600-B3C4-43AF-92F5-C22A3BB1BB7D}']
00067 function GetProtocol: string;
00068 function GetDescription: string;
00069 {
00070 function GetClientVersion: Integer;
00071 function GetServerVersion: Integer;
00072 procedure GetClientVersionEx(out MajorVersion: Integer;
00073 out MinorVersion: Integer; out SubVersion: Integer);
00074 procedure GetServerVersionEx(out MajorVersion: Integer;
00075 out MinorVersion: Integer; out SubVersion: Integer);
00076 }
00077 procedure Initialize;
00078 end;
00079
00080 {ADDED by fduenas 15-06-2006}
00081 {** Base class of a generic plain driver. }
00082 TZAbstractPlainDriver = class(TZAbstractObject, IZPlainDriver)
00083 function GetProtocol: string; virtual; abstract;
00084 function GetDescription: string; virtual; abstract;
00085 {
00086 function GetClientVersion: Integer; virtual;
00087 function GetServerVersion: Integer; virtual;
00088 procedure GetClientVersionEx(out MajorVersion: Integer;
00089 out MinorVersion: Integer; out SubVersion: Integer); virtual;
00090 procedure GetServerVersionEx(out MajorVersion: Integer;
00091 out MinorVersion: Integer; out SubVersion: Integer); virtual;
00092 }
00093 procedure Initialize; virtual; abstract;
00094 end;
00095 {END ADDED by fduenas 15-06-2006}
00096 implementation
00097 uses ZSysUtils;
00098 { TZAbstractPlainDriver }
00099
00100 {ADDED by fduenas 15-06-2006}
00101 {**
00102 Gets the clients's full version number. Initially this should be 0.
00103 @return the clients's full version number in the format XYYYZZZ where:
00104 X = major_version
00105 YYY = minor_version
00106 ZZZ = sub_version
00107
00108 Version number must be encoded the way below:
00109 client_version := major_version*1000000 + minor_version *1000 + sub_version
00110
00111 For example, 4.1.12 is returned as 4001012.
00112 }
00113 {
00114 function TZAbstractPlainDriver.GetClientVersion: Integer;
00115 begin
00116 Result := 0;
00117 end;
00118 }
00119 {**
00120 Get Decoded the values of a Client's Full Version encoded with the format:
00121 (major_version * 1,000,000) + (minor_version * 1,000) + sub_version
00122 @param FullVersion an integer containing the Full Version to decode.
00123 @param MajorVersion an integer containing the Major Version decoded.
00124 @param MinorVersion an integer containing the Minor Version decoded.
00125 @param SubVersion an integer contaning the Sub Version (revision) decoded.
00126 }
00127 {
00128 procedure TZAbstractPlainDriver.GetClientVersionEx(out MajorVersion,
00129 MinorVersion, SubVersion: integer);
00130 begin
00131 ZSysUtils.DecodeVersion(GetClientVersion,
00132 MajorVersion, MinorVersion, SubVersion);
00133 end;
00134 }
00135 {**
00136 Gets the servers's full version number. Initially this should be 0.
00137 @return the server's full version number in the format XYYYZZZ where:
00138 X = major_version
00139 YYY = minor_version
00140 ZZZ = sub_version
00141
00142 Version number must be encoded the way below:
00143 server_version := major_version*1000000 + minor_version *1000 + sub_version
00144
00145 For example, 4.1.12 is returned as 4001012.
00146 }
00147 {
00148 function TZAbstractPlainDriver.GetServerVersion: Integer;
00149 begin
00150 Result := 0;
00151 end;
00152 }
00153 {**
00154 Get Decoded the values of a Server's Full Version encoded with the format:
00155 (major_version * 1,000,000) + (minor_version * 1,000) + sub_version
00156 @param FullVersion an integer containing the Full Version to decode.
00157 @param MajorVersion an integer containing the Major Version decoded.
00158 @param MinorVersion an integer containing the Minor Version decoded.
00159 @param SubVersion an integer contaning the Sub Version (revision) decoded.
00160 }
00161 {
00162 procedure TZAbstractPlainDriver.GetServerVersionEx(out MajorVersion,
00163 MinorVersion, SubVersion: integer);
00164 begin
00165 ZSysUtils.DecodeVersion(GetServerVersion,
00166 MajorVersion, MinorVersion, SubVersion);
00167 end;
00168 }
00169 end.
00170