Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

ushort TagLib::ByteVector::ToUShort ( bool  mostSignificantByteFirst ) [inline, inherited]

Converts an first two bytes of the current instance to a ushort value.

Parameters:
mostSignificantByteFirstif the most significant byte appears first (big endian format), or if the least significant byte appears first (little endian format).
Returns:
A ushort value containing the value read from the current instance.

Definition at line 1201 of file ByteVector.cs.

References TagLib::ByteVector::Count.

Referenced by TagLib::Mpeg4::AppleElementaryStreamDescriptor::AppleElementaryStreamDescriptor(), TagLib::Riff::AviStreamHeader::AviStreamHeader(), TagLib::Riff::BitmapInfoHeader::BitmapInfoHeader(), TagLib::IFD::IFDReader::CreateIFDEntry(), TagLib::IFD::IFDReader::FixupDirectory(), TagLib::Id3v2::FrameHeader::FrameHeader(), TagLib::Mpeg4::IsoMovieHeaderBox::IsoMovieHeaderBox(), TagLib::Id3v2::RelativeVolumeFrame::ParseFields(), TagLib::Jpeg::File::ReadAPP1Segment(), TagLib::Mpeg::File::ReadAudioPacket(), TagLib::Jpeg::File::ReadDQTSegment(), TagLib::Tiff::BaseTiffFile::ReadHeader(), TagLib::Gif::File::ReadHeader(), TagLib::IFD::IFDReader::ReadIFD(), TagLib::Jpeg::File::ReadSegmentSize(), TagLib::Jpeg::File::ReadSOFSegment(), TagLib::Mpeg::File::ReadSystemFile(), TagLib::Mpeg::File::ReadVideoPacket(), TagLib::Asf::File::ReadWord(), TagLib::WavPack::StreamHeader::StreamHeader(), TagLib::Ape::StreamHeader::StreamHeader(), TagLib::Aiff::StreamHeader::StreamHeader(), TagLib::Jpeg::File::ValidateHeader(), TagLib::Mpeg::VideoHeader::VideoHeader(), and TagLib::Riff::WaveFormatEx::WaveFormatEx().

            {
                  ushort sum = 0;
                  int last = Count > 2 ? 1 : Count - 1;
                  for (int i = 0; i <= last; i++) {
                        int offset = mostSignificantByteFirst ? last-i : i;
                        sum |= (ushort)(this[i] << (offset * 8));
                  }
                  
                  return sum;
            }

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index