\hypertarget{a00785_source}{}\doxysection{AAX\+\_\+\+CString\+Data\+Buffer.\+h}
\label{a00785_source}\index{AAX\_CStringDataBuffer.h@{AAX\_CStringDataBuffer.h}}
\mbox{\hyperlink{a00785}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*================================================================================================*/}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ Copyright\ 2023\ Avid\ Technology,\ Inc.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *\ All\ rights\ reserved.}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ CONFIDENTIAL:\ this\ document\ contains\ confidential\ information\ of\ Avid.\ Do}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ not\ disclose\ to\ any\ third\ party.\ Use\ of\ the\ information\ contained\ in\ this}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *\ document\ is\ subject\ to\ an\ Avid\ SDK\ license.}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00016\ \textcolor{comment}{/*================================================================================================*/}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#ifndef\ AAX\_CStringDataBuffer\_H}}
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#define\ AAX\_CStringDataBuffer\_H}}
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{a00569}{AAX\_IDataBuffer.h}}"{}}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{a00533}{AAX.h}}"{}}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00027\ \textcolor{preprocessor}{\#include\ <limits>}}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#include\ <type\_traits>}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00036\ \textcolor{keyword}{template}\ <AAX\_CTypeID\ T>}
\DoxyCodeLine{00037\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{a02205}{AAX\_IDataBuffer}}}
\DoxyCodeLine{00038\ \{}
\DoxyCodeLine{00039\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00040\ \ \ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{a01941_af51e78a18dd03280cb899afe4a0fcd43}{AAX\_CStringDataBufferOfType}}\ (std::string\ \textcolor{keyword}{const}\ \&\ inData)\ :\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{a01941_aa744c47296225185866267322f0b6e0a}{AAX\_CStringDataBufferOfType}}\ (std::string\ \&\&\ inData)\ :\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keyword}{explicit}\ \mbox{\hyperlink{a01941_a757b5e5138674ca41c0756eb38ada17b}{AAX\_CStringDataBufferOfType}}\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *\ inData)\ :\ mData\{inData\ ?\ std::string\{inData\}\ :\ std::string\{\}\}\ \{\}}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ \mbox{\hyperlink{a01941_ab7c438a4f4115144b5581b3be50473d0}{AAX\_CStringDataBufferOfType}}(\mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\ \textcolor{keyword}{const}\ \&)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00045\ \ \ \ \ \mbox{\hyperlink{a01941_aca16ff8ce81ed5be20021d6548658fb8}{AAX\_CStringDataBufferOfType}}(\mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\ \&\&)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \ \ \ \ \mbox{\hyperlink{a01941_aa6a46bbcf9ad053d12f78ceac0d51c27}{\string~AAX\_CStringDataBufferOfType}}\ (\textcolor{keywordtype}{void})\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00048\ \ \ \ \ }
\DoxyCodeLine{00049\ \ \ \ \ \mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\&\ \mbox{\hyperlink{a01941_afbda396db38c2bf4285474ba8850bf16}{operator=\ }}(\mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\ \textcolor{keyword}{const}\ \&\ other)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00050\ \ \ \ \ \mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\&\ \mbox{\hyperlink{a01941_afbda396db38c2bf4285474ba8850bf16}{operator=\ }}(\mbox{\hyperlink{a01941}{AAX\_CStringDataBufferOfType}}\ \&\&\ other)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00051\ }
\DoxyCodeLine{00052\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01941_abf72ceb10ca64e765981da94fdc30939}{Type}}(\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ *\ oType)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oType)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00054\ \ \ \ \ \ \ \ \ *oType\ =\ T;}
\DoxyCodeLine{00055\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00056\ \ \ \ \ \}}
\DoxyCodeLine{00057\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01941_a913a8500c51ef247240bdca932a559b8}{Size}}(int32\_t\ *\ oSize)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00058\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oSize)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00059\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \textcolor{keyword}{const}\ size\ =\ mData.size()\ +\ 1;\ \textcolor{comment}{//\ null\ termination}}
\DoxyCodeLine{00060\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_assert}(std::numeric\_limits<\textcolor{keyword}{decltype}(size)>::max()\ >=\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max(),}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}size\ variable\ may\ not\ represent\ all\ positive\ values\ of\ oSize"{}});}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (size\ >\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max())\ \{}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937a5b3c0524765174acbb042f67edc0804a}{AAX\_ERROR\_SIGNED\_INT\_OVERFLOW}};}
\DoxyCodeLine{00064\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ *oSize\ =\ \textcolor{keyword}{static\_cast<}std::remove\_pointer<decltype(oSize)\textcolor{keyword}{>}::type>(size);}
\DoxyCodeLine{00066\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00067\ \ \ \ \ \}}
\DoxyCodeLine{00068\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01941_ada2c29ee81607fd2342dd1bf04a195b8}{Data}}(\textcolor{keywordtype}{void}\ \textcolor{keyword}{const}\ **\ oBuffer)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00069\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oBuffer)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ *oBuffer\ =\ mData.c\_str();}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00072\ \ \ \ \ \}}
\DoxyCodeLine{00073\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00074\ \ \ \ \ std::string\ mData;}
\DoxyCodeLine{00075\ \};}
\DoxyCodeLine{00076\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{a02205}{AAX\_IDataBuffer}}}
\DoxyCodeLine{00081\ \{}
\DoxyCodeLine{00082\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00083\ \ \ \ \ \mbox{\hyperlink{a01945_a094305b654a18e795dbdd2565818291e}{AAX\_CStringDataBuffer}}\ (\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ inType,\ std::string\ \textcolor{keyword}{const}\ \&\ inData)\ :\ mType\{inType\},\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00084\ \ \ \ \ \mbox{\hyperlink{a01945_a3f2e2a9969ac0b6be086d490a37ea7a5}{AAX\_CStringDataBuffer}}\ (\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ inType,\ std::string\ \&\&\ inData)\ :\ mType\{inType\},\ mData\{inData\}\ \{\}}
\DoxyCodeLine{00085\ \ \ \ \ \mbox{\hyperlink{a01945_a7bda97f007e089726390411ad59d62cd}{AAX\_CStringDataBuffer}}\ (\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ inType,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *\ inData)\ :\ mType\{inType\},\ mData\{inData\ ?\ std::string\{inData\}\ :\ std::string\{\}\}\ \{\}}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \ \ \ \ \mbox{\hyperlink{a01945_a19fbb6e53ff5830de197c046a39ee331}{AAX\_CStringDataBuffer}}(\mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\ \textcolor{keyword}{const}\ \&)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00088\ \ \ \ \ \mbox{\hyperlink{a01945_a60ad3ecbeea862b7b52e10ff0d19a581}{AAX\_CStringDataBuffer}}(\mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\ \&\&)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \ \ \ \ \mbox{\hyperlink{a01945_a1b0639ccc12a998f2c56f24f6faa12ac}{\string~AAX\_CStringDataBuffer}}\ (\textcolor{keywordtype}{void})\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00091\ \ \ \ \ }
\DoxyCodeLine{00092\ \ \ \ \ \mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\&\ \mbox{\hyperlink{a01945_abee64698e7094aeb94a588bf767a7504}{operator=\ }}(\mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\ \textcolor{keyword}{const}\ \&\ other)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00093\ \ \ \ \ \mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\&\ \mbox{\hyperlink{a01945_abee64698e7094aeb94a588bf767a7504}{operator=\ }}(\mbox{\hyperlink{a01945}{AAX\_CStringDataBuffer}}\ \&\&\ other)\ =\ \textcolor{keyword}{delete};}
\DoxyCodeLine{00094\ }
\DoxyCodeLine{00095\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01945_a60d05562260703eaeb21d70bdae3eab1}{Type}}(\mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ *\ oType)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oType)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00097\ \ \ \ \ \ \ \ \ *oType\ =\ mType;}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00099\ \ \ \ \ \}}
\DoxyCodeLine{00100\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01945_ac55e08023933ce380a83f346050091d3}{Size}}(int32\_t\ *\ oSize)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oSize)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ \textcolor{keyword}{const}\ size\ =\ mData.size()\ +\ 1;\ \textcolor{comment}{//\ null\ termination}}
\DoxyCodeLine{00103\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_assert}(std::numeric\_limits<\textcolor{keyword}{decltype}(size)>::max()\ >=\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max(),}
\DoxyCodeLine{00104\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}size\ variable\ may\ not\ represent\ all\ positive\ values\ of\ oSize"{}});}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (size\ >\ std::numeric\_limits<std::remove\_pointer<\textcolor{keyword}{decltype}(oSize)>::type>::max())\ \{}
\DoxyCodeLine{00106\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937a5b3c0524765174acbb042f67edc0804a}{AAX\_ERROR\_SIGNED\_INT\_OVERFLOW}};}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ *oSize\ =\ \textcolor{keyword}{static\_cast<}std::remove\_pointer<decltype(oSize)\textcolor{keyword}{>}::type>(size);}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00110\ \ \ \ \ \}}
\DoxyCodeLine{00111\ \ \ \ \ \mbox{\hyperlink{a00533_a4d8f69a697df7f70c3a8e9b8ee130d2f}{AAX\_Result}}\ \mbox{\hyperlink{a01945_a26a6332616ad889fa1798638dbc20948}{Data}}(\textcolor{keywordtype}{void}\ \textcolor{keyword}{const}\ **\ oBuffer)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a02205_a95200d33b16c4a896e3f634bd5b7409d}{AAX\_OVERRIDE}}\ \{}
\DoxyCodeLine{00112\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!oBuffer)\ \{\ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aa77cf0ad2d545c97b095d8bc19a7c969}{AAX\_ERROR\_NULL\_ARGUMENT}};\ \}}
\DoxyCodeLine{00113\ \ \ \ \ \ \ \ \ *oBuffer\ =\ mData.c\_str();}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a00530_a5f8c7439f3a706c4f8315a9609811937aeddbd1bb67e3a66e6af54a4b4a7a57b3}{AAX\_SUCCESS}};}
\DoxyCodeLine{00115\ \ \ \ \ \}}
\DoxyCodeLine{00116\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00117\ \ \ \ \ \mbox{\hyperlink{a00533_ac678f9c1fbcc26315d209f71a147a175}{AAX\_CTypeID}}\ \textcolor{keyword}{const}\ mType;}
\DoxyCodeLine{00118\ \ \ \ \ std::string\ mData;}
\DoxyCodeLine{00119\ \};}
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
