home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / REGISTRY.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  9.3 KB  |  198 lines

  1. //----------------------------------------------------------------------------
  2. // Registry.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: Registry.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef RegistryHPP
  6. #define RegistryHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef SysUtilsHPP
  9. #include <SysUtils.hpp>
  10. #endif
  11.  
  12. #ifndef ClassesHPP
  13. #include <Classes.hpp>
  14. #endif
  15.  
  16. #ifndef WindowsHPP
  17. #include <Windows.hpp>
  18. #endif
  19.  
  20. #ifndef SystemHPP
  21. #include <System.hpp>
  22. #endif
  23.  
  24. namespace Registry
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. class __declspec(delphiclass) ERegistryException;
  28. class __declspec(pascalimplementation) ERegistryException : public Sysutils::Exception
  29. {
  30.     typedef ERegistryException ThisClass;
  31.     typedef Sysutils::Exception inherited;
  32.     
  33. public:
  34.     /* !! Exception.Create */ __fastcall ERegistryException(const System::AnsiString Msg) : Sysutils::Exception(
  35.         Msg) { }
  36.     /* !! Exception.CreateFmt */ __fastcall ERegistryException(const System::AnsiString Msg, const TVarRec 
  37.         *Args, const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  38.     /* !! Exception.CreateRes */ __fastcall ERegistryException(System::Integer Ident) : Sysutils::Exception(
  39.         Ident) { }
  40.     /* !! Exception.CreateResFmt */ __fastcall ERegistryException(System::Integer Ident, const TVarRec 
  41.         *Args, const System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  42.     /* !! Exception.CreateHelp */ __fastcall ERegistryException(const System::AnsiString Msg, System::Integer 
  43.         AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
  44.     /* !! Exception.CreateFmtHelp */ __fastcall ERegistryException(const System::AnsiString Msg, const 
  45.         TVarRec *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(
  46.         Msg, Args, Args_Size, AHelpContext) { }
  47.     /* !! Exception.CreateResHelp */ __fastcall ERegistryException(System::Integer Ident, System::Integer 
  48.         AHelpContext) : Sysutils::Exception(Ident, AHelpContext) { }
  49.     /* !! Exception.CreateResFmtHelp */ __fastcall ERegistryException(System::Integer Ident, const TVarRec 
  50.         *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Ident, 
  51.         Args, Args_Size, AHelpContext) { }
  52.     
  53. public:
  54.     /* !! TObject.Destroy */ __fastcall virtual ~ERegistryException(void) { }
  55.     
  56. };
  57.  
  58. struct TRegKeyInfo
  59. {
  60.     System::Integer NumSubKeys;
  61.     System::Integer MaxSubKeyLen;
  62.     System::Integer NumValues;
  63.     System::Integer MaxValueLen;
  64.     System::Integer MaxDataLen;
  65.     Windows::TFileTime FileTime;
  66. } ;
  67.  
  68. enum TRegDataType { rdUnknown, rdString, rdExpandString, rdInteger, rdBinary };
  69.  
  70. struct TRegDataInfo
  71. {
  72.     TRegDataType RegData;
  73.     System::Integer DataSize;
  74. } ;
  75.  
  76. class __declspec(delphiclass) TRegistry;
  77. class __declspec(pascalimplementation) TRegistry : public System::TObject
  78. {
  79.     typedef TRegistry ThisClass;
  80.     typedef System::TObject inherited;
  81.     
  82. private:
  83.     System::Integer FCurrentKey;
  84.     System::Integer FRootKey;
  85.     System::Boolean FLazyWrite;
  86.     System::AnsiString FCurrentPath;
  87.     System::Boolean FCloseRootKey;
  88.     void __fastcall SetRootKey(System::Integer Value);
  89.     
  90. protected:
  91.     void __fastcall ChangeKey(System::Integer Value, const System::AnsiString Path);
  92.     System::Integer __fastcall GetBaseKey(System::Boolean Relative);
  93.     System::Integer __fastcall GetData(const System::AnsiString Name, System::Pointer Buffer, System::Integer 
  94.         BufSize, TRegDataType &RegData);
  95.     System::Integer __fastcall GetKey(const System::AnsiString Key);
  96.     void __fastcall PutData(const System::AnsiString Name, System::Pointer Buffer, System::Integer BufSize
  97.         , TRegDataType RegData);
  98.     void __fastcall SetCurrentKey(System::Integer Value);
  99.     
  100. public:
  101.     __fastcall TRegistry(void);
  102.     __fastcall virtual ~TRegistry(void);
  103.     void __fastcall CloseKey(void);
  104.     System::Boolean __fastcall CreateKey(const System::AnsiString Key);
  105.     System::Boolean __fastcall DeleteKey(const System::AnsiString Key);
  106.     System::Boolean __fastcall DeleteValue(const System::AnsiString Name);
  107.     System::Boolean __fastcall GetDataInfo(const System::AnsiString ValueName, TRegDataInfo &Value);
  108.     System::Integer __fastcall GetDataSize(const System::AnsiString ValueName);
  109.     TRegDataType __fastcall GetDataType(const System::AnsiString ValueName);
  110.     System::Boolean __fastcall GetKeyInfo(TRegKeyInfo &Value);
  111.     void __fastcall GetKeyNames(Classes::TStrings *Strings);
  112.     void __fastcall GetValueNames(Classes::TStrings *Strings);
  113.     System::Boolean __fastcall HasSubKeys(void);
  114.     System::Boolean __fastcall KeyExists(const System::AnsiString Key);
  115.     System::Boolean __fastcall LoadKey(const System::AnsiString Key, const System::AnsiString FileName)
  116.         ;
  117.     void __fastcall MoveKey(const System::AnsiString OldName, const System::AnsiString NewName, System::Boolean 
  118.         Delete);
  119.     System::Boolean __fastcall OpenKey(const System::AnsiString Key, System::Boolean CanCreate);
  120.     System::Currency __fastcall ReadCurrency(const System::AnsiString Name);
  121.     System::Integer __fastcall ReadBinaryData(const System::AnsiString Name, void *Buffer, System::Integer 
  122.         BufSize);
  123.     System::Boolean __fastcall ReadBool(const System::AnsiString Name);
  124.     System::TDateTime __fastcall ReadDate(const System::AnsiString Name);
  125.     System::TDateTime __fastcall ReadDateTime(const System::AnsiString Name);
  126.     System::Double __fastcall ReadFloat(const System::AnsiString Name);
  127.     System::Integer __fastcall ReadInteger(const System::AnsiString Name);
  128.     System::AnsiString __fastcall ReadString(const System::AnsiString Name);
  129.     System::TDateTime __fastcall ReadTime(const System::AnsiString Name);
  130.     System::Boolean __fastcall RegistryConnect(const System::AnsiString UNCName);
  131.     void __fastcall RenameValue(const System::AnsiString OldName, const System::AnsiString NewName);
  132.     System::Boolean __fastcall ReplaceKey(const System::AnsiString Key, const System::AnsiString FileName
  133.         , const System::AnsiString BackUpFileName);
  134.     System::Boolean __fastcall RestoreKey(const System::AnsiString Key, const System::AnsiString FileName
  135.         );
  136.     System::Boolean __fastcall SaveKey(const System::AnsiString Key, const System::AnsiString FileName)
  137.         ;
  138.     System::Boolean __fastcall UnLoadKey(const System::AnsiString Key);
  139.     System::Boolean __fastcall ValueExists(const System::AnsiString Name);
  140.     void __fastcall WriteCurrency(const System::AnsiString Name, System::Currency Value);
  141.     void __fastcall WriteBinaryData(const System::AnsiString Name, void *Buffer, System::Integer BufSize
  142.         );
  143.     void __fastcall WriteBool(const System::AnsiString Name, System::Boolean Value);
  144.     void __fastcall WriteDate(const System::AnsiString Name, System::TDateTime Value);
  145.     void __fastcall WriteDateTime(const System::AnsiString Name, System::TDateTime Value);
  146.     void __fastcall WriteFloat(const System::AnsiString Name, System::Double Value);
  147.     void __fastcall WriteInteger(const System::AnsiString Name, System::Integer Value);
  148.     void __fastcall WriteString(const System::AnsiString Name, const System::AnsiString Value);
  149.     void __fastcall WriteTime(const System::AnsiString Name, System::TDateTime Value);
  150.     __property System::Integer CurrentKey = {read=FCurrentKey, nodefault};
  151.     __property System::AnsiString CurrentPath = {read=FCurrentPath, nodefault};
  152.     __property System::Boolean LazyWrite = {read=FLazyWrite, write=FLazyWrite, nodefault};
  153.     __property System::Integer RootKey = {read=FRootKey, write=SetRootKey, nodefault};
  154. };
  155.  
  156. class __declspec(delphiclass) TRegIniFile;
  157. class __declspec(pascalimplementation) TRegIniFile : public TRegistry
  158. {
  159.     typedef TRegIniFile ThisClass;
  160.     typedef TRegistry inherited;
  161.     
  162. private:
  163.     System::AnsiString FFileName;
  164.     
  165. public:
  166.     __fastcall TRegIniFile(const System::AnsiString FileName);
  167.     System::AnsiString __fastcall ReadString(const System::AnsiString Section, const System::AnsiString 
  168.         Ident, const System::AnsiString Default);
  169.     void __fastcall WriteString(const System::AnsiString Section, const System::AnsiString Ident, const System::AnsiString 
  170.         Value);
  171.     System::Longint __fastcall ReadInteger(const System::AnsiString Section, const System::AnsiString Ident
  172.         , System::Longint Default);
  173.     void __fastcall WriteInteger(const System::AnsiString Section, const System::AnsiString Ident, System::Longint 
  174.         Value);
  175.     System::Boolean __fastcall ReadBool(const System::AnsiString Section, const System::AnsiString Ident
  176.         , System::Boolean Default);
  177.     void __fastcall WriteBool(const System::AnsiString Section, const System::AnsiString Ident, System::Boolean 
  178.         Value);
  179.     void __fastcall ReadSection(const System::AnsiString Section, Classes::TStrings *Strings);
  180.     void __fastcall ReadSections(Classes::TStrings *Strings);
  181.     void __fastcall ReadSectionValues(const System::AnsiString Section, Classes::TStrings *Strings);
  182.     void __fastcall EraseSection(const System::AnsiString Section);
  183.     void __fastcall DeleteKey(const System::AnsiString Section, const System::AnsiString Ident);
  184.     __property System::AnsiString FileName = {read=FFileName, nodefault};
  185. public:
  186.     /* !! TRegistry.Destroy */ __fastcall virtual ~TRegIniFile(void) { }
  187.     
  188. };
  189.  
  190. //-- var, const, procedure ---------------------------------------------------
  191.  
  192. }    /* namespace Registry */
  193. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  194. using namespace Registry;
  195. #endif
  196. //-- end unit ----------------------------------------------------------------
  197. #endif    // Registry
  198.