Implement the body of Value::display_as().

This commit is contained in:
KAMADA Ken'ichi 2017-06-17 21:57:38 +09:00
parent 7c61ddf3f9
commit 5a540228c3
2 changed files with 863 additions and 151 deletions

1002
src/tag.rs

File diff suppressed because it is too large Load Diff

View File

@ -72,6 +72,18 @@ impl<'a> Value<'a> {
/// Returns an object that implements `std::fmt::Display` for
/// printing a value in a tag-specific format.
/// The tag of the value is specified as the argument.
///
/// # Examples
///
/// ```
/// use exif::{Value, tag};
/// let val = Value::Undefined(b"0231");
/// assert_eq!(format!("{}", val.display_as(tag::ExifVersion)),
/// "2.31");
/// let val = Value::Short(vec![2]);
/// assert_eq!(format!("{}", val.display_as(tag::ResolutionUnit)),
/// "pixels per inch");
/// ```
#[inline]
pub fn display_as(&self, tag: ::tag_priv::Tag) -> Display {
::tag_priv::display_value_as(self, tag)