C# 클래스 TagLib.IFD.IFDReader

This class contains all the IFD reading and parsing code.
파일 보기 프로젝트 열기: MediaPortal/MPTagThat 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
base_offset long
file System.IO.File
ifd_offset uint
is_bigendian bool
max_offset uint
parse_makernote bool
structure IFDStructure

Private Properties

프로퍼티 타입 설명
CreateIFDEntry IFDEntry
DetectIFDLoop bool
FixupDirectory void
ParseMakernote IFDEntry
ReadAsciiString string
ReadIFD uint
ReadInt int
ReadIntArray int[]
ReadRational TagLib.IFD.Entries.Rational
ReadSRational TagLib.IFD.Entries.SRational
ReadShort short
ReadShortArray short[]
ReadUInt uint
ReadUIntArray uint[]
ReadUShort ushort
ReadUShortArray ushort[]
StartIFDLoopDetect void
StopIFDLoopDetect void

공개 메소드들

메소드 설명
IFDReader ( File file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset ) : System

Constructor. Reads an IFD from given file, using the given endianness.

Read ( ) : void

Read all IFD segments from the file.

Read ( int count ) : void

Read IFD segments from the file.

보호된 메소드들

메소드 설명
CreateSubIFDReader ( File file, bool is_bigendian, IFDStructure structure, long base_offset, uint offset, uint max_offset ) : IFDReader

Create a reader for Sub IFD entries.

ParseIFDEntry ( ushort tag, ushort type, uint count, long base_offset, uint offset ) : IFDEntry

Try to parse the given IFD entry, used to discover format-specific entries.

비공개 메소드들

메소드 설명
CreateIFDEntry ( ushort tag, ushort type, uint count, long base_offset, ByteVector offset_data, uint max_offset ) : IFDEntry

Creates an IFDEntry from the given values. This method is used for every entry. Custom parsing can be hooked in by overriding the ParseIFDEntry(ushort,ushort,uint,long,uint) method.

DetectIFDLoop ( long offset ) : bool

Attempts to detect whether or not this file has an endless IFD loop.

FixupDirectory ( long base_offset, IFDDirectory directory ) : void

Performs some fixups to a read IFDDirectory. For some special cases multiple IFDEntry instances contained in the directory are needed. Therfore, we do the fixups after reading the whole directory to be sure, all entries are present.

ParseMakernote ( ushort tag, ushort type, uint count, long base_offset, uint offset ) : IFDEntry
ReadAsciiString ( int count ) : string

Reads an ASCII string from the current file.

The exif standard allows to store multiple string separated by '\0' in one ASCII-field. On the other hand some programs (e.g. CanonZoomBrowser) fill some ASCII fields by trailing '\0's. We follow the Adobe practice as described in XMP Specification Part 3 (Storeage in Files), and process the ASCII string only to the first '\0'.

ReadIFD ( long base_offset, uint offset, uint max_offset ) : uint

Reads an IFD from file at position offset relative to base_offset.

ReadInt ( ) : int

Reads a 4-byte int from the current file.

ReadIntArray ( uint count ) : int[]

Reads an array of 4-byte int from the current file.

ReadRational ( ) : Rational

Reads a Rational by two following unsigned int from the current file.

ReadSRational ( ) : TagLib.IFD.Entries.SRational

Reads a SRational by two following unsigned int from the current file.

ReadShort ( ) : short

Reads a 2-byte signed short from the current file.

ReadShortArray ( uint count ) : short[]

Reads an array of 2-byte signed shorts from the current file.

ReadUInt ( ) : uint

Reads a 4-byte unsigned int from the current file.

ReadUIntArray ( uint count ) : uint[]

Reads an array of 4-byte unsigned int from the current file.

ReadUShort ( ) : ushort

Reads a 2-byte unsigned short from the current file.

ReadUShortArray ( uint count ) : ushort[]

Reads an array of 2-byte shorts from the current file.

StartIFDLoopDetect ( ) : void

Add to the reference count for the IFD loop detection.

StopIFDLoopDetect ( ) : void

End the IFD loop detection, cleanup if we're the last.

메소드 상세

CreateSubIFDReader() 보호된 메소드

Create a reader for Sub IFD entries.
protected CreateSubIFDReader ( File file, bool is_bigendian, IFDStructure structure, long base_offset, uint offset, uint max_offset ) : IFDReader
file System.IO.File /// A to read from. ///
is_bigendian bool /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. ///
structure IFDStructure /// A that will be populated. ///
base_offset long /// A with the base offset which every offsets in the /// IFD are relative to. ///
offset uint /// A with the offset of the entry. ///
max_offset uint /// A with the maximal offset to consider for /// the IFD. ///
리턴 IFDReader

IFDReader() 공개 메소드

Constructor. Reads an IFD from given file, using the given endianness.
public IFDReader ( File file, bool is_bigendian, IFDStructure structure, long base_offset, uint ifd_offset, uint max_offset ) : System
file System.IO.File /// A to read from. ///
is_bigendian bool /// A , it must be true, if the data of the IFD should be /// read as bigendian, otherwise false. ///
structure IFDStructure /// A that will be populated. ///
base_offset long /// A value describing the base were the IFD offsets /// refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets /// inside the IFD refer from the beginning of this segment. So must contain the beginning of the segment. ///
ifd_offset uint /// A value with the beginning of the IFD relative to /// . ///
max_offset uint /// A value with maximal possible offset. This is to limit /// the size of the possible data; ///
리턴 System

ParseIFDEntry() 보호된 메소드

Try to parse the given IFD entry, used to discover format-specific entries.
protected ParseIFDEntry ( ushort tag, ushort type, uint count, long base_offset, uint offset ) : IFDEntry
tag ushort /// A with the tag of the entry. ///
type ushort /// A with the type of the entry. ///
count uint /// A with the data count of the entry. ///
base_offset long /// A with the base offset which every offsets in the /// IFD are relative to. ///
offset uint /// A with the offset of the entry. ///
리턴 IFDEntry

Read() 공개 메소드

Read all IFD segments from the file.
public Read ( ) : void
리턴 void

Read() 공개 메소드

Read IFD segments from the file.
public Read ( int count ) : void
count int /// A with the maximal number of IFDs to read. /// Passing -1 means unlimited. ///
리턴 void

프로퍼티 상세

base_offset 보호되어 있는 프로퍼티

A System.Int64 value describing the base were the IFD offsets refer to. E.g. in Jpegs the IFD are located in an Segment and the offsets inside the IFD refer from the beginning of this segment. So base_offset must contain the beginning of the segment.
protected long base_offset
리턴 long

file 보호되어 있는 프로퍼티

The File where this IFD is found in.
protected File,System.IO file
리턴 System.IO.File

ifd_offset 보호되어 있는 프로퍼티

A System.UInt32 value with the beginning of the IFD relative to base_offset.
protected uint ifd_offset
리턴 uint

is_bigendian 보호되어 있는 프로퍼티

If IFD is encoded in BigEndian or not
protected bool is_bigendian
리턴 bool

max_offset 보호되어 있는 프로퍼티

A System.UInt32 with the maximal offset, which should occur in the IFD. Greater offsets, would reference beyond the considered data.
protected uint max_offset
리턴 uint

parse_makernote 보호되어 있는 프로퍼티

Whether or not the makernote should be parsed.
protected bool parse_makernote
리턴 bool

structure 보호되어 있는 프로퍼티

The IFD structure that will be populated
protected IFDStructure,TagLib.IFD structure
리턴 IFDStructure