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

string [] TagLib::Riff::List::GetValuesAsStrings ( ByteVector  id  )  [inline]

Gets the values for a specified item in the current instance as a string[].

Parameters:
id A ByteVector object containing the ID of the item to set.
Returns:
A string[] containing the values of the specified item.
Exceptions:
ArgumentNullException id is .
ArgumentException id isn't exactly four bytes long.

Definition at line 257 of file List.cs.

            {
                  if (id == null)
                        throw new ArgumentNullException ("id");
                  
                  if (id.Count != 4)
                        throw new ArgumentException (
                              "ID must be 4 bytes long.", "id");
                  
                  ByteVectorCollection values = GetValues (id);
                  
                  string [] result = new string [values.Count];
                  
                  for (int i = 0; i < result.Length; i ++) {
                        ByteVector data = values [i];
                        
                        if (data == null) {
                              result [i] = string.Empty;
                              continue;
                        }
                        
                        int length = data.Count;
                        while (length > 0 && data [length - 1] == 0)
                              length --;
                        
                        result [i] = data
                              .ToString (StringType.UTF8, 0, length);
                  }
                  
                  return result;
            }


Generated by  Doxygen 1.6.0   Back to index