LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
PortableMode.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4
5namespace util::portable
6{
7
13inline constexpr const char* kMarkerFile = "portable.txt";
14inline constexpr const char* kDataDirName = "data";
15
17std::filesystem::path ExecutableDir();
18
20bool IsPortable();
21
23std::filesystem::path DataDir();
24
26void OverrideExecutableDirForTesting(const std::filesystem::path& dir);
27
28} // namespace util::portable
Definition PortableMode.cpp:16
std::filesystem::path DataDir()
<executable dir>/data in portable mode, empty otherwise. Not created here.
Definition PortableMode.cpp:76
void OverrideExecutableDirForTesting(const std::filesystem::path &dir)
Tests: pretend the executable lives in dir. Empty path restores the real one.
Definition PortableMode.cpp:81
constexpr const char * kDataDirName
Definition PortableMode.hpp:14
std::filesystem::path ExecutableDir()
Directory containing the running executable (empty if it cannot be found).
Definition PortableMode.cpp:53
bool IsPortable()
True when the marker file exists next to the executable.
Definition PortableMode.cpp:61
constexpr const char * kMarkerFile
Definition PortableMode.hpp:13