mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-23 19:31:44 +00:00
ID result: use constexpr instead of #defines
This commit is contained in:
parent
2e142d2d8a
commit
f0243659d2
@ -17,14 +17,14 @@
|
||||
|
||||
#include "common/id_info.h"
|
||||
|
||||
#define ID_RESULT_TRACK_AUDIO "audio"
|
||||
#define ID_RESULT_TRACK_VIDEO "video"
|
||||
#define ID_RESULT_TRACK_SUBTITLES "subtitles"
|
||||
#define ID_RESULT_TRACK_BUTTONS "buttons"
|
||||
#define ID_RESULT_TRACK_UNKNOWN "unknown"
|
||||
#define ID_RESULT_CHAPTERS "chapters"
|
||||
#define ID_RESULT_TAGS "tags"
|
||||
#define ID_RESULT_GLOBAL_TAGS_ID -1
|
||||
constexpr auto ID_RESULT_TRACK_AUDIO = "audio";
|
||||
constexpr auto ID_RESULT_TRACK_VIDEO = "video";
|
||||
constexpr auto ID_RESULT_TRACK_SUBTITLES = "subtitles";
|
||||
constexpr auto ID_RESULT_TRACK_BUTTONS = "buttons";
|
||||
constexpr auto ID_RESULT_TRACK_UNKNOWN = "unknown";
|
||||
constexpr auto ID_RESULT_CHAPTERS = "chapters";
|
||||
constexpr auto ID_RESULT_TAGS = "tags";
|
||||
constexpr auto ID_RESULT_GLOBAL_TAGS_ID = -1;
|
||||
|
||||
// When bumping the schema version:
|
||||
// • increase `ID_JSON_FORMAT_VERSION` here
|
||||
@ -33,7 +33,7 @@
|
||||
// 1. `id`
|
||||
// 2. `properties` → `identification_format_version` → `minimum` and `maximum`
|
||||
// • adjust the link in `doc/man/mkvmerge.xml`
|
||||
#define ID_JSON_FORMAT_VERSION 14
|
||||
constexpr auto ID_JSON_FORMAT_VERSION = 14;
|
||||
|
||||
struct id_result_t {
|
||||
int64_t id;
|
||||
|
@ -342,7 +342,7 @@ class SimpleTest
|
||||
json_store = JsonSchema::DocumentStore.new
|
||||
parser = JsonSchema::Parser.new
|
||||
expander = JsonSchema::ReferenceExpander.new
|
||||
version = IO.readlines("../src/merge/id_result.h").detect { |line| /#define +ID_JSON_FORMAT_VERSION\b/.match line }.gsub(/.* .* /, '').chop
|
||||
version = IO.readlines("../src/merge/id_result.h").detect { |line| /^constexpr.*\bID_JSON_FORMAT_VERSION\b/.match line }.gsub(/.*= *|;/, '').chop
|
||||
schema = parser.parse JSON.load(File.read("../doc/json-schema/mkvmerge-identification-output-schema-v#{version}.json"))
|
||||
|
||||
expander.expand(schema, store: json_store)
|
||||
|
Loading…
Reference in New Issue
Block a user