Detailed Description

Classes

class  Atomic< Type >
 Simple class to hold a primitive value and perform atomic operations on it. More...
 
class  ByteOrder
 Contains static methods for converting the byte order between different endiannesses. More...
 
struct  ContainerDeletePolicy< ObjectType >
 Used by container classes as an indirect way to delete an object of a particular type. More...
 
class  HeapBlock< ElementType, throwOnFailure >
 Very simple container class to hold a pointer to some data on the heap. More...
 
class  LeakedObjectDetector< OwnerClass >
 Embedding an instance of this class inside another class can be used as a low-overhead way of detecting leaked instances. More...
 
class  ScopedAutoReleasePool
 A handy C++ wrapper that creates and deletes an NSAutoreleasePool object using RAII. More...
 
class  MemoryBlock
 A class to hold a resizable block of raw data. More...
 
class  OptionalScopedPointer< ObjectType >
 Holds a pointer to an object which can optionally be deleted when this pointer goes out of scope. More...
 
class  ReferenceCountedObject
 A base class which provides methods for reference-counting. More...
 
class  SingleThreadedReferenceCountedObject
 Adds reference-counting to an object. More...
 
class  ReferenceCountedObjectPtr< ReferenceCountedObjectClass >
 A smart-pointer class which points to a reference-counted object. More...
 
class  ScopedPointer< ObjectType >
 This class holds a pointer which is automatically deleted when this object goes out of scope. More...
 
class  SharedResourcePointer< SharedObjectType >
 A smart-pointer that automatically creates and manages the lifetime of a shared static instance of a class. More...
 
class  WeakReference< ObjectType, ReferenceCountingType >
 This class acts as a pointer which will automatically become null if the object to which it points is deleted. More...
 
class  WeakReference< ObjectType, ReferenceCountingType >::Master
 This class is embedded inside an object to which you want to attach WeakReference pointers. More...
 
class  WeakReference< ObjectType, ReferenceCountingType >::SharedPointer
 This class is used internally by the WeakReference class - don't use it directly in your code! More...
 

Macros

#define JUCE_LEAK_DETECTOR(OwnerClass)
 This macro lets you embed a leak-detecting object inside a class. More...
 
#define JUCE_AUTORELEASEPOOL   @autoreleasepool
 A macro that can be used to easily declare a local ScopedAutoReleasePool object for RAII-based obj-C autoreleasing. More...
 
#define juce_UseDebuggingNewOperator
 (Deprecated) This was a Windows-specific way of checking for object leaks - now please use the JUCE_LEAK_DETECTOR instead. More...
 
#define juce_DeclareSingleton(classname, doNotRecreateAfterDeletion)
 Macro to declare member variables and methods for a singleton class. More...
 
#define juce_ImplementSingleton(classname)
 This is a counterpart to the juce_DeclareSingleton macro. More...
 
#define juce_DeclareSingleton_SingleThreaded(classname, doNotRecreateAfterDeletion)
 Macro to declare member variables and methods for a singleton class. More...
 
#define juce_DeclareSingleton_SingleThreaded_Minimal(classname)
 Macro to declare member variables and methods for a singleton class. More...
 
#define juce_ImplementSingleton_SingleThreaded(classname)
 This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro. More...
 
#define JUCE_DECLARE_WEAK_REFERENCEABLE(Class)
 Macro to easily allow a class to be made weak-referenceable. More...
 

Functions

void zeromem (void *memory, size_t numBytes) noexcept
 Fills a block of memory with zeros. More...
 
template<typename Type >
void zerostruct (Type &structure) noexcept
 Overwrites a structure or object with zeros. More...
 
template<typename Type >
void deleteAndZero (Type &pointer)
 Delete an object pointer, and sets the pointer to null. More...
 
template<typename Type , typename IntegerType >
Type * addBytesToPointer (Type *basePointer, IntegerType bytes) noexcept
 A handy function which adds a number of bytes to any type of pointer and returns the result. More...
 
template<typename Type , typename IntegerType >
Type * snapPointerToAlignment (Type *basePointer, IntegerType alignmentBytes) noexcept
 A handy function to round up a pointer to the nearest multiple of a given number of bytes. More...
 
template<typename Type1 , typename Type2 >
int getAddressDifference (Type1 *pointer1, Type2 *pointer2) noexcept
 A handy function which returns the difference between any two pointers, in bytes. More...
 
template<class Type >
Type * createCopyIfNotNull (const Type *objectToCopy)
 If a pointer is non-null, this returns a new copy of the object that it points to, or safely returns nullptr if the pointer is null. More...
 
template<typename Type >
Type readUnaligned (const void *srcPtr) noexcept
 A handy function to read un-aligned memory without a performance penalty or bus-error. More...
 
template<typename Type >
void writeUnaligned (void *dstPtr, Type value) noexcept
 A handy function to write un-aligned memory without a performance penalty or bus-error. More...
 
template<typename ReferenceCountedObjectClass >
bool operator== (const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object1, ReferenceCountedObjectClass *const object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<typename ReferenceCountedObjectClass >
bool operator== (const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object1, const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<typename ReferenceCountedObjectClass >
bool operator== (ReferenceCountedObjectClass *object1, const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<typename ReferenceCountedObjectClass >
bool operator!= (const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object1, const ReferenceCountedObjectClass *object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<typename ReferenceCountedObjectClass >
bool operator!= (const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object1, const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<typename ReferenceCountedObjectClass >
bool operator!= (ReferenceCountedObjectClass *object1, const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &object2) noexcept
 Compares two ReferenceCountedObjectPtrs. More...
 
template<class ObjectType >
bool operator== (const ScopedPointer< ObjectType > &pointer1, ObjectType *const pointer2) noexcept
 Compares a ScopedPointer with another pointer. More...
 
template<class ObjectType >
bool operator!= (const ScopedPointer< ObjectType > &pointer1, ObjectType *const pointer2) noexcept
 Compares a ScopedPointer with another pointer. More...
 
static JUCE_CONSTEXPR uint16 ByteOrder::swap (uint16 value) noexcept
 Swaps the upper and lower bytes of a 16-bit integer. More...
 
static uint32 ByteOrder::swap (uint32 value) noexcept
 Reverses the order of the 4 bytes in a 32-bit integer. More...
 
static uint64 ByteOrder::swap (uint64 value) noexcept
 Reverses the order of the 8 bytes in a 64-bit integer. More...
 
static JUCE_CONSTEXPR uint16 ByteOrder::swapIfBigEndian (uint16 value) noexcept
 Swaps the byte order of a 16-bit unsigned int if the CPU is big-endian. More...
 
static uint32 ByteOrder::swapIfBigEndian (uint32 value) noexcept
 Swaps the byte order of a 32-bit unsigned int if the CPU is big-endian. More...
 
static uint64 ByteOrder::swapIfBigEndian (uint64 value) noexcept
 Swaps the byte order of a 64-bit unsigned int if the CPU is big-endian. More...
 
static JUCE_CONSTEXPR int16 ByteOrder::swapIfBigEndian (int16 value) noexcept
 Swaps the byte order of a 16-bit signed int if the CPU is big-endian. More...
 
static int32 ByteOrder::swapIfBigEndian (int32 value) noexcept
 Swaps the byte order of a 32-bit signed int if the CPU is big-endian. More...
 
static int64 ByteOrder::swapIfBigEndian (int64 value) noexcept
 Swaps the byte order of a 64-bit signed int if the CPU is big-endian. More...
 
static float ByteOrder::swapIfBigEndian (float value) noexcept
 Swaps the byte order of a 32-bit float if the CPU is big-endian. More...
 
static double ByteOrder::swapIfBigEndian (double value) noexcept
 Swaps the byte order of a 64-bit float if the CPU is big-endian. More...
 
static JUCE_CONSTEXPR uint16 ByteOrder::swapIfLittleEndian (uint16 value) noexcept
 Swaps the byte order of a 16-bit unsigned int if the CPU is little-endian. More...
 
static uint32 ByteOrder::swapIfLittleEndian (uint32 value) noexcept
 Swaps the byte order of a 32-bit unsigned int if the CPU is little-endian. More...
 
static uint64 ByteOrder::swapIfLittleEndian (uint64 value) noexcept
 Swaps the byte order of a 64-bit unsigned int if the CPU is little-endian. More...
 
static JUCE_CONSTEXPR int16 ByteOrder::swapIfLittleEndian (int16 value) noexcept
 Swaps the byte order of a 16-bit signed int if the CPU is little-endian. More...
 
static int32 ByteOrder::swapIfLittleEndian (int32 value) noexcept
 Swaps the byte order of a 32-bit signed int if the CPU is little-endian. More...
 
static int64 ByteOrder::swapIfLittleEndian (int64 value) noexcept
 Swaps the byte order of a 64-bit signed int if the CPU is little-endian. More...
 
static float ByteOrder::swapIfLittleEndian (float value) noexcept
 Swaps the byte order of a 32-bit float if the CPU is little-endian. More...
 
static double ByteOrder::swapIfLittleEndian (double value) noexcept
 Swaps the byte order of a 64-bit float if the CPU is little-endian. More...
 
static uint32 ByteOrder::littleEndianInt (const void *bytes) noexcept
 Turns 4 bytes into a little-endian integer. More...
 
static JUCE_CONSTEXPR uint32 ByteOrder::littleEndianInt (char c1, char c2, char c3, char c4) noexcept
 Turns 4 characters into a little-endian integer. More...
 
static uint64 ByteOrder::littleEndianInt64 (const void *bytes) noexcept
 Turns 8 bytes into a little-endian integer. More...
 
static uint16 ByteOrder::littleEndianShort (const void *bytes) noexcept
 Turns 2 bytes into a little-endian integer. More...
 
static uint32 ByteOrder::bigEndianInt (const void *bytes) noexcept
 Turns 4 bytes into a big-endian integer. More...
 
static uint64 ByteOrder::bigEndianInt64 (const void *bytes) noexcept
 Turns 8 bytes into a big-endian integer. More...
 
static uint16 ByteOrder::bigEndianShort (const void *bytes) noexcept
 Turns 2 bytes into a big-endian integer. More...
 
static JUCE_CONSTEXPR bool ByteOrder::isBigEndian () noexcept
 Returns true if the current CPU is big-endian. More...
 
static int ByteOrder::littleEndian24Bit (const void *bytes) noexcept
 Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). More...
 
static int ByteOrder::bigEndian24Bit (const void *bytes) noexcept
 Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). More...
 
static void ByteOrder::littleEndian24BitToChars (int value, void *destBytes) noexcept
 Copies a 24-bit number to 3 little-endian bytes. More...
 
static void ByteOrder::bigEndian24BitToChars (int value, void *destBytes) noexcept
 Copies a 24-bit number to 3 big-endian bytes. More...
 

Macro Definition Documentation

◆ JUCE_LEAK_DETECTOR

#define JUCE_LEAK_DETECTOR (   OwnerClass)
Value:
friend class juce::LeakedObjectDetector<OwnerClass>; \
static const char* getLeakedObjectClassName() noexcept { return #OwnerClass; } \
juce::LeakedObjectDetector<OwnerClass> JUCE_JOIN_MACRO (leakDetector, __LINE__);
#define JUCE_JOIN_MACRO(item1, item2)
A good old-fashioned C macro concatenation helper.
Definition: juce_PlatformDefs.h:164

This macro lets you embed a leak-detecting object inside a class.

To use it, simply declare a JUCE_LEAK_DETECTOR(YourClassName) inside a private section of the class declaration. E.g.

class MyClass
{
public:
MyClass();
void blahBlah();
private:
};
See also
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR, LeakedObjectDetector

Referenced by SelectedItemSet< SelectableItemType >::changed(), dsp::Matrix< ElementType >::end(), SpeakerMappings::VstSpeakerConfigurationHolder::get(), RecentlyOpenedFilesList::getAllFilenames(), AttributedString::getAttribute(), MD5::getChecksumDataArray(), KeyPressMappingSet::getCommandManager(), PropertySet::getFallbackPropertySet(), GlyphArrangement::getNumGlyphs(), TextLayout::getNumLines(), Image::getPixelData(), dsp::Polynomial< FloatingType >::getProductWith(), DynamicObject::getProperties(), Uuid::getRawData(), SharedResourcePointer< SharedObjectType >::getReferenceCount(), Random::getSeed(), MemoryBlock::getSize(), dsp::StateVariableFilter::Filter< SampleType >::processSample(), dsp::FIR::Filter< SampleType >::processSample(), dsp::IIR::Filter< SampleType >::reset(), HashMap< KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse >::Iterator::resetToEnd(), AudioBuffer< float >::reverse(), PathStrokeType::setEndStyle(), StringPairArray::size(), CodeTokeniser::~CodeTokeniser(), InputSource::~InputSource(), and AudioPluginFormat::InstantiationCompletionCallback::~InstantiationCompletionCallback().

◆ JUCE_AUTORELEASEPOOL

#define JUCE_AUTORELEASEPOOL   @autoreleasepool

A macro that can be used to easily declare a local ScopedAutoReleasePool object for RAII-based obj-C autoreleasing.

Because this may use the @autoreleasepool syntax, you must follow the macro with a set of braces to mark the scope of the pool.

◆ juce_UseDebuggingNewOperator

#define juce_UseDebuggingNewOperator

(Deprecated) This was a Windows-specific way of checking for object leaks - now please use the JUCE_LEAK_DETECTOR instead.

◆ juce_DeclareSingleton

#define juce_DeclareSingleton (   classname,
  doNotRecreateAfterDeletion 
)

Macro to declare member variables and methods for a singleton class.

To use this, add the line juce_DeclareSingleton (MyClass, doNotRecreateAfterDeletion) to the class's definition.

Then put a macro juce_ImplementSingleton (MyClass) along with the class's implementation code.

It's also a very good idea to also add the call clearSingletonInstance() in your class's destructor, in case it is deleted by other means than deleteInstance()

Clients can then call the static method MyClass::getInstance() to get a pointer to the singleton, or MyClass::getInstanceWithoutCreating() which will return nullptr if no instance currently exists.

e.g.

class MySingleton
{
public:
MySingleton()
{
}
~MySingleton()
{
// this ensures that no dangling pointers are left when the
// singleton is deleted.
clearSingletonInstance();
}
juce_DeclareSingleton (MySingleton, false)
};
// example of usage:
MySingleton* m = MySingleton::getInstance(); // creates the singleton if there isn't already one.
...
MySingleton::deleteInstance(); // safely deletes the singleton (if it's been created).

If doNotRecreateAfterDeletion = true, it won't allow the object to be created more than once during the process's lifetime - i.e. after you've created and deleted the object, getInstance() will refuse to create another one. This can be useful to stop objects being accidentally re-created during your app's shutdown code.

If you know that your object will only be created and deleted by a single thread, you can use the slightly more efficient juce_DeclareSingleton_SingleThreaded() macro instead of this one.

See also
juce_ImplementSingleton, juce_DeclareSingleton_SingleThreaded

◆ juce_ImplementSingleton

#define juce_ImplementSingleton (   classname)
Value:
\
classname* classname::_singletonInstance = nullptr; \
juce::CriticalSection classname::_singletonLock;

This is a counterpart to the juce_DeclareSingleton macro.

After adding the juce_DeclareSingleton to the class definition, this macro has to be used in the cpp file.

◆ juce_DeclareSingleton_SingleThreaded

#define juce_DeclareSingleton_SingleThreaded (   classname,
  doNotRecreateAfterDeletion 
)

Macro to declare member variables and methods for a singleton class.

This is exactly the same as juce_DeclareSingleton, but doesn't use a critical section to make access to it thread-safe. If you know that your object will only ever be created or deleted by a single thread, then this is a more efficient version to use.

If doNotRecreateAfterDeletion = true, it won't allow the object to be created more than once during the process's lifetime - i.e. after you've created and deleted the object, getInstance() will refuse to create another one. This can be useful to stop objects being accidentally re-created during your app's shutdown code.

See the documentation for juce_DeclareSingleton for more information about how to use it, the only difference being that you have to use juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton.

See also
juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton, juce_DeclareSingleton_SingleThreaded_Minimal

◆ juce_DeclareSingleton_SingleThreaded_Minimal

#define juce_DeclareSingleton_SingleThreaded_Minimal (   classname)
Value:
\
static classname* _singletonInstance; \
\
static classname* getInstance() \
{ \
if (_singletonInstance == nullptr) \
_singletonInstance = new classname(); \
\
return _singletonInstance; \
} \
\
static inline classname* getInstanceWithoutCreating() noexcept\
{ \
return _singletonInstance; \
} \
\
static void deleteInstance() \
{ \
if (_singletonInstance != nullptr) \
{ \
classname* const old = _singletonInstance; \
_singletonInstance = nullptr; \
delete old; \
} \
} \
\
void clearSingletonInstance() noexcept\
{ \
if (_singletonInstance == this) \
_singletonInstance = nullptr; \
}

Macro to declare member variables and methods for a singleton class.

This is like juce_DeclareSingleton_SingleThreaded, but doesn't do any checking for recursion or repeated instantiation. It's intended for use as a lightweight version of a singleton, where you're using it in very straightforward circumstances and don't need the extra checking.

Juce use the normal juce_ImplementSingleton_SingleThreaded as the counterpart to this declaration, as you would with juce_DeclareSingleton_SingleThreaded.

See the documentation for juce_DeclareSingleton for more information about how to use it, the only difference being that you have to use juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton.

See also
juce_ImplementSingleton_SingleThreaded, juce_DeclareSingleton

Referenced by ModalComponentManager::Callback::~Callback().

◆ juce_ImplementSingleton_SingleThreaded

#define juce_ImplementSingleton_SingleThreaded (   classname)
Value:
\
classname* classname::_singletonInstance = nullptr;

This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro.

After adding juce_DeclareSingleton_SingleThreaded or juce_DeclareSingleton_SingleThreaded_Minimal to the class definition, this macro has to be used somewhere in the cpp file.

◆ JUCE_DECLARE_WEAK_REFERENCEABLE

#define JUCE_DECLARE_WEAK_REFERENCEABLE (   Class)
Value:
struct WeakRefMaster : public WeakReference<Class>::Master { ~WeakRefMaster() { this->clear(); } }; \
WeakRefMaster masterReference; \
friend class WeakReference<Class>; \
This class acts as a pointer which will automatically become null if the object to which it points is...
Definition: juce_WeakReference.h:78

Macro to easily allow a class to be made weak-referenceable.

This can be inserted in a class definition to add the requisite weak-ref boilerplate to that class. e.g.

class MyObject
{
public:
MyObject();
~MyObject();
private:
};
See also
WeakReference, WeakReference::Master

Function Documentation

◆ zeromem()

◆ zerostruct()

template<typename Type >
void zerostruct ( Type &  structure)
noexcept

Overwrites a structure or object with zeros.

Referenced by AudioUnitHelpers::ChannelRemapper::get().

◆ deleteAndZero()

template<typename Type >
void deleteAndZero ( Type &  pointer)

Delete an object pointer, and sets the pointer to null.

Remember that it's not good c++ practice to use delete directly - always try to use a ScopedPointer or other automatic lifetime-management system rather than resorting to deleting raw pointers!

Referenced by operator!=().

◆ addBytesToPointer()

template<typename Type , typename IntegerType >
Type* addBytesToPointer ( Type *  basePointer,
IntegerType  bytes 
)
noexcept

◆ snapPointerToAlignment()

template<typename Type , typename IntegerType >
Type* snapPointerToAlignment ( Type *  basePointer,
IntegerType  alignmentBytes 
)
noexcept

A handy function to round up a pointer to the nearest multiple of a given number of bytes.

alignmentBytes must be a power of two.

Referenced by dsp::AudioBlock< float >::AudioBlock(), dsp::SIMDRegister< Type >::getNextSIMDAlignedPtr(), and dsp::FIR::Filter< SampleType >::reset().

◆ getAddressDifference()

template<typename Type1 , typename Type2 >
int getAddressDifference ( Type1 *  pointer1,
Type2 *  pointer2 
)
noexcept

A handy function which returns the difference between any two pointers, in bytes.

The address of the second pointer is subtracted from the first, and the difference in bytes is returned.

Referenced by CharacterFunctions::copyWithDestByteLimit().

◆ createCopyIfNotNull()

template<class Type >
Type* createCopyIfNotNull ( const Type *  objectToCopy)

If a pointer is non-null, this returns a new copy of the object that it points to, or safely returns nullptr if the pointer is null.

Referenced by OwnedArray< MidiBuffer >::addCopiesOf(), and ScopedPointer< ListViewport >::createCopy().

◆ readUnaligned()

template<typename Type >
Type readUnaligned ( const void *  srcPtr)
noexcept

A handy function to read un-aligned memory without a performance penalty or bus-error.

◆ writeUnaligned()

template<typename Type >
void writeUnaligned ( void *  dstPtr,
Type  value 
)
noexcept

A handy function to write un-aligned memory without a performance penalty or bus-error.

◆ operator==() [1/4]

template<typename ReferenceCountedObjectClass >
bool operator== ( const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object1,
ReferenceCountedObjectClass *const  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator==() [2/4]

template<typename ReferenceCountedObjectClass >
bool operator== ( const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object1,
const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator==() [3/4]

template<typename ReferenceCountedObjectClass >
bool operator== ( ReferenceCountedObjectClass *  object1,
const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator!=() [1/4]

template<typename ReferenceCountedObjectClass >
bool operator!= ( const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object1,
const ReferenceCountedObjectClass *  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator!=() [2/4]

template<typename ReferenceCountedObjectClass >
bool operator!= ( const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object1,
const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator!=() [3/4]

template<typename ReferenceCountedObjectClass >
bool operator!= ( ReferenceCountedObjectClass *  object1,
const ReferenceCountedObjectPtr< ReferenceCountedObjectClass > &  object2 
)
noexcept

Compares two ReferenceCountedObjectPtrs.

◆ operator==() [4/4]

template<class ObjectType >
bool operator== ( const ScopedPointer< ObjectType > &  pointer1,
ObjectType *const  pointer2 
)
noexcept

Compares a ScopedPointer with another pointer.

This can be handy for checking whether this is a null pointer.

◆ operator!=() [4/4]

template<class ObjectType >
bool operator!= ( const ScopedPointer< ObjectType > &  pointer1,
ObjectType *const  pointer2 
)
noexcept

Compares a ScopedPointer with another pointer.

This can be handy for checking whether this is a null pointer.

References deleteAndZero().

◆ swap() [1/3]

JUCE_CONSTEXPR uint16 ByteOrder::swap ( uint16  value)
staticnoexcept

Swaps the upper and lower bytes of a 16-bit integer.

Referenced by ByteOrder::swap(), and ByteOrder::swapIfBigEndian().

◆ swap() [2/3]

uint32 ByteOrder::swap ( uint32  value)
staticnoexcept

Reverses the order of the 4 bytes in a 32-bit integer.

◆ swap() [3/3]

◆ swapIfBigEndian() [1/8]

JUCE_CONSTEXPR uint16 ByteOrder::swapIfBigEndian ( uint16  value)
staticnoexcept

Swaps the byte order of a 16-bit unsigned int if the CPU is big-endian.

Referenced by ByteOrder::swap().

◆ swapIfBigEndian() [2/8]

uint32 ByteOrder::swapIfBigEndian ( uint32  value)
staticnoexcept

Swaps the byte order of a 32-bit unsigned int if the CPU is big-endian.

◆ swapIfBigEndian() [3/8]

uint64 ByteOrder::swapIfBigEndian ( uint64  value)
staticnoexcept

Swaps the byte order of a 64-bit unsigned int if the CPU is big-endian.

◆ swapIfBigEndian() [4/8]

JUCE_CONSTEXPR int16 ByteOrder::swapIfBigEndian ( int16  value)
staticnoexcept

Swaps the byte order of a 16-bit signed int if the CPU is big-endian.

◆ swapIfBigEndian() [5/8]

int32 ByteOrder::swapIfBigEndian ( int32  value)
staticnoexcept

Swaps the byte order of a 32-bit signed int if the CPU is big-endian.

◆ swapIfBigEndian() [6/8]

int64 ByteOrder::swapIfBigEndian ( int64  value)
staticnoexcept

Swaps the byte order of a 64-bit signed int if the CPU is big-endian.

◆ swapIfBigEndian() [7/8]

float ByteOrder::swapIfBigEndian ( float  value)
staticnoexcept

Swaps the byte order of a 32-bit float if the CPU is big-endian.

References ByteOrder::swap().

◆ swapIfBigEndian() [8/8]

double ByteOrder::swapIfBigEndian ( double  value)
staticnoexcept

Swaps the byte order of a 64-bit float if the CPU is big-endian.

References ByteOrder::swap().

◆ swapIfLittleEndian() [1/8]

JUCE_CONSTEXPR uint16 ByteOrder::swapIfLittleEndian ( uint16  value)
staticnoexcept

Swaps the byte order of a 16-bit unsigned int if the CPU is little-endian.

Referenced by ByteOrder::swap().

◆ swapIfLittleEndian() [2/8]

uint32 ByteOrder::swapIfLittleEndian ( uint32  value)
staticnoexcept

Swaps the byte order of a 32-bit unsigned int if the CPU is little-endian.

◆ swapIfLittleEndian() [3/8]

uint64 ByteOrder::swapIfLittleEndian ( uint64  value)
staticnoexcept

Swaps the byte order of a 64-bit unsigned int if the CPU is little-endian.

◆ swapIfLittleEndian() [4/8]

JUCE_CONSTEXPR int16 ByteOrder::swapIfLittleEndian ( int16  value)
staticnoexcept

Swaps the byte order of a 16-bit signed int if the CPU is little-endian.

◆ swapIfLittleEndian() [5/8]

int32 ByteOrder::swapIfLittleEndian ( int32  value)
staticnoexcept

Swaps the byte order of a 32-bit signed int if the CPU is little-endian.

◆ swapIfLittleEndian() [6/8]

int64 ByteOrder::swapIfLittleEndian ( int64  value)
staticnoexcept

Swaps the byte order of a 64-bit signed int if the CPU is little-endian.

◆ swapIfLittleEndian() [7/8]

float ByteOrder::swapIfLittleEndian ( float  value)
staticnoexcept

Swaps the byte order of a 32-bit float if the CPU is little-endian.

◆ swapIfLittleEndian() [8/8]

double ByteOrder::swapIfLittleEndian ( double  value)
staticnoexcept

Swaps the byte order of a 64-bit float if the CPU is little-endian.

◆ littleEndianInt() [1/2]

uint32 ByteOrder::littleEndianInt ( const void *  bytes)
staticnoexcept

Turns 4 bytes into a little-endian integer.

Referenced by ByteOrder::swap().

◆ littleEndianInt() [2/2]

JUCE_CONSTEXPR uint32 ByteOrder::littleEndianInt ( char  c1,
char  c2,
char  c3,
char  c4 
)
staticnoexcept

Turns 4 characters into a little-endian integer.

◆ littleEndianInt64()

uint64 ByteOrder::littleEndianInt64 ( const void *  bytes)
staticnoexcept

Turns 8 bytes into a little-endian integer.

Referenced by ByteOrder::swap().

◆ littleEndianShort()

uint16 ByteOrder::littleEndianShort ( const void *  bytes)
staticnoexcept

Turns 2 bytes into a little-endian integer.

Referenced by ByteOrder::swap().

◆ bigEndianInt()

uint32 ByteOrder::bigEndianInt ( const void *  bytes)
staticnoexcept

Turns 4 bytes into a big-endian integer.

Referenced by ByteOrder::swap().

◆ bigEndianInt64()

uint64 ByteOrder::bigEndianInt64 ( const void *  bytes)
staticnoexcept

Turns 8 bytes into a big-endian integer.

Referenced by ByteOrder::swap().

◆ bigEndianShort()

uint16 ByteOrder::bigEndianShort ( const void *  bytes)
staticnoexcept

Turns 2 bytes into a big-endian integer.

Referenced by ByteOrder::swap().

◆ isBigEndian()

JUCE_CONSTEXPR bool ByteOrder::isBigEndian ( )
staticnoexcept

Returns true if the current CPU is big-endian.

Referenced by ByteOrder::swap().

◆ littleEndian24Bit()

int ByteOrder::littleEndian24Bit ( const void *  bytes)
staticnoexcept

Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).

◆ bigEndian24Bit()

int ByteOrder::bigEndian24Bit ( const void *  bytes)
staticnoexcept

Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).

◆ littleEndian24BitToChars()

void ByteOrder::littleEndian24BitToChars ( int  value,
void *  destBytes 
)
staticnoexcept

Copies a 24-bit number to 3 little-endian bytes.

◆ bigEndian24BitToChars()

void ByteOrder::bigEndian24BitToChars ( int  value,
void *  destBytes 
)
staticnoexcept

Copies a 24-bit number to 3 big-endian bytes.