-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathjson.h
64 lines (48 loc) · 1.69 KB
/
json.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef CLI_JSON
#define CLI_JSON
#include <reflective_rapidjson/json/serializable.h>
#include <tagparser/tagtarget.h>
#include <c++utilities/chrono/timespan.h>
#include <unordered_map>
namespace TagParser {
class MediaFileInfo;
class Tag;
class TagValue;
}
namespace Cli {
namespace Json {
struct TagValue : ReflectiveRapidJSON::JsonSerializable<TagValue> {
TagValue(const TagParser::TagValue &tagValue, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator);
const char *kind = "undefined";
const std::string mimeType;
struct ValueAllowedToMove : RAPIDJSON_NAMESPACE::Value {
} value;
};
struct TargetInfo : ReflectiveRapidJSON::JsonSerializable<TargetInfo> {
using IdContainerType = TagParser::TagTarget::IdContainerType;
TargetInfo(const TagParser::TagTarget &tagTarget, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator);
std::uint64_t level;
std::string levelName;
IdContainerType tracks;
IdContainerType chapters;
IdContainerType editions;
IdContainerType attachments;
};
struct TagInfo : ReflectiveRapidJSON::JsonSerializable<TagInfo> {
TagInfo(const TagParser::Tag &tag, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator);
std::string_view format;
TargetInfo target;
std::unordered_map<std::string, std::vector<TagValue>> fields;
};
struct FileInfo : ReflectiveRapidJSON::JsonSerializable<FileInfo> {
FileInfo(const TagParser::MediaFileInfo &mediaFileInfo, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator);
std::string fileName;
std::size_t size;
std::string_view mimeType;
std::vector<TagInfo> tags;
std::string formatSummary;
CppUtilities::TimeSpan duration;
};
}
}
#endif // CLI_JSON