本文整理汇总了C++中exiv2::exifdata::const_iterator::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::toString方法的具体用法?C++ const_iterator::toString怎么用?C++ const_iterator::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exiv2::exifdata::const_iterator
的用法示例。
在下文中一共展示了const_iterator::toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StrTrim
const std::string getExiv2ValueString(Exiv2::ExifData& exifData,Exiv2::ExifData::const_iterator it)
{
if(it!=exifData.end() && it->count())
{
return hugin_utils::StrTrim(it->toString());
};
return std::string("");
};
示例2: readTags
QVariantMap QgsExifTools::readTags( const QString &imagePath )
{
std::unique_ptr< Exiv2::Image > image( Exiv2::ImageFactory::open( imagePath.toStdString() ) );
if ( !image )
return QVariantMap();
image->readMetadata();
Exiv2::ExifData &exifData = image->exifData();
if ( exifData.empty() )
{
return QVariantMap();
}
QVariantMap res;
Exiv2::ExifData::const_iterator end = exifData.end();
for ( Exiv2::ExifData::const_iterator i = exifData.begin(); i != end; ++i )
{
const QString key = QString::fromStdString( i->key() );
QVariant val;
switch ( i->typeId() )
{
case Exiv2::asciiString:
case Exiv2::string:
case Exiv2::comment:
case Exiv2::directory:
case Exiv2::xmpText:
val = QString::fromStdString( i->toString() );
break;
case Exiv2::unsignedLong:
case Exiv2::signedLong:
val = QVariant::fromValue( i->toLong() );
break;
case Exiv2::tiffDouble:
case Exiv2::tiffFloat:
val = QVariant::fromValue( i->toFloat() );
break;
case Exiv2::unsignedShort:
case Exiv2::signedShort:
val = QVariant::fromValue( static_cast< int >( i->toLong() ) );
break;
case Exiv2::unsignedRational:
case Exiv2::signedRational:
case Exiv2::unsignedByte:
case Exiv2::signedByte:
case Exiv2::undefined:
case Exiv2::tiffIfd:
case Exiv2::date:
case Exiv2::time:
case Exiv2::xmpAlt:
case Exiv2::xmpBag:
case Exiv2::xmpSeq:
case Exiv2::langAlt:
case Exiv2::invalidTypeId:
case Exiv2::lastTypeId:
val = QString::fromStdString( i->toString() );
break;
}
res.insert( key, val );
}
return res;
}