38 #ifndef vtkVariantExtract_h 39 #define vtkVariantExtract_h 46 vtkGenericWarningMacro(
47 <<
"Cannot convert vtkVariant containing [" << value.
GetTypeAsString() <<
"] " 48 <<
"to unsupported type [" <<
typeid(T).
name() <<
"]. " 49 <<
"Create a vtkVariantExtract<> specialization to eliminate this warning." 61 valid =
value.IsChar();
62 return valid ?
value.ToChar() : 0;
68 valid =
value.IsUnsignedChar();
69 return valid ?
value.ToUnsignedChar() : 0;
75 valid =
value.IsShort();
76 return valid ?
value.ToShort() : 0;
82 valid =
value.IsUnsignedShort();
83 return valid ?
value.ToUnsignedShort() : 0;
89 valid =
value.IsInt();
90 return valid ?
value.ToInt() : 0;
96 valid =
value.IsUnsignedInt();
97 return valid ?
value.ToUnsignedInt() : 0;
103 valid =
value.IsLong();
104 return valid ?
value.ToLong() : 0;
110 valid =
value.IsUnsignedLong();
111 return valid ?
value.ToUnsignedLong() : 0;
117 valid =
value.IsLongLong();
118 return valid ?
value.ToLongLong() : 0;
124 valid =
value.IsUnsignedLongLong();
125 return valid ?
value.ToUnsignedLongLong() : 0;
131 valid =
value.IsFloat();
132 return valid ?
value.ToFloat() : 0.0f;
138 valid =
value.IsDouble();
139 return valid ?
value.ToDouble() : 0.0;
145 valid =
value.IsString();
152 valid =
value.IsUnicodeString();
Wrapper around std::string to keep symbols short.
A atomic type representing the union of many types.
const char * GetTypeAsString() const
Get the type of the variant as a string.
String class that stores Unicode text.