Unravel Engine C++ Reference
Loading...
Searching...
No Matches
asset_manifest.h
Go to the documentation of this file.
1#pragma once
3#include <hpp/sha1.hpp>
4#include <chrono>
5#include <string>
6
7namespace unravel
8{
9namespace asset_compiler
10{
11
14{
18 fs::file_time_type::clock::time_point source_timestamp;
19
21 std::string source_sha;
22
23
24 asset_manifest() = default;
25
26 asset_manifest(const fs::path& source_path)
27 : source_file_path(source_path)
28 {
29 fs::error_code ec;
30 source_timestamp = fs::last_write_time(source_path, ec);
31 }
32
33 void compute_source_sha();
34};
35
37auto get_manifest_path(const fs::path& compiled_asset_path) -> fs::path;
38
40auto save_manifest(const fs::path& manifest_path, const asset_manifest& manifest) -> bool;
41
43auto load_manifest(const fs::path& manifest_path, asset_manifest& manifest) -> bool;
44
46auto is_source_file_changed(const fs::path& source_path, const asset_manifest& manifest) -> bool;
47
48} // namespace asset_compiler
49} // namespace unravel
auto get_manifest_path(const fs::path &compiled_asset_path) -> fs::path
Generate manifest file path from compiled asset path.
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.
auto load_manifest(const fs::path &manifest_path, asset_manifest &manifest) -> bool
Load manifest from file.
Manifest data for compiled assets.
fs::path source_file_path
Path to the source file.
asset_manifest(const fs::path &source_path)
fs::file_time_type::clock::time_point source_timestamp
Timestamp when the asset was compiled.
std::string source_sha
SHA1 hash of the source file content.