📄 variant.tex
字号:
\membersection{wxVariant::Insert}\label{wxvariantinsert}\func{void}{Insert}{\param{const wxVariant\&}{ value}}Inserts a value at the front of the list.\membersection{wxVariant::IsNull}\label{wxvariantisnull}\constfunc{bool}{IsNull}{\void}Returns true if there is no data associated with this variant, false if there is data.\membersection{wxVariant::IsType}\label{wxvariantistype}\constfunc{bool}{IsType}{\param{const wxString\&}{ type}}Returns true if {\it type} matches the type of the variant, false otherwise.\membersection{wxVariant::IsValueKindOf}\label{wxvariantisvaluekindof}\constfunc{bool}{IsValueKindOf}{\param{const wxClassInfo* type}{ type}}Returns true if the data is derived from the class described by {\it type}, false otherwise.\membersection{wxVariant::MakeNull}\label{wxvariantmakenull}\func{void}{MakeNull}{\void}Makes the variant null by deleting the internal data.\membersection{wxVariant::MakeString}\label{wxvariantmakestring}\constfunc{wxString}{MakeString}{\void}Makes a string representation of the variant value (for any type).\membersection{wxVariant::Member}\label{wxvariantmember}\constfunc{bool}{Member}{\param{const wxVariant\&}{ value}}Returns true if {\it value} matches an element in the list.\membersection{wxVariant::NullList}\label{wxvariantnulllist}\func{void}{NullList}{\void}Makes an empty list. This differs from a null variant which has no data; a null listis of type list, but the number of elements in the list is zero.\membersection{wxVariant::SetData}\label{wxvariantsetdata}\func{void}{SetData}{\param{wxVariantData*}{ data}}Sets the internal variant data, deleting the existing data if there is any.\membersection{wxVariant::operator $=$}\label{wxvariantassignment}\func{void}{operator $=$}{\param{const wxVariant\& }{value}}\func{void}{operator $=$}{\param{wxVariantData* }{value}}\func{void}{operator $=$}{\param{const wxString\& }{value}}\func{void}{operator $=$}{\param{const wxChar* }{value}}\func{void}{operator $=$}{\param{wxChar }{value}}\func{void}{operator $=$}{\param{const long }{value}}\func{void}{operator $=$}{\param{const bool }{value}}\func{void}{operator $=$}{\param{const double }{value}}\func{void}{operator $=$}{\param{void* }{value}}\func{void}{operator $=$}{\param{wxObject* }{value}}\func{void}{operator $=$}{\param{const wxList\& }{value}}\func{void}{operator $=$}{\param{const wxDateTime\& }{value}}\func{void}{operator $=$}{\param{const wxArrayString\& }{value}}\func{void}{operator $=$}{\param{const DATE\_STRUCT* }{value}}\func{void}{operator $=$}{\param{const TIME\_STRUCT* }{value}}\func{void}{operator $=$}{\param{const TIMESTAMP\_STRUCT* }{value}}Assignment operators.\membersection{wxVariant::operator $==$}\label{wxvarianteq}\constfunc{bool}{operator $==$}{\param{const wxVariant\& }{value}}\constfunc{bool}{operator $==$}{\param{const wxString\& }{value}}\constfunc{bool}{operator $==$}{\param{const wxChar* }{value}}\constfunc{bool}{operator $==$}{\param{wxChar }{value}}\constfunc{bool}{operator $==$}{\param{const long }{value}}\constfunc{bool}{operator $==$}{\param{const bool }{value}}\constfunc{bool}{operator $==$}{\param{const double }{value}}\constfunc{bool}{operator $==$}{\param{void* }{value}}\constfunc{bool}{operator $==$}{\param{wxObject* }{value}}\constfunc{bool}{operator $==$}{\param{const wxList\& }{value}}\constfunc{bool}{operator $==$}{\param{const wxArrayString\& }{value}}\constfunc{bool}{operator $==$}{\param{const wxDateTime\& }{value}}Equality test operators.\membersection{wxVariant::operator $!=$}\label{wxvariantneq}\constfunc{bool}{operator $!=$}{\param{const wxVariant\& }{value}}\constfunc{bool}{operator $!=$}{\param{const wxString\& }{value}}\constfunc{bool}{operator $!=$}{\param{const wxChar* }{value}}\constfunc{bool}{operator $!=$}{\param{wxChar }{value}}\constfunc{bool}{operator $!=$}{\param{const long }{value}}\constfunc{bool}{operator $!=$}{\param{const bool }{value}}\constfunc{bool}{operator $!=$}{\param{const double }{value}}\constfunc{bool}{operator $!=$}{\param{void* }{value}}\constfunc{bool}{operator $!=$}{\param{wxObject* }{value}}\constfunc{bool}{operator $!=$}{\param{const wxList\& }{value}}\constfunc{bool}{operator $!=$}{\param{const wxArrayString\& }{value}}\constfunc{bool}{operator $!=$}{\param{const wxDateTime\& }{value}}Inequality test operators.\membersection{wxVariant::operator $[]$}\label{wxvariantarray}\constfunc{wxVariant}{operator $[]$}{\param{size\_t }{idx}}Returns the value at {\it idx} (zero-based).\func{wxVariant\&}{operator $[]$}{\param{size\_t }{idx}}Returns a reference to the value at {\it idx} (zero-based). This can be usedto change the value at this index.\membersection{wxVariant::operator wxChar}\label{wxvariantchar}\constfunc{char}{operator wxChar}{\void}Operator for implicit conversion to a wxChar, using \helpref{wxVariant::GetChar}{wxvariantgetchar}.\membersection{wxVariant::operator double}\label{wxvariantdouble}\constfunc{double}{operator double}{\void}Operator for implicit conversion to a double, using \helpref{wxVariant::GetDouble}{wxvariantgetdouble}.\constfunc{long}{operator long}{\void}Operator for implicit conversion to a long, using \helpref{wxVariant::GetLong}{wxvariantgetlong}.\membersection{wxVariant::operator wxString}\label{wxvariantwxstring}\constfunc{wxString}{operator wxString}{\void}Operator for implicit conversion to a string, using \helpref{wxVariant::MakeString}{wxvariantmakestring}.\membersection{wxVariant::operator void*}\label{wxvariantvoid}\constfunc{void*}{operator void*}{\void}Operator for implicit conversion to a pointer to a void, using \helpref{wxVariant::GetVoidPtr}{wxvariantgetvoidptr}.\membersection{wxVariant::operator wxDateTime}\label{wxvariantdatetime}\constfunc{void*}{operator wxDateTime}{\void}Operator for implicit conversion to a pointer to a \helpref{wxDateTime}{wxdatetime}, using \helpref{wxVariant::GetDateTime}{wxvariantgetdatetime}.\section{\class{wxVariantData}}\label{wxvariantdata}The {\bf wxVariantData} is used to implement a new type for wxVariant. Derive from wxVariantData,and override the pure virtual functions.wxVariantData is reference counted, but you don't normally have to care about this, aswxVariant manages the count automatically. However, incase your application needs to takeownership of wxVariantData, be aware that the object is created with reference count of 1,and passing it to wxVariant will not increase this. In other words, \helpref{IncRef}{wxvariantdataincref}needs to be called only if you both take ownership of wxVariantData and pass it to a wxVariant.Also note that the destructor is protected, so you can never explicitly delete a wxVariantDatainstance. Instead, \helpref{DecRef}{wxvariantdatadecref} will delete the object automaticallywhen the reference count reaches zero.\wxheading{Derived from}\helpref{wxObject}{wxobject}\wxheading{Include files}<wx/variant.h>\wxheading{See also}\helpref{wxVariant}{wxvariant}\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxVariantData::wxVariantData}\label{wxvariantdatactor}\func{}{wxVariantData}{\void}Default constructor.\membersection{wxVariantData::DecRef}\label{wxvariantdatadecref}\func{void}{DecRef}{\void}Decreases reference count. If the count reaches zero, the object isautomatically deleted.Note that destructor of wxVariantData is protected, so deletecannot be used as normal. Instead, DecRef should be called.\membersection{wxVariantData::Eq}\label{wxvariantdataeq}\constfunc{bool}{Eq}{\param{wxVariantData\&}{ data}}Returns true if this object is equal to {\it data}.\membersection{wxVariantData::GetType}\label{wxvariantdatagettype}\constfunc{wxString}{GetType}{\void}Returns the string type of the data.\membersection{wxVariantData::GetValueClassInfo}\label{wxvariantdatagetvalueclassinfo}\constfunc{wxClassInfo*}{GetValueClassInfo}{\void}If the data is a wxObject returns a pointer to the objects wxClassInfo structure, ifthe data isn't a wxObject the method returns NULL.\membersection{wxVariantData::IncRef}\label{wxvariantdataincref}\func{void}{IncRef}{\void}Increases reference count. Note that initially wxVariantData has reference count of 1.\membersection{wxVariantData::Read}\label{wxvariantdataread}\func{bool}{Read}{\param{ostream\&}{ stream}}\func{bool}{Read}{\param{wxString\&}{ string}}Reads the data from {\it stream} or {\it string}.\membersection{wxVariantData::Write}\label{wxvariantdatawrite}\constfunc{bool}{Write}{\param{ostream\&}{ stream}}\constfunc{bool}{Write}{\param{wxString\&}{ string}}Writes the data to {\it stream} or {\it string}.\membersection{wxGetVariantCast}\label{wxgetvariantcast}\func{classname *}{wxGetVariantCast}{wxVariant\&, classname}This macro returns the data stored in {\it variant} cast to the type {\it classname *} ifthe data is of this type (the check is done during the run-time) or{\tt NULL} otherwise.\wxheading{See also}\helpref{RTTI overview}{runtimeclassoverview}\\\helpref{wxDynamicCast}{wxdynamiccast}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -