Page principale | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Composants | Déclarations | Pages associées

MyRegistry.H

Aller à la documentation de ce fichier.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006 
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
00017 *********************************************************************************** */
00018 
00023 #ifndef INCLUDE_REGISTRY_H
00024 #define INCLUDE_REGISTRY_H
00025 
00026 #include "MyString.h"
00027 #include "MyList.h"
00028 #pragma comment(lib, "advapi32.lib")
00029 
00077 class MyRegistry  
00078 {
00079         public:
00080                 MyRegistry (BOOL autoCreate=FALSE);                                     
00081                 BOOL operator= (char *nameKey) { return Open(nameKey); }
00082                 BOOL Open(char *nameKey);                               
00083 
00084                 void GetKeyName(MyString &result);
00085                 BOOL Create(char *nameKey);
00086 
00087                 void SetAutoCreate(BOOL autoCreate);
00088                 BOOL IsAutoCreate();
00089 
00090                 int GetValueType(char *param);
00091                 int GetValueSize(char *param);
00092 
00093                 // SZ | EXPAND_SZ | MULTI_SZ
00094                 BOOL GetValue(char *param , char *result , char *defValue=NULL);                
00095                 // SZ | EXPAND_SZ | MULTI_SZ
00096                 BOOL GetValue(char *param, MyString &result , char *defValue=NULL);     
00097                 // MULTI_SZ
00098                 BOOL GetValueMulti(char *param, MyList<MyString> &result , char *defValue=NULL); 
00099                 // EXPAND_SZ
00100                 BOOL GetValueExpand(char *param, char *result , char *defValue=NULL); 
00101                 // EXPAND_SZ
00102                 BOOL GetValueExpand(char *param, MyString &result , char *defValue=NULL); 
00103                 // DWORD | DWORD_GE | DWORD_LE
00104                 BOOL GetValue(char *param,int *result,int defValue=0);                  
00105                 // DWORD | DWORD_GE | DWORD_LE
00106                 BOOL GetValue(char *param,DWORD *result,DWORD defValue=0);              
00107                 // QWORD | QWORD_LE
00108                 BOOL GetValue(char *param,LONGLONG *result,LONGLONG defValue=0);        
00109                 // BINARY
00110                 LPBYTE GetValue(char *param);
00111                 // SZ
00112                 BOOL GetValue(char *param,float *result,float defValue=0);
00113                 BOOL GetValue(char *param,double *result,double defValue=0);
00114 
00115                 BOOL SetValue(char *param);                                                                     //NONE
00116                 BOOL SetValue(char *param,int value);                                           //DWORD
00117                 BOOL SetValue(char *param,DWORD value);                                         //DWORD
00118                 BOOL SetValueLittleEndian(char *param,DWORD value);                     //DWORD_LE
00119                 BOOL SetValueBigEndian(char *param,DWORD value);                        //DWORD_BE
00120                 BOOL SetValue(char *param,LONGLONG value);                                      //QWORD
00121                 BOOL SetValueLittleEndian(char *param,LONGLONG value);          //QWORD_LE
00122                 BOOL SetValue(char *param,char *value);                                         //SZ
00123                 BOOL SetValueExpand(char *param,char *value);                           //EXPAND_SZ
00124                 BOOL SetValueMulti(char *param,MyList<MyString> &lString);//MULTI_SZ
00125                 BOOL SetValueMulti(char *param,char *value);                            //MULTI_SZ
00126                 BOOL SetValue(char *param,LPBYTE data,int size);                        //BINARY
00127                 BOOL SetValue(char *param,float result);                                        //SZ
00128                 BOOL SetValue(char *param,double result);                                       //SZ
00129 
00130                 BOOL DeleteValue(char *param);
00131                 BOOL DeleteKey(char *nameKey=NULL);
00132 
00133                 BOOL TestValue(char *param);
00134                 BOOL TestKey();
00135                 int GetLastError() { return m_lastError; }
00136 
00137                 void BeginEnumKey() { m_numEnumKey = 0; }
00138                 BOOL NextEnumKey(char *result);
00139                 BOOL NextEnumKey(MyString &result);
00140 
00141                 void BeginEnumValue() { m_numEnumValue = 0; }
00142                 BOOL NextEnumValue (char *result);
00143                 BOOL NextEnumValue (MyString &result);
00144 
00145                 // MyString & operator() (char *param,char *type);// chargement /sauvegarde d'un parametre
00146                 
00147         private:
00148                 BOOL SetPrefixAndPostfix(char *nameKey);
00149                 BOOL SetKeyName(char *nameKey);
00150                 void HKeyToString (MyString &result);
00151                 LPBYTE GetValue(char *param ,DWORD uTypeResult);
00152                 BOOL SetValue(char *param,LPBYTE source,ULONG uTypeSource,ULONG sizeSource);
00153 
00154 
00155         private: 
00156                 HKEY m_hKey;
00157                 MyString m_postFixKey;
00158                 BOOL m_lastError;
00159 
00160                 int m_numEnumValue;
00161                 int m_numEnumKey;
00162 
00163                 BOOL m_isAutoCreate;
00164 };
00165 
00166 BOOL NextSubKey(MyString &key,MyString &subKey,MyString &suite);
00167 
00168 #endif 

Généré le Thu Apr 8 18:58:43 2004 pour SFC par doxygen 1.3.6