unit BaseEngine;
interface
type
TBaseResult = Cardinal;
TBaseHandle = Cardinal;
TBaseDateMonth = 1..12;
TBaseDateDay = 1..31;
TBaseTimeHour = 0..23;
TBaseTimeMinute = 0..59;
TBaseTimeSecond = 0..59;
TBaseDateTime =
record
Year : Word;
Month: TBaseDateMonth;
Day : TBaseDateDay;
Hour : TBaseTimeHour;
Minute : TBaseTimeMinute;
Second : TBaseTimeSecond;
end;
TBaseDate =
record
Year : Word;
Month: TBaseDateMonth;
Day : TBaseDateDay;
end;
TBaseTime =
record
Hour : TBaseTimeHour;
Minute : TBaseTimeMinute;
Second : TBaseTimeSecond;
end;
TBaseFileAttribute = ( bfaArchive, bfaDirectory, bfaHidden, bfaReadOnly, bfaSystem, bfaTemporary, bfaCompressed, bfaOffline, bfaNotContentIndexed, bfaEncrypted );
TBaseFileAttributes =
record
Archive : Boolean;
Hidden : Boolean;
Readonly : Boolean;
System : Boolean;
Temporary : Boolean;
Offline : Boolean;
NotContentIndexed : Boolean;
{ Not changeable }
Directory : Boolean;
Compressed : Boolean;
Encrypted : Boolean;
end;
TBaseFileOpenMethod = ( bfomClear, bfomOpen, bfomOpenExisting );
TBaseFileAccess =
set of ( bfaRead, bfaWrite );
TBaseFileShare =
set of ( bfsRead, bfsWrite, bsfDelete );
type
IBaseInterface =
interface(IInterface)
function GetHandle : Pointer;
stdcall;
end;
IBaseStream =
interface(IBaseInterface)
function GetSize : Cardinal;
stdcall;
function GetPosition : Cardinal;
stdcall;
function SetPosition(NewPosition : Cardinal) : Boolean;
stdcall;
function Seek(By : Integer) : Boolean;
stdcall;
function Read(
var Buffer; Len : Cardinal) : Boolean;
stdcall;
function Write(
var Buffer; Len : Cardinal): Boolean;
stdcall;
function Assign(Stream : IBaseStream) : Boolean;
stdcall;
function WriteTo(Stream : IBaseStream) : Boolean;
stdcall;
end;
IBaseIOStream =
interface(IBaseStream)
end;
IBaseFileInfo =
interface;
IBaseFile =
interface(IBaseIOStream)
function GetFileInfo(Extended : Boolean) : IBaseFileInfo;
stdcall;
end;
IBaseFileInfo =
interface(IBaseInterface)
function GetFullPath : PChar;
stdcall;
function GetRelativPath : PChar;
stdcall;
function ExtendInformation : Boolean;
stdcall;
function ReduceInformation : Boolean;
stdcall;
function GetAttributes : TBaseFileAttributes;
stdcall;
function GetAttribute(Attribute : TBaseFileAttribute) : Boolean;
stdcall;
function SetAttributes(AttributeBlock : TBaseFileAttributes) : Boolean;
stdcall;
function SetAttribute(Attribute : TBaseFileAttribute; Value : Boolean) : Boolean;
stdcall;
function GetCreateTime : TBaseDateTime;
stdcall;
function GetLastAccessTime : TBaseDateTime;
stdcall;
function GetLastWriteTime : TBaseDateTime;
stdcall;
end;
const
BASE_INVALID_HANDLE : TBaseHandle = $FFFFFFFF;
BaseEngineDll = '
BaseEngine.dll';
function BaseVersion : PChar;
stdcall;
external BaseEngineDll;
function BaseRevision : PChar;
stdcall;
external BaseEngineDll;
function BaseCompiled : PChar;
stdcall;
external BaseEngineDll;
function BaseGetErrorStr(Value : TBaseResult) : PChar;
stdcall;
external '
BaseEngine.dll';
function BaseGetLastErrorStr(Error : PCardinal) : PChar;
stdcall;
external '
BaseEngine.dll';
function BaseGetLastError : TBaseResult;
stdcall;
external '
BaseEngine.dll';
function BaseCloseHandle(
Handle : TBaseHandle) : Boolean;
stdcall;
external '
BaseEngine.dll';
function BaseTimeTickCreate : TBaseHandle;
stdcall;
external '
BaseEngine.dll';
function BaseTimeTickGap(
Handle : TBaseHandle) : Cardinal;
stdcall;
external '
BaseEngine.dll';
function BaseTimeTick(
Handle : TBaseHandle) : Cardinal;
stdcall;
external '
BaseEngine.dll';
function BaseTimeTickPerSec(
Handle : TBaseHandle) : Cardinal;
stdcall;
external '
BaseEngine.dll';
function BaseTimeTickReset(
Handle : TBaseHandle) : Boolean;
stdcall;
external '
BaseEngine.dll';
function BaseCreateFile(FileName : PChar; OpenMethod : TBaseFileOpenMethod;
Access : TBaseFileAccess; ShareMode : TBaseFileShare) : IBaseFile;
stdcall;
external '
BaseEngine.dll';
implementation
end.