Boolean Values

Detailed Description

Since Microsoft still doesn't fully support C99 and fails to provide <stdbool.h>, we need to roll our own. On the other hand this ensures a fixed size of 32 bits, too. 32 bits were chosen so that ARABool is consistent with the other enum-like data types such as ARAContentType. Since ARABool is only used in temporary structs that are valid only for the duration of a call and likely passed in a register in most cases, there's no point in trying to optimize for size by using 8 bit boolean types. Note that in order to avoid conversion warnings in Visual Studio, you should not directly cast bool to ARABool or vice versa, but instead use a ternary operator or a comparison like this:

araBool = (cppBool) ? kARATrue : kARAFalse;
cppBool = (araBool != kARAFalse);
constexpr ARABool kARAFalse
"false" value for ARABool.
Definition: ARAInterface.h:232
constexpr ARABool kARATrue
"true" value for ARABool.
Definition: ARAInterface.h:230

Providing conversion operators for ARABool for C++ that handle this automatically is alas no viable option, because ARABool is only a typedef so this would lead to side-effects for all conversions from the integer type that ARABool is defined upon.

Typedefs

typedef ARAInt32 ARABool
 Platform independent 32-bit boolean value.
 

Variables

constexpr ARABool kARATrue { 1 }
 "true" value for ARABool.
 
constexpr ARABool kARAFalse { 0 }
 "false" value for ARABool.