Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions

Classes

struct  ArgumentList
 Holds a list of command-line arguments, and provides useful methods for searching and operating on them. More...
 
struct  ArgumentList::Argument
 One of the arguments in an ArgumentList. More...
 
struct  ConsoleApplication
 Represents a the set of commands that a console app can perform, and provides helper functions for performing them. More...
 
struct  ConsoleApplication::Command
 Represents a command that can be executed if its command-line arguments are matched. More...
 
struct  NullCheckedInvocation
 Some helper methods for checking a callable object before invoking with the specified arguments. More...
 
class  Result
 Represents the 'success' or 'failure' of an operation, and holds an associated error message to describe the error when there's a failure. More...
 
class  RuntimePermissions
 
struct  ScopeGuard< Fn >
 An easy way to ensure that a function is called at the end of the current scope. More...
 
class  ErasedScopeGuard
 A ScopeGuard that uses a std::function internally to allow type erasure. More...
 
class  Uuid
 A universally unique 128-bit identifier. More...
 
class  WindowsRegistry
 Contains some static helper functions for manipulating the MS Windows registry (Only available on Windows, of course!) More...
 

Macros

#define JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS(EnumType)
 Macro to enable bitwise operations for scoped enums (enum struct/class).
 

Typedefs

template<typename A , typename B >
using DisableIfSameOrDerived = std::enable_if_t<! std::is_base_of_v<A, std::remove_reference_t<B>>>
 Can be used to disable template constructors that would otherwise cause ambiguity with compiler-generated copy and move constructors.
 

Functions

template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr bool hasBitValueSet (EnumType enumValue, EnumType valueToLookFor) noexcept
 
template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr EnumType withBitValueSet (EnumType enumValue, EnumType valueToAdd) noexcept
 
template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr EnumType withBitValueCleared (EnumType enumValue, EnumType valueToRemove) noexcept
 
template<typename Object , typename OtherObject , typename Member , typename Other >
Object withMember (Object copy, Member OtherObject::*member, Other &&value)
 Copies an object, sets one of the copy's members to the specified value, and then returns the copy.
 
template<typename Fn >
 ScopeGuard (Fn) -> ScopeGuard< Fn >
 

Detailed Description

Macro Definition Documentation

◆ JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS

#define JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS ( EnumType)
Value:
static_assert (std::is_enum_v<EnumType>, \
"JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS " \
"should only be used with enum types"); \
constexpr auto operator& (EnumType a, EnumType b) \
{ \
using base_type = std::underlying_type<EnumType>::type; \
return static_cast<EnumType> (base_type (a) & base_type (b)); \
} \
constexpr auto operator| (EnumType a, EnumType b) \
{ \
using base_type = std::underlying_type<EnumType>::type; \
return static_cast<EnumType> (base_type (a) | base_type (b)); \
} \
constexpr auto operator~ (EnumType a) \
{ \
using base_type = std::underlying_type<EnumType>::type; \
return static_cast<EnumType> (~base_type (a)); \
} \
constexpr auto& operator|= (EnumType& a, EnumType b) \
{ \
a = (a | b); \
return a; \
} \
constexpr auto& operator&= (EnumType& a, EnumType b) \
{ \
a = (a & b); \
return a; \
}

Macro to enable bitwise operations for scoped enums (enum struct/class).

To use this, add the line JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS (MyEnum) after your enum declaration at file scope level.

e.g.

enum class MyEnum
{
one = 1 << 0,
two = 1 << 1,
three = 1 << 2
};
MyEnum e = MyEnum::one | MyEnum::two;
bool hasTwo = (e & MyEnum::two) != MyEnum{}; // true
bool hasTwo = hasBitValueSet (e, MyEnum::two); // true
e = withBitValueCleared (e, MyEnum::two);
bool hasTwo = hasBitValueSet (e, MyEnum::two); // false
constexpr bool hasBitValueSet(EnumType enumValue, EnumType valueToLookFor) noexcept
Definition juce_EnumHelpers.h:90
constexpr EnumType withBitValueCleared(EnumType enumValue, EnumType valueToRemove) noexcept
Definition juce_EnumHelpers.h:102
#define JUCE_DECLARE_SCOPED_ENUM_BITWISE_OPERATORS(EnumType)
Macro to enable bitwise operations for scoped enums (enum struct/class).
Definition juce_EnumHelpers.h:55

Typedef Documentation

◆ DisableIfSameOrDerived

template<typename A , typename B >
using DisableIfSameOrDerived = std::enable_if_t<! std::is_base_of_v<A, std::remove_reference_t<B>>>

Can be used to disable template constructors that would otherwise cause ambiguity with compiler-generated copy and move constructors.

Adapted from https://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/

Function Documentation

◆ hasBitValueSet()

template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr bool hasBitValueSet ( EnumType enumValue,
EnumType valueToLookFor )
constexprnoexcept

◆ withBitValueSet()

template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr EnumType withBitValueSet ( EnumType enumValue,
EnumType valueToAdd )
constexprnoexcept

◆ withBitValueCleared()

template<typename EnumType , std::enable_if_t< std::is_enum_v< EnumType >, int > = 0>
constexpr EnumType withBitValueCleared ( EnumType enumValue,
EnumType valueToRemove )
constexprnoexcept

◆ withMember()

template<typename Object , typename OtherObject , typename Member , typename Other >
Object withMember ( Object copy,
Member OtherObject::* member,
Other && value )

Copies an object, sets one of the copy's members to the specified value, and then returns the copy.

Referenced by Tolerance< Type >::withAbsolute(), MessageBoxOptions::withAssociatedComponent(), AudioProcessorParameterWithIDAttributes::withAutomatable(), AudioProcessorValueTreeStateParameterAttributes::withAutomatable(), RangedAudioParameterAttributes< Derived, Value >::withAutomatable(), WebBrowserComponent::Options::withBackend(), WebBrowserComponent::Options::WinWebView2::withBackgroundColour(), AudioProcessorValueTreeStateParameterAttributes::withBoolean(), WebBrowserComponent::Options::WinWebView2::withBuiltInErrorPageDisabled(), AudioProcessorParameterWithIDAttributes::withCategory(), AudioProcessorValueTreeStateParameterAttributes::withCategory(), RangedAudioParameterAttributes< Derived, Value >::withCategory(), midi_ci::ChannelAddress::withChannel(), ThreadPoolOptions::withDesiredThreadPriority(), midi_ci::DeviceOptions::withDeviceInfo(), AudioProcessorValueTreeStateParameterAttributes::withDiscrete(), WebBrowserComponent::Options::WinWebView2::withDLLLocation(), ToVarOptions::withExplicitVersion(), midi_ci::DeviceOptions::withFeatures(), midi_ci::DeviceOptions::withFunctionBlock(), midi_ci::ChannelAddress::withGroup(), MessageBoxOptions::withIconType(), JSON::FormatOptions::withIndentLevel(), AudioProcessorParameterWithIDAttributes::withInverted(), AudioProcessorValueTreeStateParameterAttributes::withInverted(), RangedAudioParameterAttributes< Derived, Value >::withInverted(), WebBrowserComponent::Options::withKeepPageLoadedWhenBrowserIsHidden(), AudioProcessorParameterWithIDAttributes::withLabel(), AudioProcessorValueTreeStateParameterAttributes::withLabel(), RangedAudioParameterAttributes< Derived, Value >::withLabel(), JSON::FormatOptions::withMaxDecimalPlaces(), Thread::RealtimeOptions::withMaximumProcessingTimeMs(), midi_ci::DeviceOptions::withMaxSysExSize(), MessageBoxOptions::withMessage(), AudioProcessorParameterWithIDAttributes::withMeta(), AudioProcessorValueTreeStateParameterAttributes::withMeta(), RangedAudioParameterAttributes< Derived, Value >::withMeta(), ThreadPoolOptions::withNumberOfThreads(), midi_ci::DeviceOptions::withOutputs(), MessageBoxOptions::withParentComponent(), Thread::RealtimeOptions::withPeriodMs(), Thread::RealtimeOptions::withPriority(), Thread::RealtimeOptions::withProcessingTimeMs(), midi_ci::DeviceOptions::withProductInstanceId(), midi_ci::DeviceOptions::withProfileDelegate(), midi_ci::DeviceOptions::withPropertyDelegate(), SocketOptions::withReceiveBufferSize(), Tolerance< Type >::withRelative(), SocketOptions::withSendBufferSize(), JSON::FormatOptions::withSpacing(), WebBrowserComponent::Options::WinWebView2::withStatusBarDisabled(), AudioProcessorValueTreeStateParameterAttributes::withStringFromValueFunction(), RangedAudioParameterAttributes< Derived, Value >::withStringFromValueFunction(), ThreadPoolOptions::withThreadName(), ThreadPoolOptions::withThreadStackSizeBytes(), MessageBoxOptions::withTitle(), WebBrowserComponent::Options::withUserAgent(), WebBrowserComponent::Options::WinWebView2::withUserDataFolder(), AudioProcessorValueTreeStateParameterAttributes::withValueFromStringFunction(), RangedAudioParameterAttributes< Derived, Value >::withValueFromStringFunction(), ToVarOptions::withVersionIncluded(), and WebBrowserComponent::Options::withWinWebView2Options().

◆ ScopeGuard()

template<typename Fn >
ScopeGuard ( Fn ) -> ScopeGuard< Fn >
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram