12namespace pixelbullet::filesystem
16 std::string logical_path;
17 std::filesystem::path physical_path;
19 std::optional<std::filesystem::file_time_type> last_write_time;
24 std::string logical_path;
25 std::filesystem::path physical_path;
28enum class NativeFileSnapshotBatchMode
36enum class NativeSnapshotBackend
44class NativeSnapshotProbeCache
47 NativeSnapshotProbeCache();
48 ~NativeSnapshotProbeCache();
49 NativeSnapshotProbeCache(NativeSnapshotProbeCache&&)
noexcept;
50 NativeSnapshotProbeCache& operator=(NativeSnapshotProbeCache&&)
noexcept;
51 NativeSnapshotProbeCache(
const NativeSnapshotProbeCache&) =
delete;
52 NativeSnapshotProbeCache& operator=(
const NativeSnapshotProbeCache&) =
delete;
54 void Clear()
noexcept;
58 std::unique_ptr<Impl> impl_;
60 friend struct NativeSnapshotProbeCacheAccess;
65 bool collect_trusted_watched_directories =
true;
71 std::vector<NativeFileSnapshot> snapshots;
72 std::vector<std::filesystem::path> watched_directories;
73 bool watched_directories_trusted =
false;
74 NativeFileSnapshotBatchMode mode = NativeFileSnapshotBatchMode::None;
75 NativeSnapshotBackend backend = NativeSnapshotBackend::None;
76 std::size_t request_count = 0u;
77 std::size_t directory_group_count = 0u;
78 std::size_t fallback_count = 0u;
79 std::size_t probe_cache_hit_count = 0u;
80 std::size_t probe_cache_miss_count = 0u;
81 std::size_t probe_cache_reused_entry_count = 0u;
82 float directory_enumeration_milliseconds = 0.0f;
83 float fallback_milliseconds = 0.0f;
84 float trusted_directory_milliseconds = 0.0f;
85 float snapshot_assembly_milliseconds = 0.0f;
90 std::string logical_path;
91 std::filesystem::path physical_path;
93 bool is_directory =
false;
94 std::optional<std::int64_t> last_write_time_ticks;
100 std::string logical_path;
101 std::filesystem::path physical_path;
104enum class NativeDirectorySnapshotBatchMode
114 std::vector<NativeDirectorySnapshot> snapshots;
115 NativeDirectorySnapshotBatchMode mode = NativeDirectorySnapshotBatchMode::None;
116 NativeSnapshotBackend backend = NativeSnapshotBackend::None;
117 std::size_t request_count = 0u;
118 std::size_t parent_directory_group_count = 0u;
119 std::size_t fallback_count = 0u;
120 std::size_t probe_cache_hit_count = 0u;
121 std::size_t probe_cache_miss_count = 0u;
122 std::size_t probe_cache_reused_entry_count = 0u;
123 float parent_directory_enumeration_milliseconds = 0.0f;
124 float fallback_milliseconds = 0.0f;
125 float snapshot_assembly_milliseconds = 0.0f;
130 std::string logical_path;
131 std::filesystem::path physical_path;
132 std::string directory_name_key;
137 std::filesystem::path parent_directory;
138 std::vector<std::size_t> entry_indices;
143 std::vector<NativeDirectorySnapshotPlanEntry> entries;
144 std::vector<NativeDirectorySnapshotPlanGroup> groups;
147[[nodiscard]] std::int64_t FileTimeToTicks(std::filesystem::file_time_type time)
noexcept;
148[[nodiscard]] std::filesystem::file_time_type FileTimeFromTicks(std::int64_t ticks)
noexcept;
149[[nodiscard]] std::string_view ToString(NativeSnapshotBackend backend)
noexcept;
150[[nodiscard]]
bool CaptureDirectoryWriteTimeTicks(
const std::filesystem::path& directory, std::int64_t& ticks, std::string& detail);
151[[nodiscard]]
NativeDirectorySnapshot CaptureDirectoryWriteTimeSnapshot(std::string logical_path,
const std::filesystem::path& directory);
153CaptureDirectoryWriteTimeSnapshotsBatched(
const std::vector<NativeDirectorySnapshotBatchRequest>& requests,
157[[nodiscard]] std::optional<std::filesystem::path> FindNearestExistingDirectory(
const std::filesystem::path& physical_path);
158[[nodiscard]]
NativeFileSnapshot CaptureResolvedFileSnapshot(std::string logical_path,
const std::filesystem::path& resolved_path);
161[[nodiscard]]
bool NativeFileSnapshotsEqual(
const NativeFileSnapshot& lhs,
const NativeFileSnapshot& rhs)
noexcept;
Definition filesystem_snapshot_internal.h:45
Definition filesystem_snapshot_internal.h:99
Definition filesystem_snapshot_internal.h:113
Definition filesystem_snapshot_internal.h:129
Definition filesystem_snapshot_internal.h:136
Definition filesystem_snapshot_internal.h:142
Definition filesystem_snapshot_internal.h:89
Definition filesystem_snapshot_internal.h:64
Definition filesystem_snapshot_internal.h:23
Definition filesystem_snapshot_internal.h:70
Definition filesystem_snapshot_internal.h:15
Definition filesystem_snapshot_internal.cc:278