Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/CLI/Split.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
0002 // under NSF AWARD 1414736 and by the respective contributors.
0003 // All rights reserved.
0004 //
0005 // SPDX-License-Identifier: BSD-3-Clause
0006 
0007 #pragma once
0008 
0009 // IWYU pragma: private, include "CLI/CLI.hpp"
0010 
0011 // [CLI11:public_includes:set]
0012 #include <string>
0013 #include <tuple>
0014 #include <utility>
0015 #include <vector>
0016 // [CLI11:public_includes:end]
0017 
0018 #include "Macros.hpp"
0019 
0020 namespace CLI {
0021 // [CLI11:split_hpp:verbatim]
0022 
0023 namespace detail {
0024 
0025 // Returns false if not a short option. Otherwise, sets opt name and rest and returns true
0026 CLI11_INLINE bool split_short(const std::string &current, std::string &name, std::string &rest);
0027 
0028 // Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true
0029 CLI11_INLINE bool split_long(const std::string &current, std::string &name, std::string &value);
0030 
0031 // Returns false if not a windows style option. Otherwise, sets opt name and value and returns true
0032 CLI11_INLINE bool split_windows_style(const std::string &current, std::string &name, std::string &value);
0033 
0034 // Splits a string into multiple long and short names
0035 CLI11_INLINE std::vector<std::string> split_names(std::string current);
0036 
0037 /// extract default flag values either {def} or starting with a !
0038 CLI11_INLINE std::vector<std::pair<std::string, std::string>> get_default_flag_values(const std::string &str);
0039 
0040 /// Get a vector of short names, one of long names, and a single name
0041 CLI11_INLINE std::tuple<std::vector<std::string>, std::vector<std::string>, std::string>
0042 get_names(const std::vector<std::string> &input);
0043 
0044 }  // namespace detail
0045 // [CLI11:split_hpp:end]
0046 }  // namespace CLI
0047 
0048 #ifndef CLI11_COMPILE
0049 #include "impl/Split_inl.hpp"  // IWYU pragma: export
0050 #endif