Added toString template
This commit is contained in:
parent
cd45eb0e5c
commit
5ea9faf79e
11
src/tags.hpp
11
src/tags.hpp
@ -21,7 +21,7 @@
|
||||
/*!
|
||||
@file tags.hpp
|
||||
@brief %Exif tag and type information
|
||||
@version $Name: $ $Revision: 1.7 $
|
||||
@version $Name: $ $Revision: 1.8 $
|
||||
@author Andreas Huggel (ahu)
|
||||
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
|
||||
@date 15-Jan-04, ahu: created
|
||||
@ -250,6 +250,15 @@ namespace Exif {
|
||||
// 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)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << arg;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
} // namespace Exif
|
||||
|
||||
#endif // #ifndef TAGS_HPP_
|
||||
|
||||
Loading…
Reference in New Issue
Block a user