~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to fcl/inc/registry.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
                  BufSize: Integer; RegData: TRegDataType);
68
68
    procedure SetCurrentKey(Value: HKEY);
69
69
  public
70
 
    constructor Create;
 
70
    constructor Create; overload;
 
71
    constructor Create(aaccess:longword);
71
72
    destructor Destroy; override;
72
73
 
73
74
    function CreateKey(const Key: string): Boolean;
182
183
  SysRegCreate;
183
184
end;
184
185
 
 
186
Constructor TRegistry.Create(aaccess:longword);
 
187
 
 
188
begin
 
189
  Create;
 
190
  FAccess     := aaccess;
 
191
end;
 
192
 
185
193
Destructor TRegistry.Destroy;
186
194
begin
187
195
  CloseKey;
199
207
 
200
208
function TRegistry.GetBaseKey(Relative: Boolean): HKey;
201
209
begin
202
 
  If Relative Then
 
210
  If Relative and (CurrentKey<>0) Then
203
211
    Result := CurrentKey
204
212
  else
205
213
    Result := RootKey;
320
328
 
321
329
begin
322
330
  GetDataInfo(Name,Info);
323
 
  If Not (Info.RegData in [rdString,rdExpandString]) then
324
 
    Raise ERegistryException.CreateFmt(SInvalidRegType, [Name]);
325
 
  SetLength(Result,Info.DataSize);
326
 
  If Info.DataSize>0 then
 
331
  if info.datasize>0 then
327
332
    begin
328
 
    If StringSizeIncludesNull then
329
 
      SetLength(Result, Info.DataSize-1)
330
 
    else
331
 
      SetLength(Result, Info.DataSize);
332
 
    GetData(Name,@Result[1],Info.DataSize,Info.RegData);
333
 
    end;
 
333
     If Not (Info.RegData in [rdString,rdExpandString]) then
 
334
       Raise ERegistryException.CreateFmt(SInvalidRegType, [Name]);
 
335
     SetLength(Result,Info.DataSize);
 
336
     If StringSizeIncludesNull then
 
337
       SetLength(Result, Info.DataSize-1)
 
338
     else
 
339
       SetLength(Result, Info.DataSize);
 
340
     GetData(Name,@Result[1],Info.DataSize,Info.RegData);
 
341
   end
 
342
  else
 
343
    result:='';
334
344
end;
335
345
 
336
346
function TRegistry.ReadTime(const Name: string): TDateTime;