From 6d8ea48ed4e522f2cf9997b6c6b57810e9794f68 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 10 Jul 2010 10:53:39 +0000 Subject: [PATCH] Add SetPropertyBool() and GetPropertyBool() convenience functions. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@777 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- include/assimp.hpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/include/assimp.hpp b/include/assimp.hpp index 40dfabc92..9dc399493 100644 --- a/include/assimp.hpp +++ b/include/assimp.hpp @@ -198,10 +198,10 @@ public: /** Set an integer configuration property. * @param szName Name of the property. All supported properties * 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 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. * @note Property of different types (float, int, string ..) are kept * on different stacks, so calling SetPropertyInteger() for a @@ -211,6 +211,17 @@ public: void SetPropertyInteger(const char* szName, int iValue, 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. * @see SetPropertyInteger() @@ -241,6 +252,17 @@ public: int GetPropertyInteger(const char* szName, 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 * @see GetPropertyInteger()