PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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