📄 win32registryimpl.hpp
字号:
//// This file is part of the "More for C++" library//// Copyright (c) 1999-2003 by Thorsten Goertz (thorsten@goertz.com)//// The "More for C++" library is free software; you can redistribute it and/or// modify it under the terms of the license that comes with this package.//// Read "license.txt" for more details.//// THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES// OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.////////////////////////////////////////////////////////////////////////////////#ifndef WIN32REGISTRYIMPL_HPP#define WIN32REGISTRYIMPL_HPP////////////////////////////////////////////////////////////////////////////////// "windows.h" must have been included!!!#include <more/core/finalizable.hpp>#include <more/os/win32/win32registry.hpp>////////////////////////////////////////////////////////////////////////////////namespace more{ namespace os { namespace win32 { class Win32RegistryImpl: public Win32Registry { public: Win32RegistryImpl( HKEY hBaseKey ); virtual void createKey( const String& sKey ) throw( InvalidKey, KeyAlreadyExists ); virtual void destroyKey( const String& sKey ) throw( InvalidKey ); virtual Array<String> getSubKeys( const String& sKey ) throw( InvalidKey ); virtual Array<NumericValue> getNumericValues( const String& sKey ) throw( InvalidKey ); virtual Array<StringValue> getStringValues( const String& sKey ) throw( InvalidKey ); virtual void createNumericValue( const String& sKey, const NumericValue& ) throw( InvalidKey, InvalidValueName, ValueAlreadyExists ); virtual void createStringValue( const String& sKey, const StringValue& ) throw( InvalidKey, InvalidValueName, ValueAlreadyExists ); virtual void destroyValue( const String& sKey, const String& sName ) throw( InvalidKey, InvalidValueName ); virtual void setNumericValue( const String& sKey, const NumericValue& ) throw( InvalidKey, InvalidValueName ); virtual void setStringValue( const String& sKey, const StringValue& ) throw( InvalidKey, InvalidValueName ); virtual size_t getNumericValue( const String& sKey, const String& sName ) throw( InvalidKey, InvalidValueName ); virtual String getStringValue( const String& sKey, const String& sName ) throw( InvalidKey, InvalidValueName ); protected: bool getValue( HKEY hKey, DWORD& rnIndex, DWORD nTypeFilter, String& rsName, void* pBuffer, DWORD nBufferSize ); private: class HandleAllocator { public: HandleAllocator( HKEY hBaseKey, const String& sKey ); virtual ~HandleAllocator( ); HKEY getHandle( ) const { return m_hKey; } private: HKEY m_hKey; }; HKEY m_hBaseKey; }; } }}////////////////////////////////////////////////////////////////////////////////#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -