@ -32,6 +32,7 @@
# include "tiffvisitor_int.hpp"
# include "tiffvisitor_int.hpp"
# include "tiffimage.hpp"
# include "tiffimage.hpp"
# include "tiffimage_int.hpp"
# include "tiffimage_int.hpp"
# include "utils.hpp"
// + standard includes
// + standard includes
# include <string>
# include <string>
@ -1080,14 +1081,6 @@ namespace Exiv2 {
# define NA ((uint32_t)-1)
# define NA ((uint32_t)-1)
// TODO: When moving to C++20, this can be replace with
// std::basic_string<CharT,Traits,Allocator>::starts_with() .
// Suggested in https://github.com/Exiv2/exiv2/pull/1777 .
bool startsWith ( const std : : string & s , const std : : string & start )
{
return s . size ( ) > = start . size ( ) & & std : : memcmp ( s . data ( ) , start . data ( ) , start . size ( ) ) = = 0 ;
}
//! Nikon binary array version lookup table
//! Nikon binary array version lookup table
constexpr NikonArrayIdx nikonArrayIdx [ ] = {
constexpr NikonArrayIdx nikonArrayIdx [ ] = {
// NikonSi
// NikonSi
@ -1203,7 +1196,7 @@ namespace Exiv2 {
// Not valid for models beginning
// Not valid for models beginning
std : : string model = getExifModel ( pRoot ) ;
std : : string model = getExifModel ( pRoot ) ;
for ( auto & m : { " SLT- " , " HV " , " ILCA- " } ) {
for ( auto & m : { " SLT- " , " HV " , " ILCA- " } ) {
if ( startsWith( model , m ) )
if ( Util: : startsWith( model , m ) )
return - 1 ;
return - 1 ;
}
}
return 0 ;
return 0 ;