]> git.tdb.fi Git - libs/core.git/blobdiff - source/codec.h
Make codecs able to tell their name
[libs/core.git] / source / codec.h
index 3470ccc68e6c65ad4890f499a54b41c88fa91256..d3737400803b700a8dd325cf5283e9adb660422d 100644 (file)
@@ -9,7 +9,7 @@ Distributed under the LGPL
 #define MSP_STRINGS_CODEC_H_
 
 #include <string>
-#include <msp/core/error.h>
+#include <msp/core/except.h>
 
 namespace Msp {
 namespace Codecs {
@@ -160,6 +160,11 @@ public:
 
        virtual ~Codec() { }
 
+       /**
+       Returns the name of the encoding handled by this codec.
+       */
+       virtual const char *get_name() const =0;
+
        /**
        Creates an encoder for this codec.
        */
@@ -231,6 +236,12 @@ deleting the codec when it's no longer needed.
 */
 Codec *create_codec(const std::string &);
 
+/**
+Automatically detects the encoding of a string and creates a codec for it.
+The codec must be deleted when it's no longer needed.
+*/
+Codec *detect_codec(const std::string &);
+
 } // namespace Codecs
 } // namespace Msp