Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Codec.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Audio::Codec
3 //
4 #ifndef __AUDIO_CODEC_H__INCLUDED__
5 #define __AUDIO_CODEC_H__INCLUDED__
6 
7 #include <string>
8 #include <vector>
9 #include "../Exceptions.h"
10 
11 #include "vsfilesystem.h"
12 
13 namespace Audio {
14 
15  // Forward Stream so that Codec headers don't depend on them.
16  // Implementations will surely depend on them, though...
17  // ...but this way Codec users may be oblivious to them.
18  class Stream;
19 
27  class Codec
28  {
29  private:
30  std::string name;
31 
32  protected:
34  Codec(const std::string& name) throw();
35 
36  public:
38  typedef std::vector<std::string> Extensions;
39 
40  public:
41  virtual ~Codec();
42 
44  const std::string& getName() const throw();
45 
61  virtual const Extensions* getExtensions() const throw();
62 
83  virtual bool canHandle(const std::string& path, bool canOpen, VSFileSystem::VSFileType type = VSFileSystem::UnknownFile) throw() = 0;
84 
95  virtual Stream* open(const std::string& path, VSFileSystem::VSFileType type = VSFileSystem::UnknownFile) throw(Exception) = 0;
96  };
97 
98 };
99 
100 #endif//__AUDIO_CODEC_H__INCLUDED__