85 CodecList::iterator i = msMapCodecs.find(pCodec->
getType());
86 if (i != msMapCodecs.end())
88 pCodec->
getType() +
" already has a registered codec. ", __FUNCTION__);
90 msMapCodecs[pCodec->
getType()] = pCodec;
97 return msMapCodecs.find(codecType) != msMapCodecs.end();
104 msMapCodecs.erase(pCodec->
getType());
110 return CodecIterator(msMapCodecs.begin(), msMapCodecs.end());
125 static Codec* getCodec(
char *magicNumberPtr,
size_t maxbytes);
149 virtual String getType()
const = 0;
153 virtual String getDataType()
const = 0;
162 {
return !magicNumberToFileExt(magicNumberPtr, maxbytes).empty(); }
170 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.
static CodecList msMapCodecs
A map that contains all the registered codecs.
virtual String dataType() const
Returns the type of the data.
SharedPtr< CodecData > CodecDataPtr
virtual bool magicNumberMatch(const char *magicNumberPtr, size_t maxbytes) const
Returns whether a magic number header matches this codec.
map< String, Codec * >::type CodecList
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
vector< String >::type StringVector
ConstMapIterator< CodecList > CodecIterator
#define OGRE_EXCEPT(code, desc, src)
static void registerCodec(Codec *pCodec)
Registers a new codec in the database.
std::map< K, V, P, A > type
static void unregisterCodec(Codec *pCodec)
Unregisters a codec from the database.
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.