33#ifndef AAX_CStringDataBuffer_H
34#define AAX_CStringDataBuffer_H
49template <AAX_CTypeID T>
72 auto const size = mData.size() + 1;
73 static_assert(std::numeric_limits<
decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max(),
74 "size variable may not represent all positive values of oSize");
75 if (size > std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max()) {
78 *oSize =
static_cast<std::remove_pointer<decltype(oSize)
>::type>(size);
83 *oBuffer = mData.c_str();
115 auto const size = mData.size() + 1;
116 static_assert(std::numeric_limits<
decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max(),
117 "size variable may not represent all positive values of oSize");
118 if (size > std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max()) {
121 *oSize =
static_cast<std::remove_pointer<decltype(oSize)
>::type>(size);
126 *oBuffer = mData.c_str();
@ AAX_ERROR_SIGNED_INT_OVERFLOW
Definition: AAX_Errors.h:83
@ AAX_ERROR_NULL_ARGUMENT
One or more required pointer arguments are null.
Definition: AAX_Errors.h:94
@ AAX_SUCCESS
Definition: AAX_Errors.h:49
Various utility definitions for AAX.
int32_t AAX_Result
Definition: AAX.h:347
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:346
A convenience class for string data buffers.
Definition: AAX_CStringDataBuffer.h:51
AAX_CStringDataBufferOfType(const char *inData)
Definition: AAX_CStringDataBuffer.h:55
AAX_Result Size(int32_t *oSize) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:70
~AAX_CStringDataBufferOfType(void) AAX_OVERRIDE=default
AAX_CStringDataBufferOfType(std::string &&inData)
Definition: AAX_CStringDataBuffer.h:54
AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType const &)=delete
AAX_Result Type(AAX_CTypeID *oType) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:65
AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType &&)=delete
AAX_Result Data(void const **oBuffer) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:81
AAX_CStringDataBufferOfType(std::string const &inData)
Definition: AAX_CStringDataBuffer.h:53
AAX_CStringDataBufferOfType & operator=(AAX_CStringDataBufferOfType const &other)=delete
Definition: AAX_CStringDataBuffer.h:94
AAX_CStringDataBuffer(AAX_CTypeID inType, std::string const &inData)
Definition: AAX_CStringDataBuffer.h:96
AAX_CStringDataBuffer(AAX_CStringDataBuffer const &)=delete
~AAX_CStringDataBuffer(void) AAX_OVERRIDE=default
AAX_Result Data(void const **oBuffer) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:124
AAX_CStringDataBuffer(AAX_CTypeID inType, std::string &&inData)
Definition: AAX_CStringDataBuffer.h:97
AAX_CStringDataBuffer(AAX_CStringDataBuffer &&)=delete
AAX_Result Type(AAX_CTypeID *oType) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:108
AAX_CStringDataBuffer(AAX_CTypeID inType, const char *inData)
Definition: AAX_CStringDataBuffer.h:98
AAX_CStringDataBuffer & operator=(AAX_CStringDataBuffer const &other)=delete
AAX_Result Size(int32_t *oSize) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:113
Interface for reference counted data buffers.
Definition: AAX_IDataBuffer.h:50
void **ppvObjOut AAX_OVERRIDE
Definition: AAX_IDataBuffer.h:55