Files
envi-code/SourceCode/Code2026/tg_shs/inc/geo/TRegProperty.h
T
2026-09-28 15:28:50 +08:00

103 lines
2.2 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TRegProperty.h
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: ÀàµÄÉùÃ÷
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#ifndef _TREGPROPERTY_H_
#define _TREGPROPERTY_H_
#ifndef _TREGOBJECT_H_
#include "TRegObject.h"
#endif
class GEOAPI TRegProperty : public TRegObject
{
public :
TRegProperty ( const TRegProperty &);
TRegProperty ( LPCTSTR pszRootKey, LPCTSTR pszObjKey);
TRegProperty ( LPCTSTR pszRootKey, LPCTSTR pszObjKey, double dVersion);
virtual ~TRegProperty ();
virtual bool Init ();
virtual bool Read ();
virtual bool Store ();
TRegProperty & operator = ( const TRegProperty & );
CString GetVersion () const;
CString GetRootKey ( bool bVersionized) const;
void SetRootKey ( LPCTSTR pszRootKey , double dVersion );
void Register ( TRegObject * obj );
void Unregister( TRegObject * obj );
bool LookUp ( TRegObject * pobjLook , int *pIndex = NULL );
TRegObject * LookUp ( PRPHANDLE hSubkey );
PRPHANDLE CreateSubKey ( LPCTSTR pszSubkey , bool bVersionized = FALSE , LPCTSTR pszClassname = NULL );
TRegObject * GetRegObject ( PRPHANDLE Handle );
bool AttachValue ( PRPHANDLE hSubkey , int *nValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , bool *bValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , long *lValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , DWORD *dwValue , LPCTSTR pszName );
bool AttachValue ( PRPHANDLE hSubkey , CString *strValue , LPCTSTR pszName );
typedef enum
{
RegPTypeNONE,
RegPTypeLOCAL_MACHINE,
RegPTypeUSERS
} RegPropertyType ;
static bool ReadValue ( HKEY key,
const TCHAR * pszKey,
const TCHAR * pszValuename,
BYTE *pBuffer,
DWORD BufferSize);
protected :
TRegProperty ();
private:
void init ();
void clear ();
private:
bool m_bDeleting;
CString m_RootKey;
CString m_Version;
CString m_VersionKey;
CString m_CommonKey;
CPtrArray m_CRegObjectArray;
RegPropertyType m_RegPropertyType;
};
#endif