108 explicit
Value(const std::
string& v);
116 explicit Value(
const QString& v);
141 explicit Value(
long v);
207 inline Value& set(
bool v);
216 inline Value& set(
int v);
227 inline Value& set(
long v);
237 inline Value& set(
unsigned v);
264 inline Value& set(
const char* v);
273 inline Value& set(
const std::string& v);
284 inline Value& set(
const QString& as);
297 Value&
set(
int type,
const void* content,
size_t size = 0);
307 inline Value& set(
const void* v,
size_t size);
324 inline Value& assign(
bool v);
333 inline Value& assign(
int v);
342 inline Value& assign(
unsigned v);
352 inline Value& assign(
const long v);
371 inline Value& assign(
const char* v);
380 inline Value& assign(
const std::string& v);
391 inline Value& assign(
const QString& s);
403 inline Value& assign(
const void* v,
size_t size);
410 [[nodiscard]]
inline EType getType()
const;
441 [[nodiscard]]
inline bool isValid()
const;
448 [[nodiscard]]
inline bool isNumber()
const;
461 [[nodiscard]]
inline flt_type getFloat()
const;
473 [[nodiscard]]
inline int_type getInteger()
const;
478 [[nodiscard]]
inline size_t getSize()
const;
501 [[nodiscard]] std::string
getString(
int precision = std::numeric_limits<int>::max())
const;
508 [[nodiscard]]
inline QString getQString(
int precision = std::numeric_limits<int>::max())
const;
536 inline Value& operator=(
const QString& v);
541 explicit operator QString()
const;
548 explicit inline operator std::string()
const;
553 explicit inline operator bool()
const;
558 inline bool operator!()
const;
568 inline int operator!=(
const Value& v)
const;
573 inline int operator>(
const Value& v)
const;
578 inline int operator>=(
const Value& v)
const;
583 inline int operator<(
const Value& v)
const;
588 inline int operator<=(
const Value& v)
const;
623 inline Value& operator=(
const std::string& v);
690 EType _type{vitUndefined};
724 static const size_t _sizeExtra;
729 static const char* _typeNames[];
795 return set(
vitString,
static_cast<const void*
>(v.data()));
802 return set(as.toStdString());
805inline QString Value::getQString(
int precision)
const
873 return (_type ==
vitReference) ? _data._ref->getType() : _type;
888 return (_type ==
vitReference) ? _data._ref->getSize() : _size;
891inline Value::operator bool()
const
901inline Value::operator std::string()
const
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:28
Value container class able to performing arithmetic functions.
Definition Value.h:19
int compare(const Value &v) const
Compare this with the passed value.
Value(const void *v, size_t size)
Binary type constructor for implicit vitBinary.
bool setType(EType type)
Convert the instance to the passed type.
EType
Enumerate for available types.
Definition Value.h:34
@ vitReference
Definition Value.h:36
@ vitFloat
Definition Value.h:44
@ vitCustom
Definition Value.h:50
@ vitBinary
Definition Value.h:48
@ vitUndefined
Definition Value.h:40
@ vitInteger
Definition Value.h:42
@ vitInvalid
Definition Value.h:38
@ vitString
Definition Value.h:46
int operator>=(const Value &v) const
Larger than or equal operator.
Definition Value.h:921
int_type getInteger() const
Returns an integer value of the current value if possible.
Definition Value.h:999
Value & operator/=(const Value &v)
Divide by operator.
Definition Value.h:941
bool isNumber() const
Checks if this is a numeric type (vitFloat or vitInteger) of instance.
Definition Value.h:881
Value(EType type, const void *content, size_t size=0)
Specific type constructor.
static Value calculateOffset(Value value, Value min, Value max, const Value &len, bool clip)
Calculates the offset for a given range and set point.
friend std::ostream & operator<<(std::ostream &os, const Value &v)
Value div(const Value &v) const
Divide this with the passed value.
Value & operator%=(const Value &v)
Modulus operator.
Definition Value.h:946
bool operator!() const
Boolean invert operator.
Definition Value.h:896
static EType getType(const char *type)
the type corresponding to the passed type string.
friend std::istream & operator>>(std::istream &is, Value &v)
Value & round(const Value &v)
Rounds the current instance to a multiple of the passed value.
Value(int_type v)
# 64bit int_type type constructor for implicit vitInteger.
static const char * getType(EType type)
the type string of the passed type enumeration value.
flt_type _flt
Definition Value.h:709
size_t getSize() const
Returns size of the occupied space.
Definition Value.h:886
int operator>(const Value &v) const
Larger than operator.
Definition Value.h:916
bool isValid() const
Checks if the instance is valid. If the type is equals vitInvalid.
Definition Value.h:876
Value()
Default constructor.
Value mod(const Value &v) const
Modulus this with the passed value.
double flt_type
Type used internally for storing floating point value.
Definition Value.h:28
static const char * _invalidStr
Holds the invalid string when needed.
Definition Value.h:735
Value(bool v)
Boolean type constructor for implicit vitInteger.
int64_t int_type
Type used internally for storing integers.
Definition Value.h:24
const void * getBinary() const
Returns the pointer to the binary buffer if vitBinary.
Value sub(const Value &v) const
Subtract this with the passed value.
flt_type getFloat() const
Returns a floating point value of the current value if possible.
Definition Value.h:994
int_type getInteger(int *cnv_err) const
Returns an integer value of the current value if possible. if the current type is a string the 'cnv_e...
char * _ptr
Definition Value.h:705
Value * _ref
Definition Value.h:717
Value & operator-=(const Value &v)
Subtract operator.
Definition Value.h:956
int operator!=(const Value &v) const
Not equal operator.
Definition Value.h:911
std::string getString(int precision=std::numeric_limits< int >::max()) const
Gets the string of the value with the specified precision.
const char * getData() const
Returns pointer to the data.
bool isZero() const
Returns if the instance is type is zero.
int operator==(const Value &v) const
Equal operator.
Definition Value.h:906
Value add(const Value &v) const
Add this with the passed value.
Value & set(const Value &v)
Copies the content and type of the passed value.
Value & operator=(Value &&) noexcept
Move assignment operator is default.
int operator<(const Value &v) const
Less than operator.
Definition Value.h:926
EType getType() const
the current type for this instance.
Definition Value.h:871
flt_type getFloat(int *cnv_err) const
Returns a floating point value of the current value if possible.
Value(int v)
32bit integer type constructor for implicit vitInteger.
Value & set(int type, const void *content, size_t size=0)
Sets the instance type and content.
int_type _int
Definition Value.h:713
Value & assign(const Value &v)
Assigns a value of an instance but not changing the current type. Except for vitUndefined and vitInva...
Value(unsigned v)
32-bit unsigned integer type constructor for implicit vitInteger.
int operator<=(const Value &v) const
Less than or equal operator.
Definition Value.h:931
Value mul(const Value &v) const
Multiply this with the passed value.
Value & operator+=(const Value &v)
Add operator.
Definition Value.h:951
TVector< Value > vector_type
Definition Value.h:739
Value & operator*=(const Value &v)
Multiply by operator.
Definition Value.h:936
Value & set(Value *v)
Set this instance to references to the instance passed here as pointer.
Definition Value.h:989
#define _MISC_FUNC
Definition misc/global.h:34
#define _MISC_CLASS
Definition misc/global.h:35
Definition CodeEditor.h:8
const TQuaternion< T > operator-(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Definition TQuaternion.h:283
TARGET_IMPORT std::ostream & operator<<(std::ostream &os, const ResultData &)
Stream operator for the setup std::string.
TMatrix44< T > operator*(const TMatrix44< T > &lm, const TMatrix44< T > &rm)
Multiplies to matrices into a single one.
Definition TMatrix44.h:352
Value operator%(const Value &v1, const Value &v2)
Definition Value.h:1014
int precision(double value)
Returns the precision of the passed floating point value. This is the amount of characters after the ...
const TQuaternion< T > operator/(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Definition TQuaternion.h:295
TARGET_IMPORT std::istream & operator>>(std::istream &is, ResultData &)
Stream operator for setting up this instance with a setup std::string.
const TQuaternion< T > operator+(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Definition TQuaternion.h:277
bool operator==(const Md5Hash::hash_type &h1, const Md5Hash::hash_type &h2)
Compare operator for storing an MD5 hash.
QRect operator+=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:80
QPoint operator+(const QPoint &pt, const QSize &sz)
Allows moving a QPoint using a QSize.
Definition qt_utils.h:44
QPoint operator-(const QPoint &pt, const QSize &sz)
Allows moving a QPoint using a QSize.
Definition qt_utils.h:35
QRect operator-=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:99