Unravel Engine C++ Reference
Loading...
Searching...
No Matches
asset_manifest.h
Go to the documentation of this file.
1#pragma once
2
4
6
7#include <chrono>
8
9#include <string>
10
11#include <vector>
12
13#include "asset_extensions.h"
14
15
16
17namespace unravel
18{
19
20namespace asset_compiler
21{
22
25{
26
28 std::string source_fingerprint;
29
31 uint64_t format_version = 0;
32
34 uint64_t fingerprint_version = 0;
35
36 asset_manifest() = default;
37
38 asset_manifest(const fs::path& key)
39 {
40 format_version = ex::get_format_version(key.extension().string());
41
43 }
44
46 void compute_source_fingerprint(const fs::path& source_key);
47
50 void compute_source_fingerprint(const fs::path& source_key, const std::vector<fs::path>& dependency_paths);
51
52};
53
54
55
57auto get_manifest_path(const fs::path& compiled_asset_path) -> fs::path;
58
60auto save_manifest(const fs::path& manifest_path, const asset_manifest& manifest) -> bool;
61
63auto load_manifest(const fs::path& manifest_path, asset_manifest& manifest) -> bool;
64
66auto is_source_file_changed(const fs::path& source_path, const asset_manifest& manifest) -> bool;
67
69auto is_source_file_changed(const fs::path& source_path,
70 const asset_manifest& manifest,
71 const std::vector<fs::path>& dependency_paths) -> bool;
72
73auto is_compiled_format_changed(const fs::path& source_path, const asset_manifest& manifest) -> bool;
74
75auto is_fingerprint_algorithm_current(const asset_manifest& manifest) -> bool;
76
77} // namespace asset_compiler
78
79} // namespace unravel
80
auto get_format_version() -> uint64_t
constexpr uint64_t current_source_fingerprint_version
xxHash3 128-bit fingerprints (hex). Bump when the hashing or dependency-ordering scheme changes.
auto get_manifest_path(const fs::path &compiled_asset_path) -> fs::path
Generate manifest file path from compiled asset path.
auto is_compiled_format_changed(const fs::path &source_path, const asset_manifest &manifest) -> bool
auto is_fingerprint_algorithm_current(const asset_manifest &manifest) -> bool
auto save_manifest(const fs::path &manifest_path, const asset_manifest &manifest) -> bool
Save manifest to file.
auto is_source_file_changed(const fs::path &source_path, const asset_manifest &manifest) -> bool
Check if source file has changed compared to manifest (source-only)
auto load_manifest(const fs::path &manifest_path, asset_manifest &manifest) -> bool
Load manifest from file.
Manifest data for compiled assets.
uint64_t format_version
Version of the compiled format.
std::string source_fingerprint
Content fingerprint of source inputs (xxHash3 128-bit hex).
void compute_source_fingerprint(const fs::path &source_key)
Compute fingerprint from source file only.
uint64_t fingerprint_version
Fingerprint algorithm version. Legacy manifests use 0 (SHA1).