Skip to content

Commit 6203ded

Browse files
nehebpiponazo
authored andcommitted
add constexpr constructor
Signed-off-by: Rosen Penev <[email protected]>
1 parent 6c99577 commit 6203ded

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

src/tags.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ using namespace Internal;
2020

2121
//! List of all defined Exif sections.
2222
constexpr auto sectionInfo = std::array{
23-
SectionInfo{sectionIdNotSet, "(UnknownSection)", N_("Unknown section")},
24-
SectionInfo{imgStruct, "ImageStructure", N_("Image data structure")},
25-
SectionInfo{recOffset, "RecordingOffset", N_("Recording offset")},
26-
SectionInfo{imgCharacter, "ImageCharacteristics", N_("Image data characteristics")},
27-
SectionInfo{otherTags, "OtherTags", N_("Other data")},
28-
SectionInfo{exifFormat, "ExifFormat", N_("Exif data structure")},
29-
SectionInfo{exifVersion, "ExifVersion", N_("Exif version")},
30-
SectionInfo{imgConfig, "ImageConfig", N_("Image configuration")},
31-
SectionInfo{userInfo, "UserInfo", N_("User information")},
32-
SectionInfo{relatedFile, "RelatedFile", N_("Related file")},
33-
SectionInfo{dateTime, "DateTime", N_("Date and time")},
34-
SectionInfo{captureCond, "CaptureConditions", N_("Picture taking conditions")},
35-
SectionInfo{gpsTags, "GPS", N_("GPS information")},
36-
SectionInfo{iopTags, "Interoperability", N_("Interoperability information")},
37-
SectionInfo{mpfTags, "MPF", N_("CIPA Multi-Picture Format")},
38-
SectionInfo{makerTags, "Makernote", N_("Vendor specific information")},
39-
SectionInfo{dngTags, "DngTags", N_("Adobe DNG tags")},
40-
SectionInfo{panaRaw, "PanasonicRaw", N_("Panasonic RAW tags")},
41-
SectionInfo{tiffEp, "TIFF/EP", N_("TIFF/EP tags")},
42-
SectionInfo{tiffPm6, "TIFF&PM6", N_("TIFF PageMaker 6.0 tags")},
43-
SectionInfo{adobeOpi, "AdobeOPI", N_("Adobe OPI tags")},
44-
SectionInfo{lastSectionId, "(LastSection)", N_("Last section")},
23+
SectionInfo(sectionIdNotSet, "(UnknownSection)", N_("Unknown section")),
24+
SectionInfo(imgStruct, "ImageStructure", N_("Image data structure")),
25+
SectionInfo(recOffset, "RecordingOffset", N_("Recording offset")),
26+
SectionInfo(imgCharacter, "ImageCharacteristics", N_("Image data characteristics")),
27+
SectionInfo(otherTags, "OtherTags", N_("Other data")),
28+
SectionInfo(exifFormat, "ExifFormat", N_("Exif data structure")),
29+
SectionInfo(exifVersion, "ExifVersion", N_("Exif version")),
30+
SectionInfo(imgConfig, "ImageConfig", N_("Image configuration")),
31+
SectionInfo(userInfo, "UserInfo", N_("User information")),
32+
SectionInfo(relatedFile, "RelatedFile", N_("Related file")),
33+
SectionInfo(dateTime, "DateTime", N_("Date and time")),
34+
SectionInfo(captureCond, "CaptureConditions", N_("Picture taking conditions")),
35+
SectionInfo(gpsTags, "GPS", N_("GPS information")),
36+
SectionInfo(iopTags, "Interoperability", N_("Interoperability information")),
37+
SectionInfo(mpfTags, "MPF", N_("CIPA Multi-Picture Format")),
38+
SectionInfo(makerTags, "Makernote", N_("Vendor specific information")),
39+
SectionInfo(dngTags, "DngTags", N_("Adobe DNG tags")),
40+
SectionInfo(panaRaw, "PanasonicRaw", N_("Panasonic RAW tags")),
41+
SectionInfo(tiffEp, "TIFF/EP", N_("TIFF/EP tags")),
42+
SectionInfo(tiffPm6, "TIFF&PM6", N_("TIFF PageMaker 6.0 tags")),
43+
SectionInfo(adobeOpi, "AdobeOPI", N_("Adobe OPI tags")),
44+
SectionInfo(lastSectionId, "(LastSection)", N_("Last section")),
4545
};
4646

4747
} // namespace Exiv2

src/tags_int.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ enum SectionId {
190190

191191
//! The details of a section.
192192
struct SectionInfo {
193+
constexpr SectionInfo(SectionId sectionId, const char* name, const char* desc) :
194+
sectionId_(sectionId), name_(name), desc_(desc) {
195+
}
193196
SectionId sectionId_; //!< Section id
194197
const char* name_; //!< Section name (one word)
195198
const char* desc_; //!< Section description

0 commit comments

Comments
 (0)