Wrapper around libconfig that writes and reads files in XDG_CONFIG_HOME.
该仓库已于 2020-05-16 归档。您可以查看文件或克隆它,但不能推送、创建工单或合并请求。
转到文件
tastytea 9337964266
continuous-integration/drone/push Build is passing 详情
Install headers more elegantly.
2019-08-03 22:18:16 +02:00
cmake Replaced ${PROJECT_NAME} with @PROJECT_NAME@. 2019-08-02 13:07:41 +02:00
examples License change to BSD-3-Clause. 2019-08-03 15:01:15 +02:00
include Install headers more elegantly. 2019-08-03 22:18:16 +02:00
pkg-config Rearranged the file structure and rewrote the CMake recipes. 2019-08-02 08:44:07 +02:00
src Install headers more elegantly. 2019-08-03 22:18:16 +02:00
tests Rearranged the file structure and rewrote the CMake recipes. 2019-08-02 08:44:07 +02:00
.drone.yml Added gcc-9 to CI. 2019-08-02 08:38:27 +02:00
.gitignore Added documentation generation 2018-08-10 02:55:09 +02:00
CMakeLists.txt Install headers more elegantly. 2019-08-03 22:18:16 +02:00
Doxyfile Fixed paths in Doxyfile. 2019-08-02 13:33:27 +02:00
LICENSE License change to BSD-3-Clause. 2019-08-03 15:01:15 +02:00
README.md Fixed example location in readme. 2019-08-02 10:12:56 +02:00
build_doc.sh Updated Doxygen generation. 2019-08-02 08:54:43 +02:00

README.md

xdgcfg is a very simple wrapper around libconfig written in C++. It reads and writes files in ${XDG_CONFIG_HOME}. It creates subdirectories if necessary.

Usage

xdgcfg.hpp has explanatory comments in it and there is an example. The reference is also available at doc.schlomp.space/xdgcfg/.

Use it in your CMake project like this:

find_package(xdgcfg CONFIG REQUIRED)
target_link_libraries(MyProject xdgcfg::xdgcfg)

If you don't use CMake, you can get the compile-flags with pkg-config:

pkg-config --libs --cflags xdgcfg

Install

Gentoo

Add my repository and install it from there.

eselect repository enable tastytea
echo "dev-cpp/xdgcfg" >> /etc/portage/package.accept_keywords/xdgcfg
emaint sync -r tastytea
emerge -a dev-cpp/xdgcfg

From source

Dependencies

Compile

mkdir build
cd build
cmake ..
cmake --build .
make install

CMake options

  • -DWITH_TESTS=YES to compile the tests.
  • -DWITH_EXAMPLES=YES to compile the example.
  • -DBUILD_SHARED_LIBS=NO to build a static library.