doc core reference done
This commit is contained in:
@@ -20,32 +20,49 @@
|
||||
#include "pivariant.h"
|
||||
|
||||
|
||||
/** \class PIVariant
|
||||
* \details
|
||||
* \section PIVariant_sec0 Synopsis
|
||||
* This class provides general type that can contains all standard types, some
|
||||
* PIP types or custom type. In case of standard types this class also provides
|
||||
* convertions between them.
|
||||
*
|
||||
* \section PIVariant_sec1 Usage
|
||||
* %PIVariant useful if you want pass many variables with different types in
|
||||
* single array, e.g.:
|
||||
* \code{cpp}
|
||||
* PIVector<PIVariant> array;
|
||||
* array << PIVariant(10) << PIVariant(1.61) << PIVariant(true) << PIVariant("0xFF");
|
||||
* piCout << array;
|
||||
* piForeachC (PIVariant & i, array)
|
||||
* piCout << i.toInt();
|
||||
* \endcode
|
||||
* Result:
|
||||
* \code{cpp}
|
||||
* {PIVariant(Int, 10), PIVariant(Double, 1,61), PIVariant(Bool, true), PIVariant(String, 0xFF)}
|
||||
* 10
|
||||
* 1
|
||||
* 1
|
||||
* 255
|
||||
* \endcode
|
||||
* */
|
||||
//! \class PIVariant pivariant.h
|
||||
//! \details
|
||||
//! \~english \section PIVariant_sec0 Synopsis
|
||||
//! \~russian \section PIVariant_sec0 Краткий обзор
|
||||
//! \~english
|
||||
//! This class provides general type that can contains all standard types, some
|
||||
//! PIP types or custom type. In case of standard types this class also provides
|
||||
//! convertions between them.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Этот класс предоставляет некий общий тип, который может содержать все стандартные тип,
|
||||
//! некоторые типы PIP, а также любой свой тип. В случае стандартных типов предоставляется
|
||||
//! автоматическое преобразование между ними.
|
||||
//!
|
||||
//! \~english \section PIVariant_sec1 Usage
|
||||
//! \~russian \section PIVariant_sec1 Использование
|
||||
//! \~english
|
||||
//! %PIVariant useful if you want pass many variables with different types in
|
||||
//! single array, or type may vary from case to case, e.g.:
|
||||
//!
|
||||
//! \~russian
|
||||
//! %PIVariant полезен когда надо передать несколько разнотипных значений
|
||||
//! одним массивом, или тип заранее неизвестен, например:
|
||||
//!
|
||||
//! \~\code{cpp}
|
||||
//! PIVector<PIVariant> array;
|
||||
//! array << PIVariant(10) << PIVariant(1.61) << PIVariant(true) << PIVariant("0xFF");
|
||||
//! piCout << array;
|
||||
//! for (auto i: array)
|
||||
//! piCout << i.toInt();
|
||||
//! \endcode
|
||||
//!
|
||||
//! \~english Result:
|
||||
//! \~russian Результат:
|
||||
//! \~\code{cpp}
|
||||
//! {PIVariant(Int, 10), PIVariant(Double, 1,61), PIVariant(Bool, true), PIVariant(String, 0xFF)}
|
||||
//! 10
|
||||
//! 1
|
||||
//! 1
|
||||
//! 255
|
||||
//! \endcode
|
||||
//!
|
||||
|
||||
|
||||
#ifdef CUSTOM_PIVARIANT
|
||||
PIMap<PIString, __PIVariantInfo__ * > * __PIVariantInfoStorage__::map = 0;
|
||||
@@ -158,6 +175,8 @@ PIVariant::Type PIVariant::typeFromName(const PIString & tname) {
|
||||
if (s == "rect") return PIVariant::pivRect;
|
||||
if (s == "vector") return PIVariant::pivMathVector;
|
||||
if (s == "matrix") return PIVariant::pivMathMatrix;
|
||||
if (s == "line") return PIVariant::pivLine;
|
||||
if (s == "device" || s == "iodevice") return PIVariant::pivIODevice;
|
||||
return PIVariant::pivInvalid;
|
||||
}
|
||||
|
||||
@@ -219,12 +238,25 @@ PIString PIVariant::typeName(PIVariant::Type type) {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as boolean
|
||||
* \details In case of numeric types returns \b true if value != 0. \n
|
||||
* In case of String type returns \a PIString::toBool(). \n
|
||||
* In case of StringList type returns \b false if string list is empty,
|
||||
* otherwise returns \a PIString::toBool() of first string. \n
|
||||
* In case of other types returns \b false. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as boolean
|
||||
//! \~russian Возвращает содержимое как boolean
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns \b true if value != 0. \n
|
||||
//! In case of String type returns \a PIString::toBool(). \n
|
||||
//! In case of StringList type returns \b false if string list is empty,
|
||||
//! otherwise returns \a PIString::toBool() of first string. \n
|
||||
//! In case of other types returns \b false.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает \b true если значение != 0. \n
|
||||
//! Для типа String возвращает \a PIString::toBool(). \n
|
||||
//! Для типа StringList возвращает \b false если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toBool() первой строки. \n
|
||||
//! Для остальных типов возвращает \b false.
|
||||
//!
|
||||
bool PIVariant::toBool() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -250,12 +282,25 @@ bool PIVariant::toBool() const {
|
||||
|
||||
|
||||
|
||||
/** \brief Returns variant content as int
|
||||
* \details In case of numeric types returns integer value. \n
|
||||
* In case of String type returns \a PIString::toInt(). \n
|
||||
* In case of StringList type returns \b 0 if string list is empty,
|
||||
* otherwise returns \a PIString::toInt() of first string. \n
|
||||
* In case of other types returns \b 0. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as int
|
||||
//! \~russian Возвращает содержимое как int
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns integer value. \n
|
||||
//! In case of String type returns \a PIString::toInt(). \n
|
||||
//! In case of StringList type returns \b 0 if string list is empty,
|
||||
//! otherwise returns \a PIString::toInt() of first string. \n
|
||||
//! In case of other types returns \b 0.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает целочисленное значение. \n
|
||||
//! Для типа String возвращает \a PIString::toInt(). \n
|
||||
//! Для типа StringList возвращает \b 0 если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toInt() первой строки. \n
|
||||
//! Для остальных типов возвращает \b 0.
|
||||
//!
|
||||
int PIVariant::toInt() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -282,12 +327,25 @@ int PIVariant::toInt() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as long long
|
||||
* \details In case of numeric types returns integer value. \n
|
||||
* In case of String type returns \a PIString::toLLong(). \n
|
||||
* In case of StringList type returns \b 0L if string list is empty,
|
||||
* otherwise returns \a PIString::toLLong() of first string. \n
|
||||
* In case of other types returns \b 0L. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as long long
|
||||
//! \~russian Возвращает содержимое как long long
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns integer value. \n
|
||||
//! In case of String type returns \a PIString::toLLong(). \n
|
||||
//! In case of StringList type returns \b 0L if string list is empty,
|
||||
//! otherwise returns \a PIString::toLLong() of first string. \n
|
||||
//! In case of other types returns \b 0L.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает целочисленное значение. \n
|
||||
//! Для типа String возвращает \a PIString::toLLong(). \n
|
||||
//! Для типа StringList возвращает \b 0L если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toLLong() первой строки. \n
|
||||
//! Для остальных типов возвращает \b 0L.
|
||||
//!
|
||||
llong PIVariant::toLLong() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -313,12 +371,25 @@ llong PIVariant::toLLong() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as float
|
||||
* \details In case of numeric types returns float value. \n
|
||||
* In case of String type returns \a PIString::toFloat(). \n
|
||||
* In case of StringList type returns \b 0.f if string list is empty,
|
||||
* otherwise returns \a PIString::toFloat() of first string. \n
|
||||
* In case of other types returns \b 0.f. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as float
|
||||
//! \~russian Возвращает содержимое как float
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns float value. \n
|
||||
//! In case of String type returns \a PIString::toFloat(). \n
|
||||
//! In case of StringList type returns \b 0.f if string list is empty,
|
||||
//! otherwise returns \a PIString::toFloat() of first string. \n
|
||||
//! In case of other types returns \b 0.f .
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает вещественное значение. \n
|
||||
//! Для типа String возвращает \a PIString::toFloat(). \n
|
||||
//! Для типа StringList возвращает \b 0.f если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toFloat() первой строки. \n
|
||||
//! Для остальных типов возвращает \b 0.f .
|
||||
//!
|
||||
float PIVariant::toFloat() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -344,12 +415,25 @@ float PIVariant::toFloat() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as double
|
||||
* \details In case of numeric types returns double value. \n
|
||||
* In case of String type returns \a PIString::toDouble(). \n
|
||||
* In case of StringList type returns \b 0. if string list is empty,
|
||||
* otherwise returns \a PIString::toDouble() of first string. \n
|
||||
* In case of other types returns \b 0.. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as double
|
||||
//! \~russian Возвращает содержимое как double
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns double value. \n
|
||||
//! In case of String type returns \a PIString::toDouble(). \n
|
||||
//! In case of StringList type returns \b 0. if string list is empty,
|
||||
//! otherwise returns \a PIString::toDouble() of first string. \n
|
||||
//! In case of other types returns \b 0. .
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает вещественное значение. \n
|
||||
//! Для типа String возвращает \a PIString::toDouble(). \n
|
||||
//! Для типа StringList возвращает \b 0. если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toDouble() первой строки. \n
|
||||
//! Для остальных типов возвращает \b 0. .
|
||||
//!
|
||||
double PIVariant::toDouble() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -375,12 +459,25 @@ double PIVariant::toDouble() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as long double
|
||||
* \details In case of numeric types returns long double value. \n
|
||||
* In case of String type returns \a PIString::toLDouble(). \n
|
||||
* In case of StringList type returns \b 0. if string list is empty,
|
||||
* otherwise returns \a PIString::toLDouble() of first string. \n
|
||||
* In case of other types returns \b 0.. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as long double
|
||||
//! \~russian Возвращает содержимое как long double
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns long double value. \n
|
||||
//! In case of String type returns \a PIString::toLDouble(). \n
|
||||
//! In case of StringList type returns \b 0. if string list is empty,
|
||||
//! otherwise returns \a PIString::toLDouble() of first string. \n
|
||||
//! In case of other types returns \b 0. .
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает вещественное значение. \n
|
||||
//! Для типа String возвращает \a PIString::toLDouble(). \n
|
||||
//! Для типа StringList возвращает \b 0. если массив пустой, \n
|
||||
//! иначе возвращает \a PIString::toLDouble() первой строки. \n
|
||||
//! Для остальных типов возвращает \b 0. .
|
||||
//!
|
||||
ldouble PIVariant::toLDouble() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -406,10 +503,21 @@ ldouble PIVariant::toLDouble() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as time
|
||||
* \details In case of Time type returns time value. \n
|
||||
* In case of DateTime type returns time part of value. \n
|
||||
* In case of other types returns \a PITime(). */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as time
|
||||
//! \~russian Возвращает содержимое как время
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Time type returns time value. \n
|
||||
//! In case of DateTime type returns time part of value. \n
|
||||
//! In case of other types returns \a PITime().
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Time возвращает время. \n
|
||||
//! Для типа DateTime возвращает часть времени. \n
|
||||
//! Для остальных типов возвращает \a PITime().
|
||||
//!
|
||||
PITime PIVariant::toTime() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivTime) {PITime r; ba >> r; return r;}
|
||||
@@ -419,10 +527,21 @@ PITime PIVariant::toTime() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as date
|
||||
* \details In case of Date type returns date value. \n
|
||||
* In case of DateTime type returns date part of value. \n
|
||||
* In case of other types returns \a PIDate(). */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as date
|
||||
//! \~russian Возвращает содержимое как дата
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Date type returns date value. \n
|
||||
//! In case of DateTime type returns date part of value. \n
|
||||
//! In case of other types returns \a PIDate().
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Date возвращает дату. \n
|
||||
//! Для типа DateTime возвращает часть даты. \n
|
||||
//! Для остальных типов возвращает \a PIDate().
|
||||
//!
|
||||
PIDate PIVariant::toDate() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivDate) {PIDate r; ba >> r; return r;}
|
||||
@@ -432,11 +551,23 @@ PIDate PIVariant::toDate() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as date and time
|
||||
* \details In case of Time type returns time value with null date. \n
|
||||
* In case of Date type returns date value with null time. \n
|
||||
* In case of DateTime type returns date and time. \n
|
||||
* In case of other types returns \a PIDateTime(). */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as date and time
|
||||
//! \~russian Возвращает содержимое как дата и время
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Time type returns time value with null date. \n
|
||||
//! In case of Date type returns date value with null time. \n
|
||||
//! In case of DateTime type returns date and time. \n
|
||||
//! In case of other types returns \a PIDateTime().
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Time возвращает время без даты. \n
|
||||
//! Для типа Date возвращает дату без времени. \n
|
||||
//! Для типа DateTime возвращает время и дату. \n
|
||||
//! Для остальных типов возвращает \a PIDateTime().
|
||||
//!
|
||||
PIDateTime PIVariant::toDateTime() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivTime) {PITime r; ba >> r; return PIDateTime(r);}
|
||||
@@ -447,10 +578,19 @@ PIDateTime PIVariant::toDateTime() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as system time
|
||||
* \details In case of SystemTime type returns system time. \n
|
||||
* In case of other types returns \a PISystemTime::fromSeconds() from
|
||||
* double value of variant content. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as system time
|
||||
//! \~russian Возвращает содержимое как системное время
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of SystemTime type returns system time. \n
|
||||
//! In case of other types returns \a PISystemTime::fromSeconds() from \a toDouble().
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа SystemTime возвращает системное время. \n
|
||||
//! Для остальных типов возвращает \a PISystemTime::fromSeconds() от \a toDouble().
|
||||
//!
|
||||
PISystemTime PIVariant::toSystemTime() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivSystemTime) {PISystemTime r; ba >> r; return r;}
|
||||
@@ -459,15 +599,30 @@ PISystemTime PIVariant::toSystemTime() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as string
|
||||
* \details In case of numeric types returns \a PIString::fromNumber(). \n
|
||||
* In case of String type returns string value. \n
|
||||
* In case of StringList type returns joined string ("(" + PIStringList::join("; ") + ")"). \n
|
||||
* In case of BitArray or ByteArray types returns number of bits/bytes. \n
|
||||
* In case of Time, Date or DateTime types returns toString() of this values. \n
|
||||
* In case of SystemTime types returns second and nanoseconds of time
|
||||
* ("(PISystemTime::seconds s, PISystemTime::nanoseconds ns)"). \n
|
||||
* In case of other types returns \b "". */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as string
|
||||
//! \~russian Возвращает содержимое как строка
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of numeric types returns \a PIString::fromNumber(). \n
|
||||
//! In case of String type returns string value. \n
|
||||
//! In case of StringList type returns joined string ("(" + PIStringList::join("; ") + ")"). \n
|
||||
//! In case of BitArray or ByteArray types returns number of bits/bytes. \n
|
||||
//! In case of Time, Date or DateTime types returns toString() of this values. \n
|
||||
//! In case of SystemTime types returns second and nanoseconds of time
|
||||
//! ("(PISystemTime::seconds s, PISystemTime::nanoseconds ns)"). \n
|
||||
//! In case of other types returns \b "".
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для численных типов возвращает \a PIString::fromNumber(). \n
|
||||
//! Для типа String возвращает строку. \n
|
||||
//! Для типа StringList возвращает объединенную строку ("(" + PIStringList::join("; ") + ")"). \n
|
||||
//! Для типов BitArray или ByteArray возвращает количество бит/байт. \n
|
||||
//! Для типов Time, Date или DateTime возвращает toString(). \n
|
||||
//! Для типов SystemTime возвращает секунды и наносекунды в формате "(s, ns)".
|
||||
//! Для остальных типов возвращает \b "".
|
||||
//!
|
||||
PIString PIVariant::toString() const {
|
||||
PIByteArray ba(_content);
|
||||
switch (_type) {
|
||||
@@ -500,9 +655,19 @@ PIString PIVariant::toString() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as strings list
|
||||
* \details In case of StringList type returns strings list value. \n
|
||||
* In case of other types returns \a PIStringList with one string value of variant content. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as strings list
|
||||
//! \~russian Возвращает содержимое как массив строк
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of StringList type returns strings list value. \n
|
||||
//! In case of other types returns \a PIStringList with one string \a toString().
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа StringList возвращает массив строк. \n
|
||||
//! Для остальных типов возвращает \a PIStringList с одной строкой \a toString().
|
||||
//!
|
||||
PIStringList PIVariant::toStringList() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivStringList) {PIStringList r; ba >> r; return r;}
|
||||
@@ -512,9 +677,19 @@ PIStringList PIVariant::toStringList() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as bit array
|
||||
* \details In case of BitArray type returns bit array value. \n
|
||||
* In case of other types returns \a PIBitArray from \a toLLong() value. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as bit array
|
||||
//! \~russian Возвращает содержимое как массив битов
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of BitArray type returns bit array value. \n
|
||||
//! In case of other types returns \a PIBitArray from \a toLLong() value.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа BitArray возвращает массив битов. \n
|
||||
//! Для остальных типов возвращает \a PIBitArray от значения \a toLLong().
|
||||
//!
|
||||
PIBitArray PIVariant::toBitArray() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivBitArray) {PIBitArray r; ba >> r; return r;}
|
||||
@@ -523,9 +698,19 @@ PIBitArray PIVariant::toBitArray() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as byte array
|
||||
* \details In case of ByteArray type returns byte array value. \n
|
||||
* In case of other types returns empty \a PIByteArray. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as byte array
|
||||
//! \~russian Возвращает содержимое как массив байтов
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of ByteArray type returns byte array value. \n
|
||||
//! In case of other types returns empty \a PIByteArray.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа ByteArray возвращает массив байтов. \n
|
||||
//! Для остальных типов возвращает пустой \a PIByteArray.
|
||||
//!
|
||||
PIByteArray PIVariant::toByteArray() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivByteArray) {PIByteArray r; ba >> r; return r;}
|
||||
@@ -534,11 +719,23 @@ PIByteArray PIVariant::toByteArray() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as enum
|
||||
* \details In case of Enum type returns enum value. \n
|
||||
* In case of String returns Enum with one member. \n
|
||||
* In case of StringList returns Enum with corresponding members. \n
|
||||
* In case of other types returns empty Enum. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as enum
|
||||
//! \~russian Возвращает содержимое как перечисление
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Enum type returns enum value. \n
|
||||
//! In case of String returns Enum with one member. \n
|
||||
//! In case of StringList returns Enum with corresponding members. \n
|
||||
//! In case of other types returns empty Enum.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Enum возвращает перечисление. \n
|
||||
//! Для типа String возвращает Enum с одним членом. \n
|
||||
//! Для типа StringList возвращает Enum с членами по строкам. \n
|
||||
//! Для остальных типов возвращает пустой Enum.
|
||||
//!
|
||||
PIVariantTypes::Enum PIVariant::toEnum() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivEnum) {PIVariantTypes::Enum r; ba >> r; return r;}
|
||||
@@ -549,10 +746,21 @@ PIVariantTypes::Enum PIVariant::toEnum() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as file
|
||||
* \details In case of File type returns file value. \n
|
||||
* In case of String returns File with string value path. \n
|
||||
* In case of other types returns empty File. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as file
|
||||
//! \~russian Возвращает содержимое как файл
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of File type returns file value. \n
|
||||
//! In case of String returns File with string value path. \n
|
||||
//! In case of other types returns empty File.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа File возвращает файл. \n
|
||||
//! Для типа String возвращает File с путем значения строки. \n
|
||||
//! Для остальных типов возвращает пустой File.
|
||||
//!
|
||||
PIVariantTypes::File PIVariant::toFile() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivFile) {PIVariantTypes::File r; ba >> r; return r;}
|
||||
@@ -562,10 +770,21 @@ PIVariantTypes::File PIVariant::toFile() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as dir
|
||||
* \details In case of Dir type returns dir value. \n
|
||||
* In case of String returns Dir with string value path. \n
|
||||
* In case of other types returns empty Dir. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as dir
|
||||
//! \~russian Возвращает содержимое как директория
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Dir type returns dir value. \n
|
||||
//! In case of String returns Dir with string value path. \n
|
||||
//! In case of other types returns empty Dir.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Dir возвращает директорию. \n
|
||||
//! Для типа String возвращает Dir с путем значения строки. \n
|
||||
//! Для остальных типов возвращает пустой Dir.
|
||||
//!
|
||||
PIVariantTypes::Dir PIVariant::toDir() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivDir) {PIVariantTypes::Dir r; ba >> r; return r;}
|
||||
@@ -575,10 +794,21 @@ PIVariantTypes::Dir PIVariant::toDir() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as color
|
||||
* \details In case of Color type returns color value. \n
|
||||
* In case of int returns color with int value. \n
|
||||
* In case of other types returns empty Color. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as color
|
||||
//! \~russian Возвращает содержимое как цвет
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Color type returns color value. \n
|
||||
//! In case of Int returns color with int value. \n
|
||||
//! In case of other types returns empty Color.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Color возвращает цвет. \n
|
||||
//! Для типа Int возвращает цвет с целочисленным значением. \n
|
||||
//! Для остальных типов возвращает пустой Color.
|
||||
//!
|
||||
PIVariantTypes::Color PIVariant::toColor() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivColor) {PIVariantTypes::Color r; ba >> r; return r;}
|
||||
@@ -588,9 +818,19 @@ PIVariantTypes::Color PIVariant::toColor() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as IODevice
|
||||
* \details In case of IODevice type returns IODevice value. \n
|
||||
* In case of other types returns empty IODevice. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as IODevice
|
||||
//! \~russian Возвращает содержимое как IODevice
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of IODevice type returns IODevice value. \n
|
||||
//! In case of other types returns empty IODevice.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа IODevice возвращает IODevice. \n
|
||||
//! Для остальных типов возвращает пустой IODevice.
|
||||
//!
|
||||
PIVariantTypes::IODevice PIVariant::toIODevice() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivIODevice) {PIVariantTypes::IODevice r; ba >> r; return r;}
|
||||
@@ -598,9 +838,19 @@ PIVariantTypes::IODevice PIVariant::toIODevice() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as point
|
||||
* \details In case of PIPointd type returns point value. \n
|
||||
* In case of other types returns empty PIPointd. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as point
|
||||
//! \~russian Возвращает содержимое как точка
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Point type returns point value. \n
|
||||
//! In case of other types returns empty PIPointd.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Point возвращает точку. \n
|
||||
//! Для остальных типов возвращает пустую PIPointd.
|
||||
//!
|
||||
PIPointd PIVariant::toPoint() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivPoint) {PIPointd r; ba >> r; return r;}
|
||||
@@ -608,9 +858,19 @@ PIPointd PIVariant::toPoint() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as rect
|
||||
* \details In case of PIRectd type returns rect value. \n
|
||||
* In case of other types returns empty PIRectd. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as rect
|
||||
//! \~russian Возвращает содержимое как прямоугольник
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Rect type returns rect value. \n
|
||||
//! In case of other types returns empty PIRectd.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Rect возвращает прямоугольник. \n
|
||||
//! Для остальных типов возвращает пустой PIRectd.
|
||||
//!
|
||||
PIRectd PIVariant::toRect() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivRect) {PIRectd r; ba >> r; return r;}
|
||||
@@ -618,9 +878,19 @@ PIRectd PIVariant::toRect() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as line
|
||||
* \details In case of PILined type returns line value. \n
|
||||
* In case of other types returns empty PILined. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as line
|
||||
//! \~russian Возвращает содержимое как линия
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of Line type returns line value. \n
|
||||
//! In case of other types returns empty PILined.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа Line возвращает линию. \n
|
||||
//! Для остальных типов возвращает пустую PILined.
|
||||
//!
|
||||
PILined PIVariant::toLine() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivLine) {PILined r; ba >> r; return r;}
|
||||
@@ -628,9 +898,19 @@ PILined PIVariant::toLine() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as math vector
|
||||
* \details In case of PIMathVectord type returns rect value. \n
|
||||
* In case of other types returns empty PIMathVectord. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as math vector
|
||||
//! \~russian Возвращает содержимое как вектор
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of MathVector type returns rect value. \n
|
||||
//! In case of other types returns empty PIMathVectord.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа MathVector возвращает вектор. \n
|
||||
//! Для остальных типов возвращает пустой PIMathVectord.
|
||||
//!
|
||||
PIMathVectord PIVariant::toMathVector() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivMathVector) {PIMathVectord r; ba >> r; return r;}
|
||||
@@ -638,9 +918,19 @@ PIMathVectord PIVariant::toMathVector() const {
|
||||
}
|
||||
|
||||
|
||||
/** \brief Returns variant content as math matrix
|
||||
* \details In case of PIMathMatrixd type returns rect value. \n
|
||||
* In case of other types returns empty PIMathMatrixd. */
|
||||
//! \~\brief
|
||||
//! \~english Returns variant content as math matrix
|
||||
//! \~russian Возвращает содержимое как матрица
|
||||
//!
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! In case of MathMatrix type returns rect value. \n
|
||||
//! In case of other types returns empty PIMathMatrixd.
|
||||
//!
|
||||
//! \~russian
|
||||
//! Для типа MathMatrix возвращает матрицу. \n
|
||||
//! Для остальных типов возвращает пустую PIMathMatrixd.
|
||||
//!
|
||||
PIMathMatrixd PIVariant::toMathMatrix() const {
|
||||
PIByteArray ba(_content);
|
||||
if (_type == PIVariant::pivMathMatrix) {PIMathMatrixd r; ba >> r; return r;}
|
||||
|
||||
Reference in New Issue
Block a user