Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add constexpr constructor #2207

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions src/tags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ using namespace Internal;

//! List of all defined Exif sections.
constexpr auto sectionInfo = std::array{
SectionInfo{sectionIdNotSet, "(UnknownSection)", N_("Unknown section")},
SectionInfo{imgStruct, "ImageStructure", N_("Image data structure")},
SectionInfo{recOffset, "RecordingOffset", N_("Recording offset")},
SectionInfo{imgCharacter, "ImageCharacteristics", N_("Image data characteristics")},
SectionInfo{otherTags, "OtherTags", N_("Other data")},
SectionInfo{exifFormat, "ExifFormat", N_("Exif data structure")},
SectionInfo{exifVersion, "ExifVersion", N_("Exif version")},
SectionInfo{imgConfig, "ImageConfig", N_("Image configuration")},
SectionInfo{userInfo, "UserInfo", N_("User information")},
SectionInfo{relatedFile, "RelatedFile", N_("Related file")},
SectionInfo{dateTime, "DateTime", N_("Date and time")},
SectionInfo{captureCond, "CaptureConditions", N_("Picture taking conditions")},
SectionInfo{gpsTags, "GPS", N_("GPS information")},
SectionInfo{iopTags, "Interoperability", N_("Interoperability information")},
SectionInfo{mpfTags, "MPF", N_("CIPA Multi-Picture Format")},
SectionInfo{makerTags, "Makernote", N_("Vendor specific information")},
SectionInfo{dngTags, "DngTags", N_("Adobe DNG tags")},
SectionInfo{panaRaw, "PanasonicRaw", N_("Panasonic RAW tags")},
SectionInfo{tiffEp, "TIFF/EP", N_("TIFF/EP tags")},
SectionInfo{tiffPm6, "TIFF&PM6", N_("TIFF PageMaker 6.0 tags")},
SectionInfo{adobeOpi, "AdobeOPI", N_("Adobe OPI tags")},
SectionInfo{lastSectionId, "(LastSection)", N_("Last section")},
SectionInfo(sectionIdNotSet, "(UnknownSection)", N_("Unknown section")),
SectionInfo(imgStruct, "ImageStructure", N_("Image data structure")),
SectionInfo(recOffset, "RecordingOffset", N_("Recording offset")),
SectionInfo(imgCharacter, "ImageCharacteristics", N_("Image data characteristics")),
SectionInfo(otherTags, "OtherTags", N_("Other data")),
SectionInfo(exifFormat, "ExifFormat", N_("Exif data structure")),
SectionInfo(exifVersion, "ExifVersion", N_("Exif version")),
SectionInfo(imgConfig, "ImageConfig", N_("Image configuration")),
SectionInfo(userInfo, "UserInfo", N_("User information")),
SectionInfo(relatedFile, "RelatedFile", N_("Related file")),
SectionInfo(dateTime, "DateTime", N_("Date and time")),
SectionInfo(captureCond, "CaptureConditions", N_("Picture taking conditions")),
SectionInfo(gpsTags, "GPS", N_("GPS information")),
SectionInfo(iopTags, "Interoperability", N_("Interoperability information")),
SectionInfo(mpfTags, "MPF", N_("CIPA Multi-Picture Format")),
SectionInfo(makerTags, "Makernote", N_("Vendor specific information")),
SectionInfo(dngTags, "DngTags", N_("Adobe DNG tags")),
SectionInfo(panaRaw, "PanasonicRaw", N_("Panasonic RAW tags")),
SectionInfo(tiffEp, "TIFF/EP", N_("TIFF/EP tags")),
SectionInfo(tiffPm6, "TIFF&PM6", N_("TIFF PageMaker 6.0 tags")),
SectionInfo(adobeOpi, "AdobeOPI", N_("Adobe OPI tags")),
SectionInfo(lastSectionId, "(LastSection)", N_("Last section")),
};

} // namespace Exiv2
Expand Down
3 changes: 3 additions & 0 deletions src/tags_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ enum SectionId {

//! The details of a section.
struct SectionInfo {
constexpr SectionInfo(SectionId sectionId, const char* name, const char* desc) :
sectionId_(sectionId), name_(name), desc_(desc) {
}
SectionId sectionId_; //!< Section id
const char* name_; //!< Section name (one word)
const char* desc_; //!< Section description
Expand Down