Add SetPropertyBool() and GetPropertyBool() convenience functions.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@777 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2010-07-10 10:53:39 +00:00
parent e6516329b9
commit 6d8ea48ed4
1 changed files with 24 additions and 2 deletions

View File

@ -198,10 +198,10 @@ public:
/** Set an integer configuration property. /** Set an integer configuration property.
* @param szName Name of the property. All supported properties * @param szName Name of the property. All supported properties
* are defined in the aiConfig.g header (all constants share the * are defined in the aiConfig.g header (all constants share the
* prefix AI_CONFIG_XXX). * prefix AI_CONFIG_XXX and are simple strings).
* @param iValue New value of the property * @param iValue New value of the property
* @param bWasExisting Optional pointer to receive true if the * @param bWasExisting Optional pointer to receive true if the
* property was set before. The new value replaced the old value * property was set before. The new value replaces the previous value
* in this case. * in this case.
* @note Property of different types (float, int, string ..) are kept * @note Property of different types (float, int, string ..) are kept
* on different stacks, so calling SetPropertyInteger() for a * on different stacks, so calling SetPropertyInteger() for a
@ -211,6 +211,17 @@ public:
void SetPropertyInteger(const char* szName, int iValue, void SetPropertyInteger(const char* szName, int iValue,
bool* bWasExisting = NULL); bool* bWasExisting = NULL);
// -------------------------------------------------------------------
/** Set a boolean configuration property. Boolean properties
* are stored on the integer stack internally so it's possible
* to set them via #SetPropertyBool and query them with
* #GetPropertyBool and vice versa.
* @see SetPropertyInteger()
*/
void SetPropertyBool(const char* szName, bool value, bool* bWasExisting = NULL) {
SetPropertyInteger(szName,value);
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Set a floating-point configuration property. /** Set a floating-point configuration property.
* @see SetPropertyInteger() * @see SetPropertyInteger()
@ -241,6 +252,17 @@ public:
int GetPropertyInteger(const char* szName, int GetPropertyInteger(const char* szName,
int iErrorReturn = 0xffffffff) const; int iErrorReturn = 0xffffffff) const;
// -------------------------------------------------------------------
/** Get a boolean configuration property. Boolean properties
* are stored on the integer stack internally so it's possible
* to set them via #SetPropertyBool and query them with
* #GetPropertyBool and vice versa.
* @see GetPropertyInteger()
*/
bool GetPropertyBool(const char* szName, bool bErrorReturn = false) const {
return GetPropertyInteger(szName,bErrorReturn)!=0;
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Get a floating-point configuration property /** Get a floating-point configuration property
* @see GetPropertyInteger() * @see GetPropertyInteger()