2525#include < optional>
2626#include < string>
2727#include < string_view>
28- #include < utility>
2928
3029#include " iceberg/iceberg_export.h"
3130#include " iceberg/partition_spec.h"
@@ -72,17 +71,17 @@ struct ICEBERG_EXPORT PartitionFieldSummary {
7271 static const StructType& Type ();
7372};
7473
74+ // / \brief The type of files tracked by the manifest, either data or delete files; 0 for
75+ // / all v1 manifests
76+ enum class ManifestContent {
77+ // / The manifest content is data.
78+ kData = 0 ,
79+ // / The manifest content is deletes.
80+ kDeletes = 1 ,
81+ };
82+
7583// / \brief Entry in a manifest list.
7684struct ICEBERG_EXPORT ManifestFile {
77- // / \brief The type of files tracked by the manifest, either data or delete files; 0 for
78- // / all v1 manifests
79- enum class Content {
80- // / The manifest content is data.
81- kData = 0 ,
82- // / The manifest content is deletes.
83- kDeletes = 1 ,
84- };
85-
8685 // / Field id: 500
8786 // / Location of the manifest file
8887 std::string manifest_path;
@@ -96,7 +95,7 @@ struct ICEBERG_EXPORT ManifestFile {
9695 // / Field id: 517
9796 // / The type of files tracked by the manifest, either data or delete files; 0 for all v1
9897 // / manifests
99- Content content = Content ::kData ;
98+ ManifestContent content = ManifestContent ::kData ;
10099 // / Field id: 515
101100 // / The sequence number when the manifest was added to the table; use 0 when reading v1
102101 // / manifest lists
@@ -218,21 +217,20 @@ struct ICEBERG_EXPORT ManifestList {
218217};
219218
220219// / \brief Get the relative manifest content type name
221- ICEBERG_EXPORT constexpr std::string_view ToString (ManifestFile::Content type) noexcept {
220+ ICEBERG_EXPORT constexpr std::string_view ToString (ManifestContent type) noexcept {
222221 switch (type) {
223- case ManifestFile::Content ::kData :
222+ case ManifestContent ::kData :
224223 return " data" ;
225- case ManifestFile::Content ::kDeletes :
224+ case ManifestContent ::kDeletes :
226225 return " deletes" ;
227226 }
228- std::unreachable ();
229227}
230228
231229// / \brief Get the relative manifest content type from name
232- ICEBERG_EXPORT constexpr Result<ManifestFile::Content> ManifestFileContentFromString (
230+ ICEBERG_EXPORT constexpr Result<ManifestContent> ManifestContentFromString (
233231 std::string_view str) noexcept {
234- if (str == " data" ) return ManifestFile::Content ::kData ;
235- if (str == " deletes" ) return ManifestFile::Content ::kDeletes ;
232+ if (str == " data" ) return ManifestContent ::kData ;
233+ if (str == " deletes" ) return ManifestContent ::kDeletes ;
236234 return InvalidArgument (" Invalid manifest content type: {}" , str);
237235}
238236
0 commit comments