28 #include "metavalue.hpp" 29 #include "rafmetacontainer.hpp" 30 #include "io/stream.hpp" 35 RafMetaValue::RafMetaValue(uint16_t tag, uint16_t size,
const MetaValue & v)
42 RafMetaValue::~RafMetaValue()
46 RafMetaContainer::RafMetaContainer(
const IO::Stream::Ptr &_file)
47 : RawContainer(_file, 0)
50 setEndian(ENDIAN_BIG);
53 uint32_t RafMetaContainer::count()
61 RafMetaValue::Ref RafMetaContainer::getValue(uint16_t tag)
66 std::map<uint16_t, RafMetaValue::Ref>::const_iterator iter = m_tags.find(tag);
67 if(iter != m_tags.end()) {
70 return RafMetaValue::Ref();
73 void RafMetaContainer::_read()
75 readUInt32(m_file, m_count);
76 for(uint32_t i = 0; i < m_count; i++) {
79 readUInt16(m_file, tag);
80 readUInt16(m_file, size);
84 if(readUInt32(m_file, intVal)) {
85 v = MetaValue::value_t(intVal);
90 content = (
char*)calloc(1, size + 1);
92 m_file->read(content, size);
93 v = MetaValue::value_t(std::string(content));
97 RafMetaValue::Ref value(
new RafMetaValue(tag, size, MetaValue(v)));
98 m_tags.insert(std::make_pair(tag, value));
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.