BibleTime
directory.h
Go to the documentation of this file.
1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, https://bibletime.info/
6*
7* Copyright 1999-2025 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13#pragma once
14
15#include <QtGlobal>
16#include <QString>
17
18
19class QDir;
20
21namespace util {
22
23/**
24 * Tools for working with directories.
25*/
26namespace directory {
27
28/**
29 \brief Initializes the directory cache and returns whether it was successful.
30 \note When this function returns unsuccessfully, the program should exit.
31*/
33
34/** \returns the total size of all files in the given directory, recursively. */
35::qint64 getDirSizeRecursive(QString const & dir);
36
37#ifdef Q_OS_WIN
38/** Return the path to the sword dir., Windows only
39 C:\Program Files\BibleTime\share\sword
40 */
41const QDir &getApplicationSwordDir();
42
43/** Return the path to the shared Sword directory */
44const QDir &getSharedSwordDir();
45#endif
46
47/** Return the path to the icons. */
48const QDir &getIconDir();
49
50/** Return the path to the license. */
51QString const & getLicensePath();
52
53/** Return the path to the pictures. */
54const QDir &getPicsDir();
55
56/** Return the path to the translation files. */
57const QDir &getLocaleDir();
58
59/** \returns an absolute path to a handbook or QString() if not found. */
60QString getHandbook();
61
62/** \returns an absolute path to a howto or QString() if not found. */
63QString getHowto();
64
65/** Return the path to the default display template files. */
66const QDir &getDisplayTemplatesDir();
67
68/** Return the path to the user's home directory.
69 %APPDATA% on Windows
70 $HOME on linux */
71const QDir &getUserHomeDir();
72
73/** Return the path to the user's home .sword (or Sword) directory.
74 %APPDATA%\Sword on Windows
75 $HOME\.sword on linux */
76const QDir &getUserHomeSwordDir();
77
78/** Return the path to the user's settings directory.*/
79const QDir &getUserBaseDir();
80
81/** Return the path to the user's cache directory.*/
82const QDir &getUserCacheDir();
83
84/** Return the path to the user's indices directory.*/
85const QDir &getUserIndexDir();
86
87/** Return the path to the user's custom display templates directory.*/
88const QDir &getUserDisplayTemplatesDir();
89
90} // namespace directory
91} // namespace util
const QDir & getLocaleDir()
const QDir & getUserCacheDir()
QString getHandbook()
const QDir & getUserHomeSwordDir()
QString const & getLicensePath()
QDir const & getIconDir()
const QDir & getDisplayTemplatesDir()
const QDir & getUserHomeDir()
const QDir & getUserIndexDir()
::qint64 getDirSizeRecursive(QString const &dir)
bool initDirectoryCache()
Initializes the directory cache and returns whether it was successful.
Definition directory.cpp:61
const QDir & getUserBaseDir()
const QDir & getUserDisplayTemplatesDir()
const QDir & getPicsDir()
QString getHowto()