Logo Search packages:      
Sourcecode: taglib-sharp version File versions

override void TagLib::Id3v2::CommentsFrame::ParseFields ( ByteVector  data,
byte  version 
) [inline, protected]

Populates the values in the current instance by parsing its field data in a specified version.

Parameters:
data A ByteVector object containing the extracted field data.
version A byte indicating the ID3v2 version the field data is encoded in.

Definition at line 452 of file CommentsFrame.cs.

            {
                  if (data.Count < 4)
                        throw new CorruptFileException (
                              "Not enough bytes in field.");
                  
                  encoding = (StringType) data [0];
                  language = data.Mid (1, 3).ToString (StringType.Latin1);
                  
                  // Instead of splitting into two string, in the format
                  // [{desc}\0{value}], try splitting into three strings
                  // in case of a misformatted [{desc}\0{value}\0].
                  string [] split = data.ToStrings (encoding, 4, 3);
                  
                  if (split.Length == 1) {
                        // Bad comment frame. Assume that it lacks a
                        // description.
                        description = String.Empty;
                        text        = split [0];
                  } else {
                        description = split [0];
                        text        = split [1];
                  }
            }


Generated by  Doxygen 1.6.0   Back to index