CLI11 2.4.0
Loading...
Searching...
No Matches
Config.hpp
Go to the documentation of this file.
1// Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
2// under NSF AWARD 1414736 and by the respective contributors.
3// All rights reserved.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6
7#pragma once
8
9// [CLI11:public_includes:set]
10#include <algorithm>
11#include <cctype>
12#include <fstream>
13#include <iostream>
14#include <string>
15#include <utility>
16#include <vector>
17// [CLI11:public_includes:end]
18
19#include "App.hpp"
20#include "ConfigFwd.hpp"
21#include "StringTools.hpp"
22
23namespace CLI {
24// [CLI11:config_hpp:verbatim]
25namespace detail {
26
27std::string convert_arg_for_ini(const std::string &arg,
28 char stringQuote = '"',
29 char literalQuote = '\'',
30 bool disable_multi_line = false);
31
33std::string ini_join(const std::vector<std::string> &args,
34 char sepChar = ',',
35 char arrayStart = '[',
36 char arrayEnd = ']',
37 char stringQuote = '"',
38 char literalQuote = '\'');
39
40void clean_name_string(std::string &name, const std::string &keyChars);
41
42std::vector<std::string> generate_parents(const std::string &section, std::string &name, char parentSeparator);
43
45void checkParentSegments(std::vector<ConfigItem> &output, const std::string &currentSection, char parentSeparator);
46} // namespace detail
47
48// [CLI11:config_hpp:end]
49} // namespace CLI
50
51#ifndef CLI11_COMPILE
52#include "impl/Config_inl.hpp"
53#endif
std::string convert_arg_for_ini(const std::string &arg, char stringQuote='"', char literalQuote = '\'', bool disable_multi_line = false)
std::vector< std::string > generate_parents(const std::string &section, std::string &name, char parentSeparator)
void clean_name_string(std::string &name, const std::string &keyChars)
std::string ini_join(const std::vector< std::string > &args, char sepChar=',', char arrayStart='[', char arrayEnd=']', char stringQuote='"', char literalQuote = '\'')
Comma separated join, adds quotes if needed.
void checkParentSegments(std::vector< ConfigItem > &output, const std::string &currentSection, char parentSeparator)
assuming non default segments do a check on the close and open of the segments in a configItem struct...
Definition App.hpp:34