84 CodecList::iterator i = ms_mapCodecs.find(pCodec->
getType());
85 if (i != ms_mapCodecs.end())
87 pCodec->
getType() +
" already has a registered codec. ", __FUNCTION__);
89 ms_mapCodecs[pCodec->
getType()] = pCodec;
96 return ms_mapCodecs.find(codecType) != ms_mapCodecs.end();
103 ms_mapCodecs.erase(pCodec->
getType());
109 return CodecIterator(ms_mapCodecs.begin(), ms_mapCodecs.end());
124 static Codec* getCodec(
char *magicNumberPtr,
size_t maxbytes);
150 virtual String getType()
const = 0;
154 virtual String getDataType()
const = 0;
163 {
return !magicNumberToFileExt(magicNumberPtr, maxbytes).empty(); }
171 virtual String magicNumberToFileExt(
const char *magicNumberPtr,
size_t maxbytes)
const = 0;
Abstract class that defines a 'codec'.
static CodecIterator getCodecIterator(void)
Gets the iterator for the registered codecs.
virtual String dataType() const
Returns the type of the data.
static CodecList ms_mapCodecs
A map that contains all the registered codecs.
SharedPtr< CodecData > CodecDataPtr
virtual bool magicNumberMatch(const char *magicNumberPtr, size_t maxbytes) const
Returns whether a magic number header matches this codec.
static void unRegisterCodec(Codec *pCodec)
Unregisters a codec from the database.
map< String, Codec * >::type CodecList
#define OGRE_EXCEPT(num, desc, src)
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
vector< String >::type StringVector
ConstMapIterator< CodecList > CodecIterator
static void registerCodec(Codec *pCodec)
Registers a new codec in the database.
std::map< K, V, P, A > type
std::pair< MemoryDataStreamPtr, CodecDataPtr > DecodeResult
Result of a decoding; both a decoded data stream and CodecData metadata.
static bool isCodecRegistered(const String &codecType)
Return whether a codec is registered already.
Concrete IteratorWrapper for const access to the underlying key-value container.
Reference-counted shared pointer, used for objects where implicit destruction is required.
virtual String getType() const =0
Returns the type of the codec as a String.