载入中...
搜索中...
未找到
BakedAssetFile.cpp
浏览该文件的文档.
31// The directory is exclusively created before opening its child. Cleanup never touches the destination.
49Result<void> syncPublicationDescriptor(int descriptor, std::string_view path, std::string_view publication) {
55 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, "animation durability barrier failed",
70 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "asset filename is empty"));
72 const auto parent = target.parent_path().empty() ? std::filesystem::path(".") : target.parent_path();
76 Diagnostic::error(DiagnosticCode::Failed, "cannot open asset publication directory", std::string(path)));
78 PublicationDescriptor data{::openat(directory.value, ".", O_TMPFILE | O_WRONLY | O_CLOEXEC, 0666)};
81 const auto code = error == EOPNOTSUPP || error == EINVAL || error == EISDIR ? DiagnosticCode::Unsupported
83 return Result<void>::failure(Diagnostic::error(code, "anonymous asset staging unavailable", std::string(path),
101 if (::linkat(AT_FDCWD, source.c_str(), directory.value, target.filename().c_str(), AT_SYMLINK_FOLLOW) < 0) {
137 Diagnostic::error(DiagnosticCode::Failed, "animation temporary write failed", std::string(path)));
143 "animation publication failed (requires same-filesystem hard links and a new path)", std::string(path)));
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
std::string bakedAssetContentKey(std::string_view source)
Stable noncryptographic 128-bit content digest, encoded as 32 lowercase hexadecimal bytes....
Definition BakedAssetFile.cpp:14
Result< void > publishBakedAsset(std::string_view path, std::string_view bytes)
Publish complete baked asset bytes atomically without replacing an existing path. @ownership Borrows ...
Definition BakedAssetFile.cpp:64
@ InvalidArgument
@ Unsupported
@ Failed
@ Conflict