This commit is contained in:
parent
6c0976baa7
commit
e22f82fc6f
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required (VERSION 3.1)
|
cmake_minimum_required (VERSION 3.1)
|
||||||
project(xdgcfg
|
project(xdgcfg
|
||||||
VERSION 0.2.2
|
VERSION 0.2.3
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +13,8 @@ set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
|
set(CMAKE_CXX_FLAGS
|
||||||
|
"${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -g -Og -fno-omit-frame-pointer")
|
||||||
|
|
||||||
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
|
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
|
||||||
include_directories(${LIBCONFIG_INCLUDE_DIRS})
|
include_directories(${LIBCONFIG_INCLUDE_DIRS})
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <libconfig.h++>
|
#include <libconfig.h++>
|
||||||
#include "xdgcfg.hpp"
|
#include "xdgcfg.hpp"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main()
|
||||||
{
|
{
|
||||||
xdgcfg config("test.cfg", "xdgcfg");
|
xdgcfg config("test.cfg", "xdgcfg");
|
||||||
config.set_verbose(true);
|
config.set_verbose(true);
|
||||||
|
|
|
@ -29,7 +29,7 @@ xdgcfg::xdgcfg(const string &filename, const string &subdir)
|
||||||
_filepath /= filename;
|
_filepath /= filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint_fast8_t xdgcfg::read()
|
uint_fast8_t xdgcfg::read()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ const uint_fast8_t xdgcfg::read()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool xdgcfg::write()
|
bool xdgcfg::write()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -86,12 +86,12 @@ const fs::path xdgcfg::get_filepath() const
|
||||||
return _filepath;
|
return _filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void xdgcfg::set_verbose(bool verbose)
|
void xdgcfg::set_verbose(bool verbose)
|
||||||
{
|
{
|
||||||
_verbose = verbose;
|
_verbose = verbose;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool xdgcfg::get_verbose() const
|
bool xdgcfg::get_verbose() const
|
||||||
{
|
{
|
||||||
return _verbose;
|
return _verbose;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,14 @@ public:
|
||||||
*
|
*
|
||||||
* @return 0 on success, 1 on I/O error, 2 on parse error.
|
* @return 0 on success, 1 on I/O error, 2 on parse error.
|
||||||
*/
|
*/
|
||||||
const uint_fast8_t read();
|
uint_fast8_t read();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Write the file
|
* @brief Write the file
|
||||||
*
|
*
|
||||||
* @return `true` on success
|
* @return `true` on success
|
||||||
*/
|
*/
|
||||||
const bool write();
|
bool write();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Returns a reference to the config as libconfig::Config
|
* @brief Returns a reference to the config as libconfig::Config
|
||||||
|
@ -70,12 +70,12 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* @brief Sets verbosity
|
* @brief Sets verbosity
|
||||||
*/
|
*/
|
||||||
const void set_verbose(bool verbose);
|
void set_verbose(bool verbose);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Returns verbosity
|
* @brief Returns verbosity
|
||||||
*/
|
*/
|
||||||
const bool get_verbose() const;
|
bool get_verbose() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*!
|
/*!
|
||||||
|
|
Reference in New Issue
Block a user