103 explicit
Value(const std::
string& v);
111 explicit Value(
const QString& v);
134 explicit Value(
long v);
192 inline Value& set(
bool v);
200 inline Value& set(
int v);
220 inline Value& set(
unsigned v);
244 inline Value& set(
const char* v);
252 inline Value& set(
const std::string& v);
262 inline Value& set(
const QString& qs);
274 Value&
set(
int type,
const void* content,
size_t size = 0);
283 inline Value& set(
const void* v,
size_t size);
299 inline Value& assign(
bool v);
307 inline Value& assign(
int v);
315 inline Value& assign(
unsigned v);
325 Value& assign(
const long v);
342 inline Value& assign(
const char* v);
350 inline Value& assign(
const std::string& v);
360 inline Value& assign(
const QString& s);
371 inline Value& assign(
const void* v,
size_t size);
377 [[nodiscard]]
inline EType getType()
const;
404 [[nodiscard]]
bool isValid()
const;
410 [[nodiscard]]
bool isNumber()
const;
422 [[nodiscard]]
flt_type getFloat()
const;
434 [[nodiscard]]
int_type getInteger()
const;
439 [[nodiscard]]
size_t getSize()
const;
460 [[nodiscard]] std::string
getString(
int precision = std::numeric_limits<int>::max())
const;
467 [[nodiscard]] QString getQString(
int precision = std::numeric_limits<int>::max())
const;
494 Value& operator=(
const QString& v);
499 explicit operator QString()
const;
506 explicit operator std::string()
const;
511 explicit operator bool()
const;
516 bool operator!()
const;
526 int operator!=(
const Value& v)
const;
531 int operator>(
const Value& v)
const;
536 int operator>=(
const Value& v)
const;
541 int operator<(
const Value& v)
const;
546 int operator<=(
const Value& v)
const;
581 Value& operator=(
const std::string& v);
648 EType _type{vitUndefined};
682 static const size_t _sizeExtra;
687 static const char* _typeNames[];
754 return set(qs.toStdString());
757inline QString Value::getQString(
int precision)
const
825 return _type ==
vitReference ? _data._ref->getType() : _type;
840 return _type ==
vitReference ? _data._ref->getSize() : _size;
843inline Value::operator bool()
const
853inline Value::operator std::string()
const
sf::TimeSpec operator+(const timespec &lhs, const timespec &rhs)
Addition operator for std::timespec types which also work for sf::TimeSpec.
Definition TimeSpec.h:370
sf::TimeSpec operator-(const timespec &lhs, const timespec &rhs)
Subtraction operator for std::timespec types which also work for sf::TimeSpec.
Definition TimeSpec.h:381
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
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.
static std::string_view getType(EType type)
Gets the type string of the passed type enumeration value.
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:873
int_type getInteger() const
Returns an integer value of the current value if possible.
Definition Value.h:951
Value & operator/=(const Value &v)
Divide by operator.
Definition Value.h:893
bool isNumber() const
Checks if this is a numeric type (vitFloat or vitInteger) of instance.
Definition Value.h:833
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 class output stream operator.
Value div(const Value &v) const
Divide this with the passed value.
Value & operator%=(const Value &v)
Modulus operator.
Definition Value.h:898
bool operator!() const
Boolean invert operator.
Definition Value.h:848
friend std::istream & operator>>(std::istream &is, Value &v)
Value class input stream operator.
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.
flt_type _flt
Definition Value.h:667
size_t getSize() const
Gets the size of the occupied space.
Definition Value.h:838
int operator>(const Value &v) const
Larger than operator.
Definition Value.h:868
bool isValid() const
Checks if the instance is valid. If the type is equals vitInvalid.
Definition Value.h:828
Value()
Default constructor.
static EType getType(const std::string_view &type)
Gets the type corresponding to the passed type string.
~Value()
Destructor. Frees the allocated memory if some was allocated.
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:693
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
Gets the pointer to the binary buffer if vitBinary.
Value sub(const Value &v) const
Subtract this with the passed value.
flt_type getFloat() const
Gets a floating point value of the current value if possible.
Definition Value.h:946
Value & set(const Value *v)
Set this instance to references to the instance passed here as pointer. Makes this instance an alias ...
Definition Value.h:941
int_type getInteger(int *cnv_err) const
Gets an integer value of the current value if possible. if the current type is a string the 'cnv_err'...
char * _ptr
Definition Value.h:663
Value * _ref
Definition Value.h:675
Value & operator-=(const Value &v)
Subtract operator.
Definition Value.h:908
int operator!=(const Value &v) const
Not equal operator.
Definition Value.h:863
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
Gets pointer to the data. Only when the type is vitString, vitBinary or vitCustom.
bool isZero() const
Returns if the instance is type is zero. For non-numeric values this is when the data length is zero....
int operator==(const Value &v) const
Equal operator.
Definition Value.h:858
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. An existing reference type is undone.
Value & operator=(Value &&) noexcept
Move assignment operator is default.
int operator<(const Value &v) const
Less than operator.
Definition Value.h:878
EType getType() const
Gets the current type for this instance.
Definition Value.h:823
flt_type getFloat(int *cnv_err) const
Returns a floating point value of the current value if possible. When the current type is a string th...
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. Called by constructors and all set functions.
int_type _int
Definition Value.h:671
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:883
Value mul(const Value &v) const
Multiply this with the passed value.
Value & operator+=(const Value &v)
Add operator.
Definition Value.h:903
TVector< Value > vector_type
Definition Value.h:697
Value & operator*=(const Value &v)
Multiply by operator.
Definition Value.h:888
#define _MISC_FUNC
Definition misc/global.h:39
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
_GII_FUNC std::istream & operator>>(std::istream &is, ResultData &)
Stream operator for setting up this instance with a setup std::string.
TMatrix44< T > operator*(const TMatrix44< T > &lm, const TMatrix44< T > &rm)
Multiplies to matrices into a single one.
TQuaternion< T > operator/(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Divides two quaternions.
Definition TQuaternion.h:416
TQuaternion< T > operator+(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Adds two quaternions.
Definition TQuaternion.h:377
Value operator%(const Value &v1, const Value &v2)
Definition Value.h:966
_GII_FUNC std::ostream & operator<<(std::ostream &os, const ResultData &)
Stream operator for the setup std::string.
_MISC_FUNC bool operator==(const Md5Hash::hash_type &h1, const Md5Hash::hash_type &h2)
Compare operator for storing an MD5 hash.
TQuaternion< T > operator-(const TQuaternion< T > &lhs, const TQuaternion< T > &rhs)
Subtracts two quaternions.
Definition TQuaternion.h:390
_MISC_FUNC int precision(double value)
Returns the precision of the passed floating point value. This is the amount of characters after the ...
bool isZero(T value, T epsilon=std::numeric_limits< T >::epsilon())
Check if the passed value is zero or near zero according the given epsilon.
Definition misc/gen/math.h:245
QRect operator+=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:66
QRect operator-=(QRect &rc, const QPoint &pt)
Allows adjusting the QRect position using a QPoint.
Definition qt_utils.h:83