Go to the documentation of this file.
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());
162 {
return !magicNumberToFileExt(magicNumberPtr, maxbytes).empty(); }
virtual String getDataType() const =0
Returns the type of the data that supported by this codec as a String.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void encodeToFile(MemoryDataStreamPtr &input, const String &outFileName, CodecDataPtr &pData) const =0
Codes the data in the input chunk and saves the result in the output filename provided.
static Codec * getCodec(const String &extension)
Gets the codec registered for the passed in file extension.
static void registerCodec(Codec *pCodec)
Registers a new codec in the database.
vector< String >::type StringVector
map< String, Codec * >::type CodecList
virtual DataStreamPtr encode(MemoryDataStreamPtr &input, CodecDataPtr &pData) const =0
Codes the data in the input stream and saves the result in the output stream.
static void unregisterCodec(Codec *pCodec)
Unregisters a codec from the database.
virtual String dataType() const
Returns the type of the data.
static Codec * getCodec(char *magicNumberPtr, size_t maxbytes)
Gets the codec that can handle the given 'magic' identifier.
static bool isCodecRegistered(const String &codecType)
Return whether a codec is registered already.
SharedPtr< CodecData > CodecDataPtr
virtual String magicNumberToFileExt(const char *magicNumberPtr, size_t maxbytes) const =0
Maps a magic number header to a file extension, if this codec recognises it.
Reference-counted shared pointer, used for objects where implicit destruction is required.
std::map< K, V, P, A > type
virtual bool magicNumberMatch(const char *magicNumberPtr, size_t maxbytes) const
Returns whether a magic number header matches this codec.
static StringVector getExtensions(void)
Gets the file extension list for the registered codecs.
virtual String getType() const =0
Returns the type of the codec as a String.
virtual DecodeResult decode(DataStreamPtr &input) const =0
Codes the data from the input chunk into the output chunk.
Abstract class that defines a 'codec'.
static CodecList msMapCodecs
A map that contains all the registered codecs.
std::pair< MemoryDataStreamPtr, CodecDataPtr > DecodeResult
Result of a decoding; both a decoded data stream and CodecData metadata.
Concrete IteratorWrapper for const access to the underlying key-value container.
#define OGRE_EXCEPT(num, desc, src)
static CodecIterator getCodecIterator(void)
Gets the iterator for the registered codecs.
ConstMapIterator< CodecList > CodecIterator
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.