本文整理汇总了C++中exiv2::value::AutoPtr::size方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoPtr::size方法的具体用法?C++ AutoPtr::size怎么用?C++ AutoPtr::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exiv2::value::AutoPtr
的用法示例。
在下文中一共展示了AutoPtr::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exivValueToKMDValue
// Convert an exiv value to a KisMetaData value
KisMetaData::Value exivValueToKMDValue(const Exiv2::Value::AutoPtr value, bool forceSeq, KisMetaData::Value::ValueType arrayType)
{
switch (value->typeId()) {
case Exiv2::signedByte:
case Exiv2::invalidTypeId:
case Exiv2::lastTypeId:
case Exiv2::directory:
dbgFile << "Invalid value :" << value->typeId() << " value =" << value->toString().c_str();
return KisMetaData::Value();
case Exiv2::undefined: {
dbgFile << "Undefined value :" << value->typeId() << " value =" << value->toString().c_str();
QByteArray array(value->count() , 0);
value->copy((Exiv2::byte*)array.data(), Exiv2::invalidByteOrder);
return KisMetaData::Value(QString(array.toBase64()));
}
case Exiv2::unsignedByte:
case Exiv2::unsignedShort:
case Exiv2::unsignedLong:
case Exiv2::signedShort:
case Exiv2::signedLong: {
if (value->count() == 1 && !forceSeq) {
return KisMetaData::Value((int)value->toLong());
} else {
QList<KisMetaData::Value> array;
for (int i = 0; i < value->count(); i++)
array.push_back(KisMetaData::Value((int)value->toLong(i)));
return KisMetaData::Value(array, arrayType);
}
}
case Exiv2::asciiString:
case Exiv2::string:
case Exiv2::comment: // look at kexiv2 for the problem about decoding correctly that tag
return KisMetaData::Value(value->toString().c_str());
case Exiv2::unsignedRational:
if(value->size() < 2)
{
dbgFile << "Invalid size :" << value->size() << " value =" << value->toString().c_str();
return KisMetaData::Value();
}
return KisMetaData::Value(KisMetaData::Rational(value->toRational().first , value->toRational().second));
case Exiv2::signedRational:
if(value->size() < 2)
{
dbgFile << "Invalid size :" << value->size() << " value =" << value->toString().c_str();
return KisMetaData::Value();
}
return KisMetaData::Value(KisMetaData::Rational(value->toRational().first , value->toRational().second));
case Exiv2::date:
case Exiv2::time:
return KisMetaData::Value(QDateTime::fromString(value->toString().c_str(), Qt::ISODate));
case Exiv2::xmpText:
case Exiv2::xmpAlt:
case Exiv2::xmpBag:
case Exiv2::xmpSeq:
case Exiv2::langAlt:
default: {
dbgFile << "Unknown type id :" << value->typeId() << " value =" << value->toString().c_str();
//Q_ASSERT(false); // This point must never be reached !
return KisMetaData::Value();
}
}
dbgFile << "Unknown type id :" << value->typeId() << " value =" << value->toString().c_str();
//Q_ASSERT(false); // This point must never be reached !
return KisMetaData::Value();
}