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

Public Member Functions | Protected Member Functions

TagLib::CorruptFileException Class Reference

This class extends Exception and is used to indicate that a file or tag is corrupt. More...

List of all members.

Public Member Functions

 CorruptFileException (string message)
 Constructs and initializes a new instance of CorruptFileException with a specified message.
 CorruptFileException (string message, Exception innerException)
 Constructs and initializes a new instance of CorruptFileException with a specified message containing a specified exception.
 CorruptFileException ()
 Constructs and initializes a new instance of CorruptFileException with the default values.

Protected Member Functions

 CorruptFileException (SerializationInfo info, StreamingContext context)
 Constructs and initializes a new instance of CorruptFileException from a specified serialization info and streaming context.

Detailed Description

This class extends Exception and is used to indicate that a file or tag is corrupt.

This exception will be thrown if invalid data interferes with the reading of the file or tag. One common example is in the (legal) downloading of media files with BitTorrent, in which case large portions of the file will contain zeroed bytes.

Catching an exception when creating a File.

          using System;
          using TagLib;

          public class ExceptionTest
          {
            public static void Main ()
            {
                  try {
                        File file = File.Create ("partial.mp3"); // Partial download.
                  } catch (CorruptFileException e) {
                        Console.WriteLine ("That file is corrupt: {0}", e.ToString ());
                  }
            }
          }
          #using <System.dll>
          #using <taglib-sharp.dll>

          using System;
          using TagLib;

          void main ()
          {
            try {
                  File file = File::Create ("partial.mp3"); // Partial download.
            } catch (CorruptFileException^ e) {
                  Console::WriteLine ("That file is corrupt: {0}", e);
            }
          }
          Imports System
          Imports TagLib

          Public Class ExceptionTest
            Public Shared Sub Main ()
                  Try
                        file As File = File.Create ("partial.mp3") ' Partial download.
                  Catch e As CorruptFileException
                        Console.WriteLine ("That file is corrupt: {0}", e.ToString ());
                  End Try
            End Sub
          End Class
          import System
          import TagLib

          try:
            file As File = File.Create ("partial.mp3") # Partial download.
          catch e as CorruptFileException:
            Console.WriteLine ("That file is corrupt: {0}", e.ToString ());

Definition at line 101 of file CorruptFileException.cs.


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index