LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
util::portable Namespace Reference

Namespaces

namespace  anonymous_namespace{PortableMode.cpp}
 

Functions

std::filesystem::path ExecutableDir ()
 Directory containing the running executable (empty if it cannot be found).
 
bool IsPortable ()
 True when the marker file exists next to the executable.
 
std::filesystem::path DataDir ()
 <executable dir>/data in portable mode, empty otherwise. Not created here.
 
void OverrideExecutableDirForTesting (const std::filesystem::path &dir)
 Tests: pretend the executable lives in dir. Empty path restores the real one.
 

Variables

constexpr const char * kMarkerFile = "portable.txt"
 
constexpr const char * kDataDirName = "data"
 

Function Documentation

◆ DataDir()

std::filesystem::path util::portable::DataDir ( )

<executable dir>/data in portable mode, empty otherwise. Not created here.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExecutableDir()

std::filesystem::path util::portable::ExecutableDir ( )

Directory containing the running executable (empty if it cannot be found).

Here is the caller graph for this function:

◆ IsPortable()

bool util::portable::IsPortable ( )

True when the marker file exists next to the executable.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OverrideExecutableDirForTesting()

void util::portable::OverrideExecutableDirForTesting ( const std::filesystem::path &  dir)

Tests: pretend the executable lives in dir. Empty path restores the real one.

Variable Documentation

◆ kDataDirName

constexpr const char* util::portable::kDataDirName = "data"
inlineconstexpr

◆ kMarkerFile

constexpr const char* util::portable::kMarkerFile = "portable.txt"
inlineconstexpr

Portable mode keeps every user file (config, themes, plugins, session, logs, QSettings) in a data/ folder next to the executable instead of the per-user profile (APPDATA%, ~/Library, ~/.config, registry). It is switched on by an empty marker file named portable.txt next to the executable, so an unzipped copy can run from a USB stick and leaves nothing behind.