Skip to content

Commit

Permalink
Merge pull request #2078 from Exiv2/main_recoverDatasetLists
Browse files Browse the repository at this point in the history
Revert "Delete dead code"
  • Loading branch information
piponazo authored Feb 8, 2022
2 parents 275bcb9 + 1f07715 commit 4ae42b1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/exiv2/datasets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,21 @@ namespace Exiv2 {
*/
static const char* recordDesc(uint16_t recordId);

/*!
@brief Return the Id number of a record
@param recordName Name of a record type
@return the Id number of a Record
@throw Error if the record is not known;
*/
static uint16_t recordId(const std::string& recordName);

//! Return read-only list of built-in Envelope Record datasets
static const DataSet* envelopeRecordList();

//! Return read-only list of built-in Application2 Record datasets
static const DataSet* application2RecordList();

//! Print a list of all dataSets to output stream
static void dataSetList(std::ostream& os);

private:
Expand Down
10 changes: 10 additions & 0 deletions src/datasets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,16 @@ namespace Exiv2 {
0xffffffff, Exiv2::string, IptcDataSets::invalidRecord, N_("Unknown dataset"),
};

const DataSet* IptcDataSets::envelopeRecordList()
{
return envelopeRecord;
}

const DataSet* IptcDataSets::application2RecordList()
{
return application2Record;
}

// Dataset lookup lists.This is an array with pointers to one list per IIM4 Record.
// The record id is used as the index into the array.
constexpr const DataSet* IptcDataSets::records_[] = {
Expand Down

0 comments on commit 4ae42b1

Please sign in to comment.