/source/Delphi/System/IdObjs.pas

# · Pascal · 193 lines · 125 code · 22 blank · 46 comment · 4 complexity · 1bacacd4e24d35bb00a8776e046ad116 MD5 · raw file

  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. unit IdObjs;
  17. {$I IdCompilerDefines.inc}
  18. interface
  19. uses
  20. {$IFDEF DotNet}
  21. {$IFDEF DotNetDistro}
  22. IdObjsFCL
  23. {$ELSE}
  24. Classes,
  25. SysUtils
  26. {$ENDIF}
  27. {$ELSE}
  28. Classes,
  29. SysUtils
  30. {$ENDIF};
  31. type
  32. {$IFDEF DotNetDistro}
  33. TIdBaseObject = &Object;
  34. TIdPersistent = TIdNetPersistent;
  35. TIdPersistentHelper = class helper (TIdNetPersistentHelper) for TIdPersistent
  36. public
  37. constructor Create; override;
  38. end;
  39. TIdNativeComponent = TIdNetNativeComponent;
  40. TIdNativeComponentHelper = class helper (TIdNetNativeComponentHelper) for TIdNativeComponent
  41. end;
  42. TIdNativeComponentState = TIdNetNativeComponentState;
  43. TIdOperation = TIdNetNativeOperation;
  44. TIdStrings = TIdStringsFCL;
  45. TIdStringList = TIdStringListFCL;
  46. TIdStream = TIdNetStream;
  47. TIdMemoryStream = TIdNetMemoryStream;
  48. TIdStringStream = TIdNetStringStream;
  49. TIdFileStream = TIdNetFileStream;
  50. TIdComponentName = TIdNetComponentName;
  51. TIdSeekOrigin = TIdNetSeekOrigin;
  52. TIdList = TIdNetList;
  53. TIdCollection = TIdNetCollection;
  54. TIdCollectionItem = TIdNetCollectionItem;
  55. TIdNativeThread = TIdNetThread;
  56. TIdThreadMethod = TIdNetThreadMethod;
  57. TIdNotifyEvent = TIdNetNotifyEvent;
  58. TIdThreadList = TIdNetThreadList;
  59. TidOwnedCollection = TIdNetOwnedCollection;
  60. TIdMultiReadExclusiveWriteSynchronizer = TIdNetMultiReadExclusiveWriteSynchronizer;
  61. {$ELSE}
  62. {$IFDEF DELPHI5}
  63. TSeekOrigin = Word;
  64. {$ENDIF}
  65. {$IFDEF DOTNET}
  66. TIdNativeComponent = TComponent;
  67. TIdNativeComponentState = TComponentState;
  68. TIdNativeComponentHelper = class helper (TComponentHelper) for TIdNativeComponent
  69. end;
  70. TIdPersistent = TPersistent;
  71. TIdPersistantHelper = class helper(TPersistentHelper) for TIdPersistent
  72. end;
  73. {$ELSE}
  74. TIdPersistent = TPersistent;
  75. TIdNativeComponent = TComponent;
  76. {$ENDIF}
  77. TIdOperation = TOperation;
  78. TIdBaseObject = TObject;
  79. TIdStrings = Classes.TStrings;
  80. TIdStringList = Classes.TStringList;
  81. TIdStream = TStream;
  82. TIdComponentName = TComponentName;
  83. TIdMemoryStream = TMemoryStream;
  84. TIdStringStream = TStringStream;
  85. TIdFileStream = TFileStream;
  86. TIdSeekOrigin = TSeekOrigin;
  87. TIdList = TList;
  88. TIdCollection = TCollection;
  89. TIdCollectionItem = TCollectionItem;
  90. TIdNativeThread = TThread;
  91. TIdThreadMethod = TThreadMethod;
  92. TIdNotifyEvent = TNotifyEvent;
  93. TIdThreadList = TThreadList;
  94. TIdOwnedCollection = TOwnedCollection;
  95. TIdMultiReadExclusiveWriteSynchronizer = TMultiReadExclusiveWriteSynchronizer;
  96. {$ENDIF}
  97. TIdComponentClass = class of TIdNativeComponent;
  98. const
  99. {$IFDEF DOTNET}
  100. IdFromBeginning = TIdSeekOrigin.soBeginning;
  101. IdFromCurrent = TIdSeekOrigin.soCurrent;
  102. IdFromEnd = TIdSeekOrigin.soEnd;
  103. fmCreate = $FFFF;
  104. fmOpenRead = $0000;
  105. fmOpenWrite = $0001;
  106. fmOpenReadWrite = $0002;
  107. fmShareExclusive = $0010;
  108. fmShareDenyWrite = $0020;
  109. fmShareDenyNone = $0040;
  110. {$ELSE}
  111. {$IFDEF DELPHI5}
  112. soBeginning = soFromBeginning;
  113. soCurrent = soFromCurrent;
  114. soEnd = soFromEnd;
  115. {$ENDIF}
  116. IdFromBeginning = TIdSeekOrigin(soBeginning);
  117. IdFromCurrent = TIdSeekOrigin(soCurrent);
  118. IdFromEnd = TIdSeekOrigin(soEnd);
  119. fmCreate = $FFFF;
  120. {$IFDEF LINUX}
  121. fmOpenRead = O_RDONLY;
  122. fmOpenWrite = O_WRONLY;
  123. fmOpenReadWrite = O_RDWR;
  124. fmShareExclusive = $0010;
  125. fmShareDenyWrite = $0020;
  126. fmShareDenyNone = $0030;
  127. {$ENDIF}
  128. {$IFDEF MSWINDOWS}
  129. fmOpenRead = $0000;
  130. fmOpenWrite = $0001;
  131. fmOpenReadWrite = $0002;
  132. fmShareExclusive = $0010;
  133. fmShareDenyWrite = $0020;
  134. fmShareDenyNone = $0040;
  135. {$ENDIF}
  136. {$ENDIF}
  137. {$IFDEF DotNetDistro}
  138. tpIdLowest = tpIdNetLowest;
  139. tpIdBelowNormal = tpIdNetBelowNormal;
  140. tpIdNormal = tpIdNetNormal;
  141. tpIdAboveNormal = tpIdNetAboveNormal;
  142. tpIdHighest = tpIdNetHighest;
  143. csLoading = IdObjsFCL.csLoading;
  144. csDesigning = IdObjsFCL.csDesigning;
  145. opRemove = IdObjsFCL.opRemove;
  146. {$ELSE}
  147. tpIdLowest = tpLowest;
  148. tpIdBelowNormal = tpLower;
  149. tpIdNormal = tpNormal;
  150. tpIdAboveNormal = tpHigher;
  151. tpIdHighest = tpHighest;
  152. csLoading = Classes.csLoading;
  153. csDesigning = Classes.csDesigning;
  154. opRemove = Classes.opRemove;
  155. {$ENDIF}
  156. iddupIgnore = dupIgnore;
  157. iddupAccept = dupAccept;
  158. iddupError = dupError;
  159. implementation
  160. uses
  161. IdGlobal, IdSys;
  162. {$IFDEF DotNetDistro}
  163. { TIdPersistentHelper }
  164. constructor TIdPersistentHelper.Create;
  165. begin
  166. inherited Create;
  167. end;
  168. {$ENDIF}
  169. end.