1 /*
2  * SPDX-FileCopyrightText: 2015-2015 CSSlayer <wengxt@gmail.com>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 #ifndef _FCITX_CONFIG_INIPARSER_H_
8 #define _FCITX_CONFIG_INIPARSER_H_
9 
10 #include <fcitx-config/rawconfig.h>
11 #include <fcitx-utils/standardpath.h>
12 #include "fcitxconfig_export.h"
13 
14 namespace fcitx {
15 class Configuration;
16 FCITXCONFIG_EXPORT void readFromIni(RawConfig &config, int fd);
17 FCITXCONFIG_EXPORT bool writeAsIni(const RawConfig &config, int fd);
18 FCITXCONFIG_EXPORT void readFromIni(RawConfig &config, FILE *fin);
19 FCITXCONFIG_EXPORT bool writeAsIni(const RawConfig &config, FILE *fout);
20 FCITXCONFIG_EXPORT void readAsIni(Configuration &, const std::string &name);
21 FCITXCONFIG_EXPORT void readAsIni(RawConfig &, const std::string &name);
22 FCITXCONFIG_EXPORT bool safeSaveAsIni(const Configuration &,
23                                       const std::string &name);
24 FCITXCONFIG_EXPORT bool safeSaveAsIni(const RawConfig &,
25                                       const std::string &name);
26 FCITXCONFIG_EXPORT bool safeSaveAsIni(const Configuration &,
27                                       StandardPath::Type type,
28                                       const std::string &name);
29 FCITXCONFIG_EXPORT bool safeSaveAsIni(const RawConfig &,
30                                       StandardPath::Type type,
31                                       const std::string &name);
32 } // namespace fcitx
33 
34 #endif // _FCITX_CONFIG_INIPARSER_H_
35