CLI11  2.5.0
Config.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017-2025, 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 // IWYU pragma: private, include "CLI/CLI.hpp"
10 
11 // [CLI11:public_includes:set]
12 #include <algorithm>
13 #include <cctype>
14 #include <fstream>
15 #include <iostream>
16 #include <string>
17 #include <utility>
18 #include <vector>
19 // [CLI11:public_includes:end]
20 
21 #include "App.hpp"
22 #include "ConfigFwd.hpp"
23 #include "StringTools.hpp"
24 
25 namespace CLI {
26 // [CLI11:config_hpp:verbatim]
27 namespace detail {
28 
29 std::string convert_arg_for_ini(const std::string &arg,
30  char stringQuote = '"',
31  char literalQuote = '\'',
32  bool disable_multi_line = false);
33 
35 std::string ini_join(const std::vector<std::string> &args,
36  char sepChar = ',',
37  char arrayStart = '[',
38  char arrayEnd = ']',
39  char stringQuote = '"',
40  char literalQuote = '\'');
41 
42 void clean_name_string(std::string &name, const std::string &keyChars);
43 
44 std::vector<std::string> generate_parents(const std::string &section, std::string &name, char parentSeparator);
45 
47 void checkParentSegments(std::vector<ConfigItem> &output, const std::string &currentSection, char parentSeparator);
48 } // namespace detail
49 
50 // [CLI11:config_hpp:end]
51 } // namespace CLI
52 
53 #ifndef CLI11_COMPILE
54 #include "impl/Config_inl.hpp" // IWYU pragma: export
55 #endif
Definition: App.hpp:36
std::vector< std::string > generate_parents(const std::string &section, std::string &name, char parentSeparator)
std::string convert_arg_for_ini(const std::string &arg, char stringQuote= '"', char literalQuote = '\'', bool disable_multi_line = false)
void clean_name_string(std::string &name, const std::string &keyChars)
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...
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.