\hypertarget{a00713_source}{}\doxysection{AAX\+\_\+\+CUnit\+Display\+Delegate\+Decorator.\+h}
\label{a00713_source}\index{AAX\_CUnitDisplayDelegateDecorator.h@{AAX\_CUnitDisplayDelegateDecorator.h}}
\mbox{\hyperlink{a00713}{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\ 2013-\/2017,\ 2019,\ 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{00019\ \textcolor{comment}{/*================================================================================================*/}}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#ifndef\ AAX\_CUNITDISPLAYDELEGATEDECORATOR\_H}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#define\ AAX\_CUNITDISPLAYDELEGATEDECORATOR\_H}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{a00539}{AAX\_IDisplayDelegateDecorator.h}}"{}}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00042\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00043\ \textcolor{keyword}{class\ }\mbox{\hyperlink{a01957}{AAX\_CUnitDisplayDelegateDecorator}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{a02225}{AAX\_IDisplayDelegateDecorator}}<T>}
\DoxyCodeLine{00044\ \{}
\DoxyCodeLine{00045\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00054\ \ \ \ \ \mbox{\hyperlink{a01957}{AAX\_CUnitDisplayDelegateDecorator}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{a02221}{AAX\_IDisplayDelegate<T>}}\&\ displayDelegate,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a01933}{AAX\_CString}}\&\ unitString);}
\DoxyCodeLine{00055\ \ \ \ \ }
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{comment}{//Virtual\ Overrides}}
\DoxyCodeLine{00057\ \ \ \ \ \mbox{\hyperlink{a01957}{AAX\_CUnitDisplayDelegateDecorator<T>}}*\ \ \ \mbox{\hyperlink{a01957_ad987fdc5423673b664ce099c6f27bf06}{Clone}}()\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a00533_ac2f24a5172689ae684344abdcce55463}{AAX\_OVERRIDE}};}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a8531395e74327b93e210fd0aafaed3f7}{ValueToString}}(T\ value,\ \mbox{\hyperlink{a01933}{AAX\_CString}}*\ valueString)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a00533_ac2f24a5172689ae684344abdcce55463}{AAX\_OVERRIDE}};}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a8531395e74327b93e210fd0aafaed3f7}{ValueToString}}(T\ value,\ int32\_t\ maxNumChars,\ \mbox{\hyperlink{a01933}{AAX\_CString}}*\ valueString)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a00533_ac2f24a5172689ae684344abdcce55463}{AAX\_OVERRIDE}};}
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a4577b27d63067a75deead21c25f1b932}{StringToValue}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{a01933}{AAX\_CString}}\&\ valueString,\ T*\ value)\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a00533_ac2f24a5172689ae684344abdcce55463}{AAX\_OVERRIDE}};}
\DoxyCodeLine{00061\ }
\DoxyCodeLine{00062\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{a01933}{AAX\_CString}}\ \ \ \ \mbox{\hyperlink{a01957_a4ea845f56cbb837f9b45901f022336d0}{mUnitString}};}
\DoxyCodeLine{00064\ \};}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00067\ }
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00070\ \mbox{\hyperlink{a01957_ad1ade911fb13a394a65a26e159035318}{AAX\_CUnitDisplayDelegateDecorator<T>::AAX\_CUnitDisplayDelegateDecorator}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{a02221}{AAX\_IDisplayDelegate<T>}}\&\ displayDelegate,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{a01933}{AAX\_CString}}\&\ unitString)\ \ :}
\DoxyCodeLine{00071\ \ \ \ \ \mbox{\hyperlink{a02225}{AAX\_IDisplayDelegateDecorator}}<T>(displayDelegate),}
\DoxyCodeLine{00072\ \ \ \ \ mUnitString(unitString)}
\DoxyCodeLine{00073\ \{}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \}}
\DoxyCodeLine{00076\ }
\DoxyCodeLine{00077\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00078\ \mbox{\hyperlink{a01957}{AAX\_CUnitDisplayDelegateDecorator<T>}}*\ \ \ \mbox{\hyperlink{a01957_ad987fdc5423673b664ce099c6f27bf06}{AAX\_CUnitDisplayDelegateDecorator<T>::Clone}}()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00079\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00080\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{new}\ \mbox{\hyperlink{a01957}{AAX\_CUnitDisplayDelegateDecorator}}(*\textcolor{keyword}{this});}
\DoxyCodeLine{00081\ \}}
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00083\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00084\ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a8531395e74327b93e210fd0aafaed3f7}{AAX\_CUnitDisplayDelegateDecorator<T>::ValueToString}}(T\ value,\ \mbox{\hyperlink{a01933}{AAX\_CString}}*\ valueString)\textcolor{keyword}{\ const\ }}
\DoxyCodeLine{00085\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{keywordtype}{bool}\ succeeded\ =\ \mbox{\hyperlink{a02225_ada5780cfa332ac7946bf95aa65ae96f5}{AAX\_IDisplayDelegateDecorator<T>::ValueToString}}(value,\ valueString);}
\DoxyCodeLine{00087\ \ \ \ \ *valueString\ +=\ mUnitString;}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordflow}{return}\ succeeded;}
\DoxyCodeLine{00089\ \}}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00092\ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a8531395e74327b93e210fd0aafaed3f7}{AAX\_CUnitDisplayDelegateDecorator<T>::ValueToString}}(T\ value,\ int32\_t\ maxNumChars,\ \mbox{\hyperlink{a01933}{AAX\_CString}}*\ valueString)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00093\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keywordtype}{bool}\ succeeded\ =\ \mbox{\hyperlink{a02225_ada5780cfa332ac7946bf95aa65ae96f5}{AAX\_IDisplayDelegateDecorator<T>::ValueToString}}(value,\ maxNumChars,\ valueString);}
\DoxyCodeLine{00095\ \ \ \ \ uint32\_t\ strlen\ =\ valueString-\/>\mbox{\hyperlink{a01933_a34ccfa250b53a721417f32d4a74bfed6}{Length}}();}
\DoxyCodeLine{00096\ \ \ \ \ \textcolor{keyword}{const}\ uint32\_t\ maxNumCharsUnsigned\ =\ (0\ <=\ maxNumChars)\ ?\ \textcolor{keyword}{static\_cast<}uint32\_t\textcolor{keyword}{>}(maxNumChars)\ :\ 0;}
\DoxyCodeLine{00097\ \ \ \ \ \textcolor{keywordflow}{if}\ (maxNumCharsUnsigned\ >\ strlen\ \&\&\ (maxNumCharsUnsigned-\/strlen\ >=\ mUnitString.Length()))}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ *valueString\ +=\ mUnitString;}
\DoxyCodeLine{00099\ \ \ \ \ \textcolor{keywordflow}{return}\ succeeded;}
\DoxyCodeLine{00100\ \}}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00104\ \textcolor{keywordtype}{bool}\ \ \ \ \ \ \ \ \mbox{\hyperlink{a01957_a4577b27d63067a75deead21c25f1b932}{AAX\_CUnitDisplayDelegateDecorator<T>::StringToValue}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{a01933}{AAX\_CString}}\&\ valueString,\ T*\ value)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00105\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00106\ \ \ \ \ \textcolor{comment}{//Just\ call\ through\ if\ there\ is\ obviously\ no\ unit\ string.}}
\DoxyCodeLine{00107\ \ \ \ \ \textcolor{keywordflow}{if}\ (valueString.\mbox{\hyperlink{a01933_a34ccfa250b53a721417f32d4a74bfed6}{Length}}()\ <=\ mUnitString.Length())}
\DoxyCodeLine{00108\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a02225_a18d19293f3eca619cb5bb7f1ffde1a8d}{AAX\_IDisplayDelegateDecorator<T>::StringToValue}}(valueString,\ value);}
\DoxyCodeLine{00109\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{comment}{//Just\ call\ through\ if\ the\ end\ of\ this\ string\ does\ not\ match\ the\ unit\ string.\ \ \ }}
\DoxyCodeLine{00111\ \ \ \ \ \mbox{\hyperlink{a01933}{AAX\_CString}}\ unitSubString;}
\DoxyCodeLine{00112\ \ \ \ \ valueString.\mbox{\hyperlink{a01933_a35132df5b9f73bc2ddbfd673f4a5d22a}{SubString}}(valueString.\mbox{\hyperlink{a01933_a34ccfa250b53a721417f32d4a74bfed6}{Length}}()\ -\/\ mUnitString.Length(),\ mUnitString.Length(),\ \&unitSubString);}
\DoxyCodeLine{00113\ \ \ \ \ \textcolor{keywordflow}{if}\ (unitSubString\ !=\ mUnitString)}
\DoxyCodeLine{00114\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a02225_a18d19293f3eca619cb5bb7f1ffde1a8d}{AAX\_IDisplayDelegateDecorator<T>::StringToValue}}(valueString,\ value);}
\DoxyCodeLine{00115\ \ \ \ \ }
\DoxyCodeLine{00116\ \ \ \ \ \textcolor{comment}{//Call\ through\ with\ the\ stripped\ down\ value\ string.\ \ }}
\DoxyCodeLine{00117\ \ \ \ \ \mbox{\hyperlink{a01933}{AAX\_CString}}\ valueSubString;}
\DoxyCodeLine{00118\ \ \ \ \ valueString.\mbox{\hyperlink{a01933_a35132df5b9f73bc2ddbfd673f4a5d22a}{SubString}}(0,\ valueString.\mbox{\hyperlink{a01933_a34ccfa250b53a721417f32d4a74bfed6}{Length}}()\ -\/\ mUnitString.Length(),\ \&valueSubString);}
\DoxyCodeLine{00119\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{a02225_a18d19293f3eca619cb5bb7f1ffde1a8d}{AAX\_IDisplayDelegateDecorator<T>::StringToValue}}(valueSubString,\ value);}
\DoxyCodeLine{00120\ \}}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ }
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//AAX\_CUNITDISPLAYDELEGATEDECORATOR\_H}}

\end{DoxyCode}
