Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/express/windowsRegistry.h

Go to the documentation of this file.
00001 // Filename: windowsRegistry.h
00002 // Created by:  drose (06Aug01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef WINDOWSREGISTRY_H
00020 #define WINDOWSREGISTRY_H
00021 
00022 #include "pandabase.h"
00023 
00024 // This class is only defined on Windows builds.
00025 #ifdef WIN32_VC
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : WindowsRegistry
00029 // Description : This class provides a hook to Python to read and
00030 //               write strings and integers to the windows registry.
00031 //               It automatically converts strings from utf-8 encoding
00032 //               and stores them in Unicode (and conversely reconverts
00033 //               them on retrieval).
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDAEXPRESS WindowsRegistry {
00036 PUBLISHED:
00037   static bool set_string_value(const string &key, const string &name,
00038                                const string &value);
00039   static bool set_int_value(const string &key, const string &name, int value);
00040 
00041   enum Type {
00042     T_none,
00043     T_int,
00044     T_string,
00045   };
00046   static Type get_key_type(const string &key, const string &name);
00047   static string get_string_value(const string &key, const string &name,
00048                                  const string &default_value);
00049   static int get_int_value(const string &key, const string &name,
00050                            int default_value);
00051 
00052 private:
00053   static bool do_set(const string &key, const string &name,
00054                      int data_type, const void *data, int data_length);
00055   static bool do_get(const string &key, const string &name,
00056                      int &data_type, string &data);
00057   static string format_message(int error_code);
00058 };
00059 
00060 #endif  // WIN32_VC
00061 
00062 #endif

Generated on Fri May 2 00:38:51 2003 for Panda by doxygen1.3