113#include "vtkCommonCoreModule.h"
116#include "vtkSetGet.h"
126#define vtkExtraExtendedTemplateMacro(call) \
127 vtkExtendedTemplateMacro(call); \
128 vtkTemplateMacroCase(VTK_VARIANT, vtkVariant, call)
131#define vtkExtendedArrayIteratorTemplateMacro(call) \
132 vtkArrayIteratorTemplateMacro(call); \
133 vtkArrayIteratorTemplateMacroCase(VTK_VARIANT, vtkVariant, call)
266 bool IsValid() const;
271 bool IsString() const;
277 bool IsUnicodeString() const;
282 bool IsNumeric() const;
287 bool IsFloat() const;
292 bool IsDouble() const;
302 bool IsUnsignedChar() const;
307 bool IsSignedChar() const;
312 bool IsShort() const;
317 bool IsUnsignedShort() const;
327 bool IsUnsignedInt() const;
337 bool IsUnsignedLong() const;
343 bool Is__Int64() const;
349 bool IsUnsigned__Int64() const;
354 bool IsLongLong() const;
359 bool IsUnsignedLongLong() const;
364 bool IsVTKObject() const;
369 bool IsArray() const;
374 unsigned int GetType() const;
379 const
char* GetTypeAsString() const;
383 DEFAULT_FORMATTING = 0,
384 FIXED_FORMATTING = 1,
385 SCIENTIFIC_FORMATTING = 2
407 "Use vtkStdString ToString(int formatting = DEFAULT_FORMATTING, int precision = 6)")
408 vtkUnicodeString ToUnicodeString(
int formatting = DEFAULT_FORMATTING,
int precision = 6) const;
420 float ToFloat(
bool* valid) const;
421 float ToFloat()
const {
return this->
ToFloat(
nullptr); }
516 template <
typename T>
517 T ToNumeric(
bool* valid, T* vtkNotUsed(ignored))
const;
539 bool CheckUnicodeStringEqual(
const vtkVariant& other)
const;
540 bool CheckUnicodeStringLessThan(
const vtkVariant& other)
const;
Abstract superclass for all arrays.
abstract base class for most VTK objects
Wrapper around std::string to keep symbols short.
String class that stores Unicode text.
A atomic type representing the union of many types.
vtkTypeInt64 ToTypeInt64() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(float value)
Create a float variant.
long long ToLongLong(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
~vtkVariant()
Destruct the variant.
char ToChar() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned long long UnsignedLongLong
double ToDouble(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
long long ToLongLong() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkTypeUInt64 ToTypeUInt64(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned short ToUnsignedShort(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(unsigned long value)
Create an unsigned long variant.
unsigned char ToUnsignedChar(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned char ToUnsignedChar() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(unsigned int value)
Create an unsigned integer variant.
vtkVariant(char value)
Create a char variant.
unsigned short UnsignedShort
char ToChar(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkUnicodeString * UnicodeString
vtkVariant(int value)
Create an integer variant.
vtkVariant(vtkStdString value)
Create a string variant from a std string.
vtkVariant(unsigned long long value)
Create an unsigned long long variant.
long ToLong() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
signed char ToSignedChar() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
double ToDouble() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkObjectBase * ToVTKObject() const
Return the VTK object, or nullptr if not of that type.
unsigned long ToUnsignedLong(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkVariant &val)
vtkVariant(long value)
Create an long variant.
float ToFloat() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(signed char value)
Create a signed char variant.
vtkStdString ToString(int formatting=DEFAULT_FORMATTING, int precision=6) const
Convert the variant to a string.
short ToShort() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(long long value)
Create a long long variant.
signed char ToSignedChar(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned int ToUnsignedInt() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
int ToInt(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(bool value)
Create a bool variant.
vtkAbstractArray * ToArray() const
Return the array, or nullptr if not of that type.
unsigned long long ToUnsignedLongLong() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
long ToLong(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkTypeInt64 ToTypeInt64(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
unsigned int ToUnsignedInt(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(const vtkVariant &other)
Copy constructor.
unsigned long ToUnsignedLong() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(unsigned char value)
Create an unsigned char variant.
unsigned long UnsignedLong
unsigned char UnsignedChar
vtkVariant(short value)
Create a short variant.
vtkVariant(unsigned short value)
Create an unsigned short variant.
vtkVariant()
Create an invalid variant.
vtkVariant(double value)
Create a double variant.
unsigned short ToUnsignedShort() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
bool IsEqual(const vtkVariant &other) const
Determines whether two variants have the same value.
vtkObjectBase * VTKObject
int ToInt() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkTypeUInt64 ToTypeUInt64() const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
short ToShort(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
vtkVariant(const char *value)
Create a string variant from a const char*.
unsigned long long ToUnsignedLongLong(bool *valid) const
Convert the variant to a numeric type: If it holds a numeric, cast to the appropriate type.
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
bool operator()(const vtkVariant &s1, const vtkVariant &s2) const
#define VTK_DEPRECATED_IN_9_1_0(reason)
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator>(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator<(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator>=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator<=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkVariant &val)