hxapihelp.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:3k
- /************************************************************************
- * hxsym_hxapi_help.h
- * -------------
- *
- * Synopsis:
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- ************************************************************************/
- #ifndef hxsym_hxapi_help_h
- #define hxsym_hxapi_help_h
- #include "hxcom.h"
- #include "hxmon.h" // HXPropType
- // forward decl
- _INTERFACE IHXRegistry;
- _INTERFACE IHXCommonClassFactory;
- _INTERFACE IHXBuffer;
- _INTERFACE IHXValues;
- _INTERFACE IHXPreferences;
- class CHXString;
- class CHXMapStringToString;
- // IHXRegistry helpers
- namespace reg
- {
- bool GetPropName(IHXRegistry* pReg, UINT32 idKey, CHXString& strName);
- bool GetString(IHXRegistry* pReg, const char* pszBase, const char* pszKey, CHXString& strValue, bool bIsBuffer);
- HX_RESULT AddString(IHXRegistry* pReg,
- IHXCommonClassFactory* pFactory,
- const char* pszBaseKey,
- const char* pszKey,
- const char* pszVal);
- const char* ScanPastKeyPrefix( const char* psz, const char* pszPrefix);
- const char* ScanKeyNodes( const char* psz, UINT32 nNodeCount, CHXString& strExtracted );
- } // ns reg
- // IHXBuffer helpers
- namespace buf
- {
- HX_RESULT Create(IHXCommonClassFactory* pFactory, const char* psz, IHXBuffer*& pbuffNew);
- } // ns buf
- // IHXValues helpers
- namespace val
- {
- enum ValType
- {
- string, buffer
- };
- bool GetBool(IHXValues* pval, const char* pszKey, bool& b);
- bool GetString(IHXValues* pval, const char* pszKey, CHXString& strVal, ValType propType = string);
- bool GetUINT16(IHXValues* pval, const char* pszKey, UINT16& nOut);
- bool GetUINT32(IHXValues* pval, const char* pszKey, UINT32& nOut);
- void GetStringProps(IHXValues* pval, ValType type, CHXMapStringToString& props);
- } // ns val
- // IHXPreferences helpers
- namespace prefs
- {
- // return found value, or default if not found
- CHXString GetString(IHXPreferences* pPrefs, const char* pKey, const char* pszDefault = "");
- bool GetBool(IHXPreferences* pPrefs, const char* pKey, bool bDefaultValue = false);
- UINT32 GetUINT32(IHXPreferences* pPrefs, const char* pKey, UINT32 defaultValue = 0);
- INT32 GetINT32(IHXPreferences* pPrefs, const char* pKey, INT32 defaultValue = 0);
-
- // return 'true' if value found (and set)
- bool LookupString(IHXPreferences* pPrefs, const char* pKey, CHXString& strOut);
- bool LookupBool(IHXPreferences* pPrefs, const char* pKey, bool& bValOut);
- bool LookupUINT32(IHXPreferences* pPrefs, const char* pKey, UINT32& valOut);
- bool LookupINT32(IHXPreferences* pPrefs, const char* pKey, INT32& valOut);
-
- void Write(IHXCommonClassFactory* pFactory, IHXPreferences* pPrefs, const char* pKey, const char* pszVal);
- void Write(IHXCommonClassFactory* pFactory, IHXPreferences* pPrefs, const char* pKey, UINT32 val);
- } // ns prefs
- /*template< class T >
- class CHXArray
- : public CHXPtrArray
- {
- };*/
- #endif //hxsym_hxapi_help_h