Topic Path: Symbol Reference > Files > IdSys.pas
ContentsIndexHome
PreviousUpNext
IdSys.pas

Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL.

IdSys.pas contains classes and types needed to minimize dependencies on platform-specific APIs as used in the the Borland RTL (Run-Time Library). 

The Sys class instance in the unit provides primarily class methods that can be called without requiring an explicit instance of the class. These methods are provided to minimize dependencies on RTL where its' implementation may require Operating System- or platform-specific API calls that may not be available on all platforms, including use of VCL-specific classes, procedures, and functions that are not available for VS.Net distributions of the Indy library. 

Please note that additional units provide platform-specific implementations, and are included based on the following defines: 

 

Define 
Unit 
Description 
DotNetDistro 
.Net without VCL dependencies 
MSWindows 
Windows API 
Linux 
Linux API 
 
VCL.Net dependencies 
 
Base class for all platforms 

 

Exceptions are another area where platform-specific implementations of the Exception and EIdExceptionBase classes can provide difficulties in maintaining a single-source code base for the Indy library. All exception raised by the Indy library must descend from EIdException and not from EIdExceptionBase. EIdExceptionBase is the base class that differentiates Indy exceptions from non-Indy exceptions in a cross- platform manner. In IdSys.pas, EIdExceptionBase is an alias that references the correct ancestor class for the platform using the folowing defines: 

 

Define 
Ancestor class 
DotNetDistro 
System.Exception 
All Other platforms 
SysUtils.Exception 

 

In a similar manner, aliases are used for the EAbort and the Exception types to ensure that the correct platform-specific implementations are used. For .Net platforms not based on VCL, EAbort and Exception are aliased in the following manner: 

 

Symbol 
Alias 
EAbort 
IdSysNET.EAbort 
Exception 
System.Exception 

 

For all other platforms where VCL is used, EAbort and Exception are aliased in the following manner: 

Symbol Alias

--------- ------------------

Exception SysUtils.Exception EAbort SysUtils.EAbort  

Finally, the implementation of a date and time value differs for the platform hosting the Indy library. To isolate this difference, Indy uses a TIdDateTimeBase type as the ancestor for all date and time values used in the library. For platforms using VCL, TIdDateTimeBase is an alias for the TDateTime type. For .Net platforms not using VCL, TIdDateTimeBase is an alias for the Double type defined in the framework class library. IdSys.pas defines the TIdDateTime type using the TIdDateTimeBaser alias declared for the host platform.

Sys 

EAbort 

Exception 

EIdExceptionBase 

TIdDateTime 

IdSysBase.pas 

IdSysLinux.pas 

IdSysNet.pas 

IdSysVCL.pas 

IdSysWin32.pas

Class 
Description 
Sys 
Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL. 
Type 
Description 
EAbort 
Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL. 
EIdExceptionBase 
Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL. 
Exception 
Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL. 
TIdDateTime 
Contains classes and types needed to minimize dependencies on platform-specific APIs and the Borland RTL. 
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.