Moved getType() template from types to value
This commit is contained in:
parent
354a47cc06
commit
5b9541bc93
@ -21,7 +21,7 @@
|
||||
/*!
|
||||
@file types.hpp
|
||||
@brief Type definitions for Exiv2 and related functionality
|
||||
@version $Name: $ $Revision: 1.2 $
|
||||
@version $Name: $ $Revision: 1.3 $
|
||||
@author Andreas Huggel (ahu)
|
||||
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
|
||||
@date 09-Jan-04, ahu: created
|
||||
@ -167,25 +167,6 @@ namespace Exif {
|
||||
// *****************************************************************************
|
||||
// template and inline definitions
|
||||
|
||||
//! Template to determine the TypeId for a type T
|
||||
template<typename T> TypeId getType();
|
||||
|
||||
//! Specialization for an unsigned short
|
||||
template<> inline TypeId getType<uint16>() { return unsignedShort; }
|
||||
//! Specialization for an unsigned long
|
||||
template<> inline TypeId getType<uint32>() { return unsignedLong; }
|
||||
//! Specialization for an unsigned rational
|
||||
template<> inline TypeId getType<URational>() { return unsignedRational; }
|
||||
//! Specialization for a signed short
|
||||
template<> inline TypeId getType<int16>() { return signedShort; }
|
||||
//! Specialization for a signed long
|
||||
template<> inline TypeId getType<int32>() { return signedLong; }
|
||||
//! Specialization for a signed rational
|
||||
template<> inline TypeId getType<Rational>() { return signedRational; }
|
||||
|
||||
// No default implementation: let the compiler/linker complain
|
||||
// template<typename T> inline TypeId getType() { return invalid; }
|
||||
|
||||
//! Utility function to convert the argument of any type to a string
|
||||
template<typename T>
|
||||
std::string toString(T arg)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/*!
|
||||
@file value.hpp
|
||||
@brief Value interface and concrete subclasses
|
||||
@version $Name: $ $Revision: 1.2 $
|
||||
@version $Name: $ $Revision: 1.3 $
|
||||
@author Andreas Huggel (ahu)
|
||||
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
|
||||
@date 09-Jan-04, ahu: created
|
||||
@ -257,6 +257,25 @@ namespace Exif {
|
||||
|
||||
}; // class AsciiValue
|
||||
|
||||
//! Template to determine the TypeId for a type T
|
||||
template<typename T> TypeId getType();
|
||||
|
||||
//! Specialization for an unsigned short
|
||||
template<> inline TypeId getType<uint16>() { return unsignedShort; }
|
||||
//! Specialization for an unsigned long
|
||||
template<> inline TypeId getType<uint32>() { return unsignedLong; }
|
||||
//! Specialization for an unsigned rational
|
||||
template<> inline TypeId getType<URational>() { return unsignedRational; }
|
||||
//! Specialization for a signed short
|
||||
template<> inline TypeId getType<int16>() { return signedShort; }
|
||||
//! Specialization for a signed long
|
||||
template<> inline TypeId getType<int32>() { return signedLong; }
|
||||
//! Specialization for a signed rational
|
||||
template<> inline TypeId getType<Rational>() { return signedRational; }
|
||||
|
||||
// No default implementation: let the compiler/linker complain
|
||||
// template<typename T> inline TypeId getType() { return invalid; }
|
||||
|
||||
/*!
|
||||
@brief Template for a %Value of a basic type. This is used for unsigned
|
||||
and signed short, long and rationals.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user