-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcontext_items.hpp
More file actions
40 lines (32 loc) · 962 Bytes
/
Copy pathcontext_items.hpp
File metadata and controls
40 lines (32 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace acecode::desktop {
enum class ContextItemKind {
File,
Folder,
};
struct ContextItem {
ContextItemKind kind = ContextItemKind::File;
std::string path;
std::string name;
std::string mime_type;
std::uintmax_t size_bytes = 0;
bool reference_only = false;
std::string bytes;
};
struct ContextItemsResult {
std::vector<ContextItem> items;
std::string error;
explicit operator bool() const noexcept {
return error.empty();
}
};
// Canonicalize and classify native filesystem paths. Ordinary files are
// represented by source-path metadata only; raster images retain their bytes
// for the existing snapshot/vision flow. Folders are represented only by their
// absolute path and are never traversed.
ContextItemsResult materialize_context_items(
const std::vector<std::string>& paths);
} // namespace acecode::desktop