home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
REGISTRY.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
9KB
|
188 lines
//----------------------------------------------------------------------------
// Registry.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: Registry.pas
//----------------------------------------------------------------------------
#ifndef RegistryHPP
#define RegistryHPP
//----------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Windows.hpp>
#include <System.hpp>
#pragma warn -par
#pragma warn -hid
#pragma warn -inl
namespace Registry
{
//-- type declarations -------------------------------------------------------
class __declspec(delphiclass) ERegistryException;
class __declspec(pascalimplementation) ERegistryException : public Sysutils::Exception
{
typedef Sysutils::Exception inherited;
public:
/* Exception.Create */ __fastcall ERegistryException(const System::AnsiString Msg) : Sysutils::Exception(
Msg) { }
/* Exception.CreateFmt */ __fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec
* Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
/* Exception.CreateRes */ __fastcall ERegistryException(int Ident) : Sysutils::Exception(Ident) { }
/* Exception.CreateResFmt */ __fastcall ERegistryException(int Ident, const System::TVarRec * Args,
const int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
/* Exception.CreateHelp */ __fastcall ERegistryException(const System::AnsiString Msg, int AHelpContext
) : Sysutils::Exception(Msg, AHelpContext) { }
/* Exception.CreateFmtHelp */ __fastcall ERegistryException(const System::AnsiString Msg, const System::TVarRec
* Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
) { }
/* Exception.CreateResHelp */ __fastcall ERegistryException(int Ident, int AHelpContext) : Sysutils::
Exception(Ident, AHelpContext) { }
/* Exception.CreateResFmtHelp */ __fastcall ERegistryException(int Ident, const System::TVarRec * Args
, const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
) { }
public:
/* TObject.Destroy */ __fastcall virtual ~ERegistryException(void) { }
};
struct TRegKeyInfo
{
int NumSubKeys;
int MaxSubKeyLen;
int NumValues;
int MaxValueLen;
int MaxDataLen;
FILETIME FileTime;
} ;
enum TRegDataType { rdUnknown, rdString, rdExpandString, rdInteger, rdBinary };
struct TRegDataInfo
{
TRegDataType RegData;
int DataSize;
} ;
class __declspec(delphiclass) TRegistry;
class __declspec(pascalimplementation) TRegistry : public System::TObject
{
typedef System::TObject inherited;
private:
HKEY FCurrentKey;
HKEY FRootKey;
bool FLazyWrite;
System::AnsiString FCurrentPath;
bool FCloseRootKey;
void __fastcall SetRootKey(HKEY Value);
protected:
void __fastcall ChangeKey(HKEY Value, const System::AnsiString Path);
HKEY __fastcall GetBaseKey(bool Relative);
int __fastcall GetData(const System::AnsiString Name, void * Buffer, int BufSize, TRegDataType &RegData
);
HKEY __fastcall GetKey(const System::AnsiString Key);
void __fastcall PutData(const System::AnsiString Name, void * Buffer, int BufSize, TRegDataType RegData
);
void __fastcall SetCurrentKey(HKEY Value);
public:
__fastcall TRegistry(void);
__fastcall virtual ~TRegistry(void);
void __fastcall CloseKey(void);
bool __fastcall CreateKey(const System::AnsiString Key);
bool __fastcall DeleteKey(const System::AnsiString Key);
bool __fastcall DeleteValue(const System::AnsiString Name);
bool __fastcall GetDataInfo(const System::AnsiString ValueName, TRegDataInfo &Value);
int __fastcall GetDataSize(const System::AnsiString ValueName);
TRegDataType __fastcall GetDataType(const System::AnsiString ValueName);
bool __fastcall GetKeyInfo(TRegKeyInfo &Value);
void __fastcall GetKeyNames(Classes::TStrings* Strings);
void __fastcall GetValueNames(Classes::TStrings* Strings);
bool __fastcall HasSubKeys(void);
bool __fastcall KeyExists(const System::AnsiString Key);
bool __fastcall LoadKey(const System::AnsiString Key, const System::AnsiString FileName);
void __fastcall MoveKey(const System::AnsiString OldName, const System::AnsiString NewName, bool Delete
);
bool __fastcall OpenKey(const System::AnsiString Key, bool CanCreate);
System::Currency __fastcall ReadCurrency(const System::AnsiString Name);
int __fastcall ReadBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);
bool __fastcall ReadBool(const System::AnsiString Name);
System::TDateTime __fastcall ReadDate(const System::AnsiString Name);
System::TDateTime __fastcall ReadDateTime(const System::AnsiString Name);
double __fastcall ReadFloat(const System::AnsiString Name);
int __fastcall ReadInteger(const System::AnsiString Name);
System::AnsiString __fastcall ReadString(const System::AnsiString Name);
System::TDateTime __fastcall ReadTime(const System::AnsiString Name);
bool __fastcall RegistryConnect(const System::AnsiString UNCName);
void __fastcall RenameValue(const System::AnsiString OldName, const System::AnsiString NewName);
bool __fastcall ReplaceKey(const System::AnsiString Key, const System::AnsiString FileName, const System::AnsiString
BackUpFileName);
bool __fastcall RestoreKey(const System::AnsiString Key, const System::AnsiString FileName);
bool __fastcall SaveKey(const System::AnsiString Key, const System::AnsiString FileName);
bool __fastcall UnLoadKey(const System::AnsiString Key);
bool __fastcall ValueExists(const System::AnsiString Name);
void __fastcall WriteCurrency(const System::AnsiString Name, System::Currency Value);
void __fastcall WriteBinaryData(const System::AnsiString Name, void *Buffer, int BufSize);
void __fastcall WriteBool(const System::AnsiString Name, bool Value);
void __fastcall WriteDate(const System::AnsiString Name, System::TDateTime Value);
void __fastcall WriteDateTime(const System::AnsiString Name, System::TDateTime Value);
void __fastcall WriteFloat(const System::AnsiString Name, double Value);
void __fastcall WriteInteger(const System::AnsiString Name, int Value);
void __fastcall WriteString(const System::AnsiString Name, const System::AnsiString Value);
void __fastcall WriteTime(const System::AnsiString Name, System::TDateTime Value);
__property HKEY CurrentKey = {read=FCurrentKey, nodefault};
__property System::AnsiString CurrentPath = {read=FCurrentPath, nodefault};
__property bool LazyWrite = {read=FLazyWrite, write=FLazyWrite, nodefault};
__property HKEY RootKey = {read=FRootKey, write=SetRootKey, nodefault};
};
class __declspec(delphiclass) TRegIniFile;
class __declspec(pascalimplementation) TRegIniFile : public TRegistry
{
typedef TRegistry inherited;
private:
System::AnsiString FFileName;
public:
__fastcall TRegIniFile(const System::AnsiString FileName);
HIDESBASE System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString
Ident, const System::AnsiString Default);
HIDESBASE void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident
, const System::AnsiString Value);
HIDESBASE long __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident
, long Default);
HIDESBASE void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident
, long Value);
HIDESBASE bool __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident
, bool Default);
HIDESBASE void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident
, bool Value);
void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings* Strings);
void __fastcall ReadSections(Classes::TStrings* Strings);
void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings* Strings);
void __fastcall EraseSection(const System::AnsiString Section);
HIDESBASE void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident
);
__property System::AnsiString FileName = {read=FFileName, nodefault};
public:
/* TRegistry.Destroy */ __fastcall virtual ~TRegIniFile(void) { }
};
//-- var, const, procedure ---------------------------------------------------
} /* namespace Registry */
#pragma warn .par
#pragma warn .hid
#pragma warn .inl
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Registry;
#endif
//-- end unit ----------------------------------------------------------------
#endif // Registry