20#ifndef AAX_CStringDataBuffer_H
21#define AAX_CStringDataBuffer_H
36template <AAX_CTypeID T>
59 auto const size = mData.size() + 1;
60 static_assert(std::numeric_limits<
decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max(),
61 "size variable may not represent all positive values of oSize");
62 if (size > std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max()) {
65 *oSize =
static_cast<std::remove_pointer<decltype(oSize)
>::type>(size);
70 *oBuffer = mData.c_str();
102 auto const size = mData.size() + 1;
103 static_assert(std::numeric_limits<
decltype(size)>::max() >= std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max(),
104 "size variable may not represent all positive values of oSize");
105 if (size > std::numeric_limits<std::remove_pointer<
decltype(oSize)>::type>::max()) {
108 *oSize =
static_cast<std::remove_pointer<decltype(oSize)
>::type>(size);
113 *oBuffer = mData.c_str();
@ AAX_ERROR_SIGNED_INT_OVERFLOW
Definition: AAX_Errors.h:70
@ AAX_ERROR_NULL_ARGUMENT
One or more required pointer arguments are null.
Definition: AAX_Errors.h:81
@ AAX_SUCCESS
Definition: AAX_Errors.h:36
Various utility definitions for AAX.
int32_t AAX_Result
Definition: AAX.h:334
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:333
A convenience class for string data buffers.
Definition: AAX_CStringDataBuffer.h:38
AAX_CStringDataBufferOfType(const char *inData)
Definition: AAX_CStringDataBuffer.h:42
AAX_Result Size(int32_t *oSize) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:57
~AAX_CStringDataBufferOfType(void) AAX_OVERRIDE=default
AAX_CStringDataBufferOfType(std::string &&inData)
Definition: AAX_CStringDataBuffer.h:41
AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType const &)=delete
AAX_Result Type(AAX_CTypeID *oType) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:52
AAX_CStringDataBufferOfType(AAX_CStringDataBufferOfType &&)=delete
AAX_Result Data(void const **oBuffer) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:68
AAX_CStringDataBufferOfType(std::string const &inData)
Definition: AAX_CStringDataBuffer.h:40
AAX_CStringDataBufferOfType & operator=(AAX_CStringDataBufferOfType const &other)=delete
Definition: AAX_CStringDataBuffer.h:81
AAX_CStringDataBuffer(AAX_CTypeID inType, std::string const &inData)
Definition: AAX_CStringDataBuffer.h:83
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:111
AAX_CStringDataBuffer(AAX_CTypeID inType, std::string &&inData)
Definition: AAX_CStringDataBuffer.h:84
AAX_CStringDataBuffer(AAX_CStringDataBuffer &&)=delete
AAX_Result Type(AAX_CTypeID *oType) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:95
AAX_CStringDataBuffer(AAX_CTypeID inType, const char *inData)
Definition: AAX_CStringDataBuffer.h:85
AAX_CStringDataBuffer & operator=(AAX_CStringDataBuffer const &other)=delete
AAX_Result Size(int32_t *oSize) const AAX_OVERRIDE
Definition: AAX_CStringDataBuffer.h:100
Interface for reference counted data buffers.
Definition: AAX_IDataBuffer.h:37
void **ppvObjOut AAX_OVERRIDE
Definition: AAX_IDataBuffer.h:42