registry.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando / G Library *
  23. * *
  24. * $Archive:: /Commando/Code/wwlib/registry.h $*
  25. * *
  26. * $Author:: Patrick $*
  27. * *
  28. * $Modtime:: 8/16/01 11:28a $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  34. #if _MSC_VER >= 1000
  35. #pragma once
  36. #endif // _MSC_VER >= 1000
  37. #ifndef REGISTRY_H
  38. #define REGISTRY_H
  39. #ifndef ALWAYS_H
  40. #include "always.h"
  41. #endif
  42. #include "vector.h"
  43. #include "wwstring.h"
  44. #include "widestring.h"
  45. /*
  46. **
  47. */
  48. class RegistryClass {
  49. public:
  50. // Constructor & Destructor
  51. RegistryClass( const char * sub_key );
  52. ~RegistryClass( void );
  53. bool Is_Valid( void ) { return IsValid; }
  54. // Int data type access
  55. int Get_Int( const char * name, int def_value = 0 );
  56. void Set_Int( const char * name, int value );
  57. // Bool data type access
  58. bool Get_Bool( const char * name, bool def_value = false );
  59. void Set_Bool( const char * name, bool value );
  60. // Float data type access
  61. float Get_Float( const char * name, float def_value = 0.0f );
  62. void Set_Float( const char * name, float value );
  63. // String data type access
  64. char *Get_String( const char * name, char *value, int value_size,
  65. const char * default_string = NULL );
  66. void Get_String( const char * name, StringClass &string, const char *default_string = NULL);
  67. void Set_String( const char * name, const char *value );
  68. // Wide string data type access
  69. void Get_String( const WCHAR * name, WideStringClass &string, const WCHAR *default_string = NULL);
  70. void Set_String( const WCHAR * name, const WCHAR *value );
  71. // Binary data type access
  72. void Get_Bin( const char * name, void *buffer, int buffer_size );
  73. int Get_Bin_Size( const char * name );
  74. void Set_Bin( const char * name, const void *buffer, int buffer_size );
  75. // Value enumeration support
  76. void Get_Value_List( DynamicVectorClass<StringClass> &list );
  77. // Delete support
  78. void Delete_Value( const char * name);
  79. void Deleta_All_Values( void );
  80. private:
  81. int Key;
  82. bool IsValid;
  83. };
  84. #endif // REGISTRY_H