Loading...
Searching...
No Matches
datasets.hpp
Go to the documentation of this file.
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef DATASETS_HPP_
#define DATASETS_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "metadatum.hpp"
// + standard includes
#include <set>
#include <vector>
#include <map>
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class definitions
struct EXIV2API RecordInfo {
RecordInfo(uint16_t recordId, const char* name, const char* desc);
uint16_t recordId_;
const char* name_;
const char* desc_;
};
struct EXIV2API DataSet {
DataSet(
uint16_t number,
const char* name,
const char* title,
const char* desc,
bool mandatory,
bool repeatable,
uint32_t minbytes,
uint32_t maxbytes,
TypeId type,
uint16_t recordId,
const char* photoshop
);
uint16_t number_;
const char* name_;
const char* title_;
const char* desc_;
bool mandatory_;
bool repeatable_;
uint32_t minbytes_;
uint32_t maxbytes_;
TypeId type_;
uint16_t recordId_;
const char* photoshop_;
}; // struct DataSet
class EXIV2API IptcDataSets {
public:
static const uint16_t invalidRecord = 0;
static const uint16_t envelope = 1;
static const uint16_t application2 = 2;
static const uint16_t ModelVersion = 0;
static const uint16_t Destination = 5;
static const uint16_t FileFormat = 20;
static const uint16_t FileVersion = 22;
static const uint16_t ServiceId = 30;
static const uint16_t EnvelopeNumber = 40;
static const uint16_t ProductId = 50;
static const uint16_t EnvelopePriority = 60;
static const uint16_t DateSent = 70;
static const uint16_t TimeSent = 80;
static const uint16_t CharacterSet = 90;
static const uint16_t UNO = 100;
static const uint16_t ARMId = 120;
static const uint16_t ARMVersion = 122;
static const uint16_t RecordVersion = 0;
static const uint16_t ObjectType = 3;
static const uint16_t ObjectAttribute = 4;
static const uint16_t ObjectName = 5;
static const uint16_t EditStatus = 7;
static const uint16_t EditorialUpdate = 8;
static const uint16_t Urgency = 10;
static const uint16_t Subject = 12;
static const uint16_t Category = 15;
static const uint16_t SuppCategory = 20;
static const uint16_t FixtureId = 22;
static const uint16_t Keywords = 25;
static const uint16_t LocationCode = 26;
static const uint16_t LocationName = 27;
static const uint16_t ReleaseDate = 30;
static const uint16_t ReleaseTime = 35;
static const uint16_t ExpirationDate = 37;
static const uint16_t ExpirationTime = 38;
static const uint16_t SpecialInstructions = 40;
static const uint16_t ActionAdvised = 42;
static const uint16_t ReferenceService = 45;
static const uint16_t ReferenceDate = 47;
static const uint16_t ReferenceNumber = 50;
static const uint16_t DateCreated = 55;
static const uint16_t TimeCreated = 60;
static const uint16_t DigitizationDate = 62;
static const uint16_t DigitizationTime = 63;
static const uint16_t Program = 65;
static const uint16_t ProgramVersion = 70;
static const uint16_t ObjectCycle = 75;
static const uint16_t Byline = 80;
static const uint16_t BylineTitle = 85;
static const uint16_t City = 90;
static const uint16_t SubLocation = 92;
static const uint16_t ProvinceState = 95;
static const uint16_t CountryCode = 100;
static const uint16_t CountryName = 101;
static const uint16_t TransmissionReference = 103;
static const uint16_t Headline = 105;
static const uint16_t Credit = 110;
static const uint16_t Source = 115;
static const uint16_t Copyright = 116;
static const uint16_t Contact = 118;
static const uint16_t Caption = 120;
static const uint16_t Writer = 122;
static const uint16_t RasterizedCaption = 125;
static const uint16_t ImageType = 130;
static const uint16_t ImageOrientation = 131;
static const uint16_t Language = 135;
static const uint16_t AudioType = 150;
static const uint16_t AudioRate = 151;
static const uint16_t AudioResolution = 152;
static const uint16_t AudioDuration = 153;
static const uint16_t AudioOutcue = 154;
static const uint16_t PreviewFormat = 200;
static const uint16_t PreviewVersion = 201;
static const uint16_t Preview = 202;
private:
IptcDataSets() {}
IptcDataSets(const IptcDataSets& rhs);
IptcDataSets& operator=(const IptcDataSets& rhs);
public:
static std::string dataSetName(uint16_t number, uint16_t recordId);
static const char* dataSetTitle(uint16_t number, uint16_t recordId);
static const char* dataSetDesc(uint16_t number, uint16_t recordId);
static const char* dataSetPsName(uint16_t number, uint16_t recordId);
static bool dataSetRepeatable(uint16_t number, uint16_t recordId);
static uint16_t dataSet(const std::string& dataSetName, uint16_t recordId);
static TypeId dataSetType(uint16_t number, uint16_t recordId);
static std::string recordName(uint16_t recordId);
static const char* recordDesc(uint16_t recordId);
static uint16_t recordId(const std::string& recordName);
static const DataSet* envelopeRecordList();
static const DataSet* application2RecordList();
static void dataSetList(std::ostream& os);
private:
static int dataSetIdx(uint16_t number, uint16_t recordId);
static int dataSetIdx(const std::string& dataSetName, uint16_t recordId);
static const DataSet* records_[];
static const RecordInfo recordInfo_[];
}; // class IptcDataSets
class EXIV2API IptcKey : public Key {
public:
typedef std::auto_ptr<IptcKey> AutoPtr;
explicit IptcKey(const std::string& key);
IptcKey(uint16_t tag, uint16_t record);
IptcKey(const IptcKey& rhs);
virtual ~IptcKey();
IptcKey& operator=(const IptcKey& rhs);
virtual std::string key() const;
virtual const char* familyName() const;
virtual std::string groupName() const;
virtual std::string tagName() const;
virtual std::string tagLabel() const;
virtual uint16_t tag() const;
AutoPtr clone() const;
std::string recordName() const;
uint16_t record() const;
protected:
void makeKey();
void decomposeKey();
private:
virtual IptcKey* clone_() const;
// DATA
static const char* familyName_;
uint16_t tag_;
uint16_t record_;
std::string key_;
}; // class IptcKey
typedef std::map<std::string,std::string> Dictionary;
typedef Dictionary* Dictionary_p;
typedef Dictionary::const_iterator Dictionary_i;
typedef std::set<std::string> StringSet;
typedef StringSet* StringSet_p;
typedef std::set<std::string>::const_iterator StringSet_i;
typedef std::vector<std::string> StringVector;
typedef StringVector* StringVector_p;
typedef StringVector::const_iterator StringVector_i;
typedef std::vector<uint32_t> Uint32Vector ;
typedef Uint32Vector* Uint32Vector_p;
typedef Uint32Vector::const_iterator Uint32Vector_i;
// *****************************************************************************
// free functions
EXIV2API std::ostream& operator<<(std::ostream& os, const DataSet& dataSet);
} // namespace Exiv2
#endif // #ifndef DATASETS_HPP_
Exiv2::IptcDataSets
IPTC dataset reference, implemented as a static class.
Definition datasets.hpp:86
Exiv2::IptcKey
Concrete keys for IPTC metadata.
Definition datasets.hpp:275
Exiv2::IptcKey::AutoPtr
std::auto_ptr< IptcKey > AutoPtr
Shortcut for an IptcKey auto pointer.
Definition datasets.hpp:278
Exiv2::Key
Abstract base class defining the Key of a metadatum. Keys are used to identify and group metadata.
Definition metadatum.hpp:44
Exiv2::Internal::groupName
const char * groupName(IfdId ifdId)
Return the group name for a group id.
Definition tags_int.cpp:2569
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
Exiv2::operator<<
EXIV2API std::ostream & operator<<(std::ostream &os, const DataSet &dataSet)
Output operator for dataSet.
Definition datasets.cpp:709
Exiv2::Dictionary_i
Dictionary::const_iterator Dictionary_i
typedef for Dictionary iterator
Definition datasets.hpp:372
Exiv2::Uint32Vector
std::vector< uint32_t > Uint32Vector
typedef for uint32_t vector
Definition datasets.hpp:403
Exiv2::Uint32Vector_i
Uint32Vector::const_iterator Uint32Vector_i
typedef for Uint32Vector iterator
Definition datasets.hpp:411
Exiv2::StringSet
std::set< std::string > StringSet
typedef for string set (unique strings)
Definition datasets.hpp:377
Exiv2::StringVector_p
StringVector * StringVector_p
typedef for StringVector pointer
Definition datasets.hpp:394
Exiv2::Uint32Vector_p
Uint32Vector * Uint32Vector_p
typedef for Uint32Vector pointer
Definition datasets.hpp:407
Exiv2::TypeId
TypeId
Exiv2 value type identifiers.
Definition types.hpp:119
Exiv2::Dictionary_p
Dictionary * Dictionary_p
typedef for Dictionary*
Definition datasets.hpp:368
Exiv2::StringSet_i
std::set< std::string >::const_iterator StringSet_i
Class to provide a StringSet iterator.
Definition datasets.hpp:385
Exiv2::StringSet_p
StringSet * StringSet_p
typedef for StringSet*
Definition datasets.hpp:381
Exiv2::StringVector_i
StringVector::const_iterator StringVector_i
Class to provide a StringVector iterator.
Definition datasets.hpp:398
Exiv2::StringVector
std::vector< std::string > StringVector
typedef for string vector
Definition datasets.hpp:390
Exiv2::Dictionary
std::map< std::string, std::string > Dictionary
typedef for string:string map
Definition datasets.hpp:364
Exiv2::DataSet
Details of an IPTC dataset.
Definition datasets.hpp:57
Exiv2::DataSet::mandatory_
bool mandatory_
True if dataset is mandatory.
Definition datasets.hpp:76
Exiv2::DataSet::minbytes_
uint32_t minbytes_
Minimum number of bytes.
Definition datasets.hpp:78
Exiv2::DataSet::photoshop_
const char * photoshop_
Photoshop string.
Definition datasets.hpp:82
Exiv2::DataSet::maxbytes_
uint32_t maxbytes_
Maximum number of bytes.
Definition datasets.hpp:79
Exiv2::DataSet::recordId_
uint16_t recordId_
Record id.
Definition datasets.hpp:81
Exiv2::DataSet::name_
const char * name_
Dataset name.
Definition datasets.hpp:73
Exiv2::DataSet::repeatable_
bool repeatable_
True if dataset is repeatable.
Definition datasets.hpp:77
Exiv2::DataSet::title_
const char * title_
Dataset title or label.
Definition datasets.hpp:74
Exiv2::DataSet::type_
TypeId type_
Exiv2 default type.
Definition datasets.hpp:80
Exiv2::DataSet::number_
uint16_t number_
Dataset number.
Definition datasets.hpp:72
Exiv2::DataSet::desc_
const char * desc_
Dataset description.
Definition datasets.hpp:75
Exiv2::RecordInfo
Details of an IPTC record.
Definition datasets.hpp:48
Exiv2::RecordInfo::name_
const char * name_
Record name (one word)
Definition datasets.hpp:52
Exiv2::RecordInfo::recordId_
uint16_t recordId_
Record id.
Definition datasets.hpp:51
Exiv2::RecordInfo::desc_
const char * desc_
Record description.
Definition datasets.hpp:53