git-svn-id: svn://db.shs.com.ru/pip@269 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -133,30 +133,30 @@ public:
|
||||
|
||||
//! Type of %PIVariant content
|
||||
enum Type {
|
||||
Invalid /** Invalid type , default type of empty contructor */ = 0 ,
|
||||
Bool /** bool */ ,
|
||||
Char /** char */ ,
|
||||
UChar /** uchar */ ,
|
||||
Short /** short */ ,
|
||||
UShort /** ushort */ ,
|
||||
Int /** int */ ,
|
||||
UInt /** uint */ ,
|
||||
LLong /** llong */ ,
|
||||
ULLong /** ullong */ ,
|
||||
Float /** float */ ,
|
||||
Double /** double */ ,
|
||||
LDouble /** ldouble */ ,
|
||||
Complexd /** complexd */ ,
|
||||
Complexld /** complexld */ ,
|
||||
BitArray /** PIBitArray */ ,
|
||||
ByteArray /** PIByteArray */ ,
|
||||
String /** PIString */ ,
|
||||
StringList /** PIStringList */ ,
|
||||
Time /** PITime */ ,
|
||||
Date /** PIDate */ ,
|
||||
DateTime /** PIDateTime */ ,
|
||||
SystemTime /** PISystemTime */ ,
|
||||
Custom /** Custom */ = 0xFF
|
||||
pivInvalid /** Invalid type , default type of empty contructor */ = 0 ,
|
||||
pivBool /** bool */ ,
|
||||
pivChar /** char */ ,
|
||||
pivUChar /** uchar */ ,
|
||||
pivShort /** short */ ,
|
||||
pivUShort /** ushort */ ,
|
||||
pivInt /** int */ ,
|
||||
pivUInt /** uint */ ,
|
||||
pivLLong /** llong */ ,
|
||||
pivULLong /** ullong */ ,
|
||||
pivFloat /** float */ ,
|
||||
pivDouble /** double */ ,
|
||||
pivLDouble /** ldouble */ ,
|
||||
pivComplexd /** complexd */ ,
|
||||
pivComplexld /** complexld */ ,
|
||||
pivBitArray /** PIBitArray */ ,
|
||||
pivByteArray /** PIByteArray */ ,
|
||||
pivString /** PIString */ ,
|
||||
pivStringList /** PIStringList */ ,
|
||||
pivTime /** PITime */ ,
|
||||
pivDate /** PIDate */ ,
|
||||
pivDateTime /** PIDateTime */ ,
|
||||
pivSystemTime /** PISystemTime */ ,
|
||||
pivCustom /** Custom */ = 0xFF
|
||||
};
|
||||
|
||||
//! Empty constructor, \a type() will be set to \a Invalid
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
|
||||
|
||||
//! Returns \b true if type is not Invalid
|
||||
bool isValid() const {return _type != PIVariant::Invalid;}
|
||||
bool isValid() const {return _type != PIVariant::pivInvalid;}
|
||||
|
||||
|
||||
/** \brief Returns new variant from custom type
|
||||
@@ -437,14 +437,14 @@ public:
|
||||
if (!ret._info) {
|
||||
#endif
|
||||
PIVariant::Type t = typeFromName(type);
|
||||
if (t == Invalid) {
|
||||
if (t == pivInvalid) {
|
||||
piCout << "Can`t initialize PIVariant from unregistered type \"" << type << "\"!";
|
||||
return ret;
|
||||
}
|
||||
ret._type = t;
|
||||
#ifdef CUSTOM_PIVARIANT
|
||||
} else
|
||||
ret._type = Custom;
|
||||
ret._type = pivCustom;
|
||||
#endif
|
||||
ret._content = c;
|
||||
return ret;
|
||||
@@ -459,13 +459,13 @@ public:
|
||||
|
||||
private:
|
||||
void destroy() {_content.clear();}
|
||||
template <typename T> static Type getType() {return Custom;}
|
||||
template <typename T> static Type getType() {return pivCustom;}
|
||||
template <typename T> void initType(const T & v) {
|
||||
_content.clear();
|
||||
_content << v;
|
||||
_type = getType<T>();
|
||||
#ifdef CUSTOM_PIVARIANT
|
||||
if (_type == Custom) {
|
||||
if (_type == pivCustom) {
|
||||
_info = __PIVariantInfoStorage__::get()->map->value(__PIVariantFunctions__<T>::typeNameHelper(), 0);
|
||||
if (!_info)
|
||||
piCout << "Can`t initialize PIVariant from unregistered type!";
|
||||
@@ -550,28 +550,28 @@ template<> inline PIVariant PIVariant::fromValue(const PIDate & v) {return PIVar
|
||||
template<> inline PIVariant PIVariant::fromValue(const PIDateTime & v) {return PIVariant(v);}
|
||||
template<> inline PIVariant PIVariant::fromValue(const PISystemTime & v) {return PIVariant(v);}
|
||||
|
||||
template<> inline PIVariant::Type PIVariant::getType<bool>() {return PIVariant::Bool;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<char>() {return PIVariant::Char;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<uchar>() {return PIVariant::UChar;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<short>() {return PIVariant::Short;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ushort>() {return PIVariant::UShort;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<int>() {return PIVariant::Int;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<uint>() {return PIVariant::UInt;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<llong>() {return PIVariant::LLong;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ullong>() {return PIVariant::ULLong;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<float>() {return PIVariant::Float;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<double>() {return PIVariant::Double;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ldouble>() {return PIVariant::LDouble;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<complexd>() {return PIVariant::Complexd;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<complexld>() {return PIVariant::Complexld;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIBitArray>() {return PIVariant::BitArray;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIByteArray>() {return PIVariant::ByteArray;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIString>() {return PIVariant::String;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIStringList>() {return PIVariant::StringList;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PITime>() {return PIVariant::Time;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIDate>() {return PIVariant::Date;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIDateTime>() {return PIVariant::DateTime;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PISystemTime>() {return PIVariant::SystemTime;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<bool>() {return PIVariant::pivBool;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<char>() {return PIVariant::pivChar;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<uchar>() {return PIVariant::pivUChar;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<short>() {return PIVariant::pivShort;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ushort>() {return PIVariant::pivUShort;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<int>() {return PIVariant::pivInt;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<uint>() {return PIVariant::pivUInt;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<llong>() {return PIVariant::pivLLong;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ullong>() {return PIVariant::pivULLong;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<float>() {return PIVariant::pivFloat;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<double>() {return PIVariant::pivDouble;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<ldouble>() {return PIVariant::pivLDouble;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<complexd>() {return PIVariant::pivComplexd;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<complexld>() {return PIVariant::pivComplexld;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIBitArray>() {return PIVariant::pivBitArray;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIByteArray>() {return PIVariant::pivByteArray;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIString>() {return PIVariant::pivString;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIStringList>() {return PIVariant::pivStringList;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PITime>() {return PIVariant::pivTime;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIDate>() {return PIVariant::pivDate;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PIDateTime>() {return PIVariant::pivDateTime;}
|
||||
template<> inline PIVariant::Type PIVariant::getType<PISystemTime>() {return PIVariant::pivSystemTime;}
|
||||
|
||||
inline PICout operator <<(PICout s, const PIVariant & v) {
|
||||
s.space(); s.setControl(0, true);
|
||||
|
||||
Reference in New Issue
Block a user