This file is indexed.

/usr/include/libcalamares/utils/CalamaresUtils.h is in calamares 3.1.12-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
/* === This file is part of Calamares - <http://github.com/calamares> ===
 *
 *   Copyright 2013-2016, Teo Mrnjavac <teo@kde.org>
 *
 *   Originally from Tomahawk, portions:
 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 *   Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
 *   Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
 *
 *   Calamares is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Calamares is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef CALAMARESUTILS_H
#define CALAMARESUTILS_H

#include "DllMacro.h"

#include <QLocale>

#define RESPATH ":/data/"

class QDir;
class QObject;

/**
 * @brief The CalamaresUtils namespace contains utility functions.
 */
namespace CalamaresUtils
{
    DLLEXPORT QDir qmlModulesDir();

    /**
     * @brief appDataDir returns the directory with common application data.
     * Defaults to CMAKE_INSTALL_FULL_DATADIR (usually /usr/share/calamares).
     */
    DLLEXPORT QDir appDataDir();

    /**
     * @brief appLogDir returns the directory for Calamares logs.
     * Defaults to QStandardPaths::CacheLocation (usually ~/.cache/Calamares).
     */
    DLLEXPORT QDir appLogDir();

    /**
     * @brief systemLibDir returns the system's lib directory.
     * Defaults to CMAKE_INSTALL_FULL_LIBDIR (usually /usr/lib64 or /usr/lib).
     */
    DLLEXPORT QDir systemLibDir();

    /**
     * @brief installTranslator changes the application language.
     * @param locale the new locale.
     * @param brandingTranslationsPrefix the branding path prefix, from Calamares::Branding.
     * @param parent the parent QObject.
     */
    DLLEXPORT void installTranslator( const QLocale& locale,
                                      const QString& brandingTranslationsPrefix,
                                      QObject* parent );

    DLLEXPORT QString translatorLocaleName();

    /**
     * Override app data dir. Only for testing purposes.
     */
    DLLEXPORT void setAppDataDir( const QDir& dir );
    DLLEXPORT bool isAppDataDirOverridden();

    DLLEXPORT void setQmlModulesDir( const QDir& dir );

    /**
     * @brief removeDiacritics replaces letters with diacritics and ligatures with
     * alternative forms and digraphs.
     * @param string the string to transform.
     * @return the output string with plain characters.
     */
    DLLEXPORT QString removeDiacritics( const QString& string );

    /**
     * @brief obscure is a bidirectional obfuscation function, from KStringHandler.
     * @param string the input string.
     * @return the obfuscated string.
     */
    DLLEXPORT QString obscure( const QString& string );

    /**
     * @brief crash makes Calamares crash immediately.
     */
    DLLEXPORT void crash();
}

#endif // CALAMARESUTILS_H