42[[nodiscard]]
inline std::string makeUtcTimestamp()
44 const auto now = std::chrono::system_clock::now();
45 const std::time_t nowTime = std::chrono::system_clock::to_time_t(now);
48 gmtime_s(&utcTime, &nowTime);
50 gmtime_r(&nowTime, &utcTime);
53 std::ostringstream out;
54 out << std::put_time(&utcTime,
"%Y-%m-%dT%H:%M:%SZ");
72 set_version(MNXDOM_VERSION);
73 constexpr std::string_view commit = MNXDOM_GIT_COMMIT;
74 if constexpr (!commit.empty()) {
75 set_commit(std::string(commit));
77 constexpr std::string_view build = MNXDOM_BUILD_ID;
78 if constexpr (!build.empty()) {
79 set_build(std::string(build));
135 set_createdAt(detail::makeUtcTimestamp());
Base class wrapper for all MNX JSON nodes.
Definition BaseTypes.h:212
T parent() const
Returns the parent object for this node.
Definition BaseTypes.h:260
Identifies the client application that requested the export.
Definition MnxdomProvenance.h:93
MNX_OPTIONAL_PROPERTY(std::string, commit)
Optional source control revision for the client.
MNX_OPTIONAL_PROPERTY(std::string, build)
Optional build number or build identifier.
MNX_OPTIONAL_PROPERTY(std::string, version)
The application version.
MNX_REQUIRED_PROPERTY(std::string, name)
The application name.
Provenance data stored under _x.mnxdom.
Definition MnxdomProvenance.h:125
MNX_OPTIONAL_PROPERTY(std::string, documentId)
Optional stable document identifier, such as a UUID URN.
MNX_REQUIRED_CHILD(MnxdomGeneratorInfo, mnxdom)
The component that wrote the JSON.
MNX_REQUIRED_PROPERTY(int, provenanceSchemaVersion)
Schema version for the _x.mnxdom payload.
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:432
MNX_REQUIRED_PROPERTY(std::string, mnxSchema)
Full MNX schema identifier used by the document.
MNX_OPTIONAL_CHILD(MnxdomSourceInfo, source)
The imported or converted source.
MNX_OPTIONAL_CHILD(MnxdomClientInfo, client)
The client application that requested the export.
MNX_REQUIRED_PROPERTY(std::string, createdAt)
UTC timestamp when the payload was created.
MNX_OPTIONAL_PROPERTY(std::string, modifiedAt)
Optional UTC timestamp of the most recent write.
Identifies the software component that wrote the MNX JSON payload.
Definition MnxdomProvenance.h:65
MNX_OPTIONAL_PROPERTY(std::string, build)
Optional build number or build identifier.
MNX_REQUIRED_PROPERTY(std::string, version)
The version of the writing component.
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:432
MNX_OPTIONAL_PROPERTY(std::string, commit)
Optional source control revision for the writer.
Describes the source material that was converted or imported.
Definition MnxdomProvenance.h:108
MNX_OPTIONAL_PROPERTY(std::string, version)
Optional source format version.
MNX_OPTIONAL_PROPERTY(std::string, filename)
Optional original source URI or path.
MNX_REQUIRED_PROPERTY(std::string, format)
The source format, such as musicxml, midi, or manual.
Represents an MNX object, encapsulating property access.
Definition BaseTypes.h:429
Object()
Constructor fresh document or detached instance.
Definition BaseTypes.h:432
object model for MNX format
constexpr int MNXDOM_PROVENANCE_SCHEMA_VERSION
Version of the provenance payload schema used under _x.mnxdom.
Definition MnxdomProvenance.h:37
const std::string & getMnxSchemaId()
Returns the MNX schema id from the embedded schema.
Definition SchemaValidate.cpp:76
constexpr std::string_view MNXDOM_PROVENANCE_KEY
Key used for the mnxdom provenance payload inside _x.
Definition MnxdomProvenance.h:35