Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Widgets/vtkKWRegistryHelper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWRegistryHelper.h,v $
00004 
00005   Copyright (c) Kitware, Inc.
00006   All rights reserved.
00007   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00023 #ifndef __vtkKWRegistryHelper_h
00024 #define __vtkKWRegistryHelper_h
00025 
00026 #include "vtkObject.h"
00027 #include "vtkKWWidgets.h" // Needed for export symbols directives
00028 
00029 class KWWIDGETS_EXPORT vtkKWRegistryHelper : public vtkObject
00030 {
00031 public:
00033 
00034   static vtkKWRegistryHelper* New();
00035   vtkTypeRevisionMacro(vtkKWRegistryHelper, vtkObject);
00036   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00040 
00041   int ReadValue(const char *subkey, 
00042                 const char *key, char *value);
00044 
00046   int DeleteKey(const char *subkey, const char *key);
00047 
00049   int DeleteValue(const char *subkey, const char *key);
00050 
00052 
00053   int SetValue(const char *subkey, const char *key, 
00054                const char *value);
00056 
00058 
00059   int Open(const char *toplevel, const char *subkey, 
00060            int readonly);
00062   
00064   int Close();
00065 
00067 
00070   vtkSetClampMacro(GlobalScope, int, 0, 1);
00071   vtkBooleanMacro(GlobalScope, int);
00072   vtkGetMacro(GlobalScope, int);
00074   
00076 
00077   vtkSetStringMacro(TopLevel);
00078   vtkGetStringMacro(TopLevel);
00080 
00082 
00083   vtkGetMacro(Opened, int);
00085 
00087 
00088   vtkGetMacro(Locked, int);
00090 
00091   //BTX
00092   enum {
00093     ReadOnly,
00094     ReadWrite
00095   };
00096 
00097   enum
00098   {
00099     RegistryKeyValueSizeMax = 8192,
00100     RegistryKeyNameSizeMax = 100
00101   };
00102   //ETX
00103 
00104 protected:
00105   vtkKWRegistryHelper();
00106   virtual ~vtkKWRegistryHelper();
00107 
00109 
00110   vtkSetClampMacro(Locked, int, 0, 1);
00111   vtkBooleanMacro(Locked, int);
00113 
00114   
00116   virtual int ReadValueInternal(const char *key, char *value) = 0;
00117   
00119   virtual int DeleteKeyInternal(const char *key) = 0;
00120 
00122   virtual int DeleteValueInternal(const char *key) = 0;
00123 
00125 
00126   virtual int SetValueInternal(const char *key, 
00127                                const char *value) = 0;
00129 
00131 
00132   virtual int OpenInternal(const char *toplevel, const char *subkey, 
00133                            int readonly) = 0;
00135   
00137   virtual int CloseInternal() = 0;
00138 
00140   int IsSpace(char c);
00141 
00143   char *Strip(char *str);
00144 
00145   int Opened;
00146   int Changed;
00147   int Empty;
00148    
00149 private:
00150   char *TopLevel;  
00151   int Locked;
00152   int GlobalScope;
00153 
00154   vtkKWRegistryHelper(const vtkKWRegistryHelper&); // Not implemented
00155   void operator=(const vtkKWRegistryHelper&); // Not implemented
00156 };
00157 
00158 #endif
00159 
00160 

Generated on Tue May 30 12:31:44 2006 for ParaView by doxygen 1.3.5