Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::FileRecogniser Class Reference

Object used to work out a file's type. More...

#include <TSE3MDL.h>

List of all members.

Public Types

enum  {
  Type_Error, Type_Unknown, Type_TSE3MDL, Type_TSE2MDL,
  Type_Midi
}

Public Member Functions

 FileRecogniser (const std::string &filename)
int type () const
size_t size () const
Songload (Progress *progress)


Detailed Description

Object used to work out a file's type.

The FileRegoniser class will return information about a given file.

It can recognise three file types - the three types that TSE3 provides support for. These are:

Author:
Pete Goodliffe
Version:
1.00


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
Type_Error 
Type_Unknown 
Type_TSE3MDL 
Type_TSE2MDL 
Type_Midi 


Constructor & Destructor Documentation

TSE3::FileRecogniser::FileRecogniser const std::string &  filename  ) 
 

Creates a FileRecogniser for a particular file.

Parameters:
filename The name of the file to query


Member Function Documentation

int TSE3::FileRecogniser::type  )  const [inline]
 

Returns the type of the file. The value will be one of the below:

  • Type_Unknown - No recognised music file type
  • Type_TSE3MDL - A TSE3MDL file
  • Type_TSE2MDL - A TSEMDL file (from TSE2)
  • Type_Midi - A standard MIDI file
Returns:
The type of the specified file

size_t TSE3::FileRecogniser::size  )  const [inline]
 

Returns the size of the file.

Returns:
The size of the file in bytes.

Song* TSE3::FileRecogniser::load Progress progress  ) 
 

Loads the file in the appropriate way.

This will use either the TSE3MDL, or TSE2MDL classes to create a Song from the data in the file.

If the file is of an unknown type, this will return zero.

Any exception that may be thrown by the three file loading classes may pass from this method.

The loaded Song will have been created with new, it is now your responsibility to delete it.

Parameters:
progress A callback progress interface, or zero for none
Returns:
A newly loaded Song, or zero for faliure


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:47:10 2005 for TSE3 by doxygen 1.3.2