]> 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 bb35b0b43528ca4eba14dc66682f43ae26bca651..d3737400803b700a8dd325cf5283e9adb660422d 100644 (file)
@@ -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