00001
00002 #ifndef jAPIresourcesH
00003 #define jAPIresourcesH
00004
00005
00006 #include <registry.hpp>
00007 #include "comctrls.hpp"
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 AnsiString __fastcall jREGreadString(HKEY _root, AnsiString _key, AnsiString _subkey);
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 bool __fastcall jREGwrite(HKEY _root, AnsiString _key, AnsiString _subkey, AnsiString _value);
00033
00034
00035 bool __fastcall jREGwrite(TRegistry * reg, const AnsiString & SubKey, const AnsiString & value);
00036 bool __fastcall jREGread(TRegistry * reg, const AnsiString & SubKey, AnsiString & value);
00037 bool __fastcall jREGwrite(TRegistry * reg, const AnsiString & SubKey,const unsigned int & value);
00038 bool __fastcall jREGread(TRegistry * reg, const AnsiString & SubKey, unsigned int & value);
00039 bool __fastcall jREGwrite(TRegistry * reg, const AnsiString & SubKey,const int & value);
00040 bool __fastcall jREGread(TRegistry * reg, const AnsiString & SubKey, int & value);
00041 bool __fastcall jREGwrite(TRegistry * reg, const AnsiString & SubKey,const bool & value);
00042 bool __fastcall jREGread(TRegistry * reg, const AnsiString & SubKey, bool & value);
00043 bool __fastcall jREGdeleteKey(TRegistry * reg, const AnsiString & Key);
00044 bool __fastcall jREGdeleteKeyAndEmptyParents(TRegistry * reg, const AnsiString & Key);
00045 bool __fastcall jREGparseKey(const AnsiString & Key, TStrings * sl);
00046
00047 class jResources
00048 {
00049 bool created;
00050 TTreeView * Tree;
00051 char m_delimiter;
00052
00053 public :
00054 jResources();
00055 jResources(Classes::TComponent * own, bool sorted=false);
00056 jResources(TTreeView * tree);
00057 ~jResources()
00058 {
00059 if (created) delete Tree;
00060 }
00061
00062 void __fastcall setDelimiter(char del);
00063
00064 bool __fastcall crypt(TMemoryStream * ms);
00065 bool __fastcall loadFromFile(AnsiString fileName);
00066 bool __fastcall loadFromStream(TMemoryStream * ms);
00067 bool __fastcall saveToFile(AnsiString fileName);
00068 bool __fastcall saveToStream(TMemoryStream * ms);
00069
00070
00071 bool __fastcall parseKey(AnsiString key, TStrings * sl);
00072
00073
00074 TTreeNode * __fastcall storeData(TStrings * sl);
00075 bool __fastcall store(AnsiString key, TStrings * sl = NULL);
00076 bool __fastcall storeList(AnsiString key, TStrings * sl);
00077 bool __fastcall storeTab(AnsiString key, TListItems * li);
00078 bool __fastcall storeTabRedondant(AnsiString key, TListItems * li);
00079
00080
00081 bool __fastcall remove(TTreeNode * node);
00082 bool __fastcall remove(AnsiString key);
00083
00084
00085 TTreeNode * __fastcall srchSubNode(AnsiString label, TTreeNode * parent);
00086 TTreeNode * __fastcall findNode(AnsiString key, bool create = false);
00087 bool __fastcall findData(AnsiString key, AnsiString & res);
00088
00089
00090 AnsiString __fastcall get(AnsiString key);
00091 bool __fastcall listSubKeys(AnsiString key, TStrings * sl);
00092 bool __fastcall listTab(AnsiString key, TListItems * li);
00093
00094
00095 bool __fastcall modify(AnsiString key, AnsiString texte);
00096 };
00097
00098 #endif