ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
Loading...
Searching...
No Matches
acav::AppConfig Class Reference

Application configuration manager. More...

#include <AppConfig.h>

Public Member Functions

QString getConfigFilePath () const
 Get the path to the currently loaded configuration file.
bool reload ()
 Reload settings from the config file on disk.
QString getCacheDirectory (const QString &compilationDatabasePath) const
 Get the cache directory for a compilation database.
QString getDependenciesFilePath (const QString &compilationDatabasePath) const
 Get the dependencies JSON file path for a compilation database.
QString getAstCacheDirectory (const QString &compilationDatabasePath) const
 Get the AST cache directory for a compilation database.
QString getAstFilePath (const QString &compilationDatabasePath, const QString &sourceFilePath) const
 Get the AST cache file path for a source file.
QString getMetadataFilePath (const QString &compilationDatabasePath) const
 Get the metadata JSON file path for a compilation database.
QString getBuildDirectory (const QString &compilationDatabasePath) const
 Get the build directory from cached metadata.
bool getCommentExtractionEnabled () const
 Whether to extract and display comments in AST (default: false).
bool getMemoryProfilingEnabled () const
 Whether memory profiling checkpoints are enabled (default: false).
QString getCacheRoot () const
 Custom cache root directory (default: ~/.cache/acav/).
int getFontSize () const
 Editor/UI font size (default: 11).
QString getFontFamily () const
 Editor/UI font family (default: empty = system default).
int getParallelProcessorCount () const
 Number of parallel processors for query-dependencies (default: 0 = auto) 0 means use all available CPU cores, otherwise use the specified count.

Static Public Member Functions

static void initialize (const QString &configFilePath=QString())
 Initialize the singleton with a custom config file path.
static AppConfig & instance ()
 Get the singleton instance.

Detailed Description

Application configuration manager.

Manages application settings including cache directories for storing query-dependencies output and other cached data. Uses an INI configuration file that users can edit directly.

Default config file: ~/.acav Default cache directory: ~/.cache/acav/

Definition at line 42 of file AppConfig.h.

Member Function Documentation

◆ getAstCacheDirectory()

QString acav::AppConfig::getAstCacheDirectory ( const QString & compilationDatabasePath) const

Get the AST cache directory for a compilation database.

Parameters
compilationDatabasePathPath to compile_commands.json
Returns
Directory path where .ast files should be stored (creates if doesn't exist)

Definition at line 328 of file AppConfig.cpp.

References getCacheDirectory().

Referenced by getAstFilePath().

◆ getAstFilePath()

QString acav::AppConfig::getAstFilePath ( const QString & compilationDatabasePath,
const QString & sourceFilePath ) const

Get the AST cache file path for a source file.

Parameters
compilationDatabasePathPath to compile_commands.json
sourceFilePathPath to source file
Returns
Full path to .ast file (e.g., ~/.cache/acav/<hash>/ast/file.cpp.ast)

Definition at line 341 of file AppConfig.cpp.

References getAstCacheDirectory().

◆ getBuildDirectory()

QString acav::AppConfig::getBuildDirectory ( const QString & compilationDatabasePath) const

Get the build directory from cached metadata.

Parameters
compilationDatabasePathPath to compile_commands.json
Returns
Build directory path, or empty string if not found

Definition at line 273 of file AppConfig.cpp.

References getMetadataFilePath().

◆ getCacheDirectory()

QString acav::AppConfig::getCacheDirectory ( const QString & compilationDatabasePath) const

Get the cache directory for a compilation database.

Parameters
compilationDatabasePathPath to compile_commands.json
Returns
Directory path where dependencies.json should be stored

Definition at line 249 of file AppConfig.cpp.

Referenced by getAstCacheDirectory(), getDependenciesFilePath(), getMetadataFilePath(), and acav::MainWindow::loadCompilationDatabase().

◆ getCacheRoot()

QString acav::AppConfig::getCacheRoot ( ) const

Custom cache root directory (default: ~/.cache/acav/).

Definition at line 358 of file AppConfig.cpp.

◆ getCommentExtractionEnabled()

bool acav::AppConfig::getCommentExtractionEnabled ( ) const

Whether to extract and display comments in AST (default: false).

Definition at line 350 of file AppConfig.cpp.

◆ getConfigFilePath()

QString acav::AppConfig::getConfigFilePath ( ) const

Get the path to the currently loaded configuration file.

Returns
Absolute path to the INI config file

Definition at line 133 of file AppConfig.cpp.

◆ getDependenciesFilePath()

QString acav::AppConfig::getDependenciesFilePath ( const QString & compilationDatabasePath) const

Get the dependencies JSON file path for a compilation database.

Parameters
compilationDatabasePathPath to compile_commands.json
Returns
Full path to dependencies.json file

Definition at line 261 of file AppConfig.cpp.

References getCacheDirectory().

Referenced by acav::MainWindow::loadCompilationDatabase().

◆ getFontFamily()

QString acav::AppConfig::getFontFamily ( ) const

Editor/UI font family (default: empty = system default).

Definition at line 229 of file AppConfig.cpp.

◆ getFontSize()

int acav::AppConfig::getFontSize ( ) const

Editor/UI font size (default: 11).

Definition at line 227 of file AppConfig.cpp.

◆ getMemoryProfilingEnabled()

bool acav::AppConfig::getMemoryProfilingEnabled ( ) const

Whether memory profiling checkpoints are enabled (default: false).

Definition at line 354 of file AppConfig.cpp.

◆ getMetadataFilePath()

QString acav::AppConfig::getMetadataFilePath ( const QString & compilationDatabasePath) const

Get the metadata JSON file path for a compilation database.

Parameters
compilationDatabasePathPath to compile_commands.json
Returns
Full path to metadata.json file

Definition at line 267 of file AppConfig.cpp.

References getCacheDirectory().

Referenced by getBuildDirectory().

◆ getParallelProcessorCount()

int acav::AppConfig::getParallelProcessorCount ( ) const

Number of parallel processors for query-dependencies (default: 0 = auto) 0 means use all available CPU cores, otherwise use the specified count.

Definition at line 231 of file AppConfig.cpp.

◆ initialize()

void acav::AppConfig::initialize ( const QString & configFilePath = QString())
static

Initialize the singleton with a custom config file path.

Parameters
configFilePathPath to INI config file (empty = use default) Must be called before instance() - typically in main()

Definition at line 103 of file AppConfig.cpp.

◆ instance()

AppConfig & acav::AppConfig::instance ( )
static

Get the singleton instance.

Returns
Reference to AppConfig singleton
Note
initialize() must be called first

Definition at line 120 of file AppConfig.cpp.

Referenced by acav::MainWindow::loadCompilationDatabase().

◆ reload()

bool acav::AppConfig::reload ( )

Reload settings from the config file on disk.

Returns
true if the config file exists after reload.

Definition at line 137 of file AppConfig.cpp.


The documentation for this class was generated from the following files: