Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
dbt_utils.hpp
Go to the documentation of this file.
1/**
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright (c) 2022 Gothel Software e.K.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef DBT_UTILS_HPP_
26#define DBT_UTILS_HPP_
27
28#include <cstring>
29#include <string>
30#include <memory>
31#include <cstdint>
32#include <cstdio>
33
34#include "dbt_constants.hpp"
35
36#include <jau/file_util.hpp>
37
38class DBTUtils {
39 public:
40
41 static bool mkdirKeyFolder() {
44 return true;
45 }
46 }
47 return false;
48 }
49
50
51 static bool rmKeyFolder() {
54 return true;
55 }
56 }
57 return false;
58 }
59};
60
61#endif /* DBT_UTILS_HPP_ */
static constexpr const char SERVER_KEY_PATH[]
static constexpr const char CLIENT_KEY_PATH[]
C++20 we could use constexpr std::string
Author: Sven Gothel sgothel@jausoft.com Copyright (c) 2022 Gothel Software e.K.
Definition: dbt_utils.hpp:38
static bool mkdirKeyFolder()
Definition: dbt_utils.hpp:41
static bool rmKeyFolder()
Definition: dbt_utils.hpp:51
bool mkdir(const std::string &path, const fmode_t mode=jau::fs::fmode_t::def_dir_prot, const bool verbose=false) noexcept
Create directory.
Definition: file_util.cpp:909
bool remove(const std::string &path, const traverse_options topts=traverse_options::none) noexcept
Remove the given path.
Definition: file_util.cpp:1173
@ recursive
Traverse through directories, i.e.