Cleanup uses of inline
This commit is contained in:
parent
37fab4ee7a
commit
70ceea57e3
@ -908,7 +908,6 @@ namespace cxxopts
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
Options&
|
Options&
|
||||||
positional_help(std::string help_text)
|
positional_help(std::string help_text)
|
||||||
{
|
{
|
||||||
@ -916,15 +915,12 @@ namespace cxxopts
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
parse(int& argc, char**& argv);
|
parse(int& argc, char**& argv);
|
||||||
|
|
||||||
inline
|
|
||||||
OptionAdder
|
OptionAdder
|
||||||
add_options(std::string group = "");
|
add_options(std::string group = "");
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
add_option
|
add_option
|
||||||
(
|
(
|
||||||
@ -962,29 +958,23 @@ namespace cxxopts
|
|||||||
}
|
}
|
||||||
|
|
||||||
//parse positional arguments into the given option
|
//parse positional arguments into the given option
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
parse_positional(std::string option);
|
parse_positional(std::string option);
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
parse_positional(std::vector<std::string> options);
|
parse_positional(std::vector<std::string> options);
|
||||||
|
|
||||||
inline
|
|
||||||
std::string
|
std::string
|
||||||
help(const std::vector<std::string>& groups = {""}) const;
|
help(const std::vector<std::string>& groups = {""}) const;
|
||||||
|
|
||||||
inline
|
|
||||||
const std::vector<std::string>
|
const std::vector<std::string>
|
||||||
groups() const;
|
groups() const;
|
||||||
|
|
||||||
inline
|
|
||||||
const HelpGroupDetails&
|
const HelpGroupDetails&
|
||||||
group_help(const std::string& group) const;
|
group_help(const std::string& group) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
add_one_option
|
add_one_option
|
||||||
(
|
(
|
||||||
@ -992,15 +982,12 @@ namespace cxxopts
|
|||||||
std::shared_ptr<OptionDetails> details
|
std::shared_ptr<OptionDetails> details
|
||||||
);
|
);
|
||||||
|
|
||||||
inline
|
|
||||||
bool
|
bool
|
||||||
consume_positional(std::string a);
|
consume_positional(std::string a);
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
add_to_option(const std::string& option, const std::string& arg);
|
add_to_option(const std::string& option, const std::string& arg);
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
parse_option
|
parse_option
|
||||||
(
|
(
|
||||||
@ -1009,7 +996,6 @@ namespace cxxopts
|
|||||||
const std::string& arg = ""
|
const std::string& arg = ""
|
||||||
);
|
);
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
checked_parse_arg
|
checked_parse_arg
|
||||||
(
|
(
|
||||||
@ -1020,11 +1006,9 @@ namespace cxxopts
|
|||||||
const std::string& name
|
const std::string& name
|
||||||
);
|
);
|
||||||
|
|
||||||
inline
|
|
||||||
String
|
String
|
||||||
help_one_group(const std::string& group) const;
|
help_one_group(const std::string& group) const;
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
generate_group_help
|
generate_group_help
|
||||||
(
|
(
|
||||||
@ -1032,7 +1016,6 @@ namespace cxxopts
|
|||||||
const std::vector<std::string>& groups
|
const std::vector<std::string>& groups
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
inline
|
|
||||||
void
|
void
|
||||||
generate_all_groups_help(String& result) const;
|
generate_all_groups_help(String& result) const;
|
||||||
|
|
||||||
@ -1058,7 +1041,6 @@ namespace cxxopts
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
|
||||||
OptionAdder&
|
OptionAdder&
|
||||||
operator()
|
operator()
|
||||||
(
|
(
|
||||||
@ -1209,12 +1191,14 @@ namespace cxxopts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
OptionAdder
|
OptionAdder
|
||||||
Options::add_options(std::string group)
|
Options::add_options(std::string group)
|
||||||
{
|
{
|
||||||
return OptionAdder(*this, std::move(group));
|
return OptionAdder(*this, std::move(group));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
OptionAdder&
|
OptionAdder&
|
||||||
OptionAdder::operator()
|
OptionAdder::operator()
|
||||||
(
|
(
|
||||||
@ -1272,6 +1256,7 @@ OptionAdder::operator()
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::parse_option
|
Options::parse_option
|
||||||
(
|
(
|
||||||
@ -1283,6 +1268,7 @@ Options::parse_option
|
|||||||
value->parse(arg);
|
value->parse(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::checked_parse_arg
|
Options::checked_parse_arg
|
||||||
(
|
(
|
||||||
@ -1318,6 +1304,7 @@ Options::checked_parse_arg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::add_to_option(const std::string& option, const std::string& arg)
|
Options::add_to_option(const std::string& option, const std::string& arg)
|
||||||
{
|
{
|
||||||
@ -1331,6 +1318,7 @@ Options::add_to_option(const std::string& option, const std::string& arg)
|
|||||||
parse_option(iter->second, option, arg);
|
parse_option(iter->second, option, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
bool
|
bool
|
||||||
Options::consume_positional(std::string a)
|
Options::consume_positional(std::string a)
|
||||||
{
|
{
|
||||||
@ -1365,12 +1353,14 @@ Options::consume_positional(std::string a)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::parse_positional(std::string option)
|
Options::parse_positional(std::string option)
|
||||||
{
|
{
|
||||||
parse_positional(std::vector<std::string>{option});
|
parse_positional(std::vector<std::string>{option});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::parse_positional(std::vector<std::string> options)
|
Options::parse_positional(std::vector<std::string> options)
|
||||||
{
|
{
|
||||||
@ -1380,6 +1370,7 @@ Options::parse_positional(std::vector<std::string> options)
|
|||||||
m_positional_set.insert(m_positional.begin(), m_positional.end());
|
m_positional_set.insert(m_positional.begin(), m_positional.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::parse(int& argc, char**& argv)
|
Options::parse(int& argc, char**& argv)
|
||||||
{
|
{
|
||||||
@ -1538,6 +1529,7 @@ Options::parse(int& argc, char**& argv)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::add_option
|
Options::add_option
|
||||||
(
|
(
|
||||||
@ -1573,6 +1565,7 @@ Options::add_option
|
|||||||
value->is_container()});
|
value->is_container()});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::add_one_option
|
Options::add_one_option
|
||||||
(
|
(
|
||||||
@ -1588,6 +1581,7 @@ Options::add_one_option
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
String
|
String
|
||||||
Options::help_one_group(const std::string& g) const
|
Options::help_one_group(const std::string& g) const
|
||||||
{
|
{
|
||||||
@ -1658,6 +1652,7 @@ Options::help_one_group(const std::string& g) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::generate_group_help
|
Options::generate_group_help
|
||||||
(
|
(
|
||||||
@ -1680,6 +1675,7 @@ Options::generate_group_help
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
void
|
void
|
||||||
Options::generate_all_groups_help(String& result) const
|
Options::generate_all_groups_help(String& result) const
|
||||||
{
|
{
|
||||||
@ -1694,6 +1690,7 @@ Options::generate_all_groups_help(String& result) const
|
|||||||
generate_group_help(result, all_groups);
|
generate_group_help(result, all_groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
std::string
|
std::string
|
||||||
Options::help(const std::vector<std::string>& help_groups) const
|
Options::help(const std::vector<std::string>& help_groups) const
|
||||||
{
|
{
|
||||||
@ -1718,6 +1715,7 @@ Options::help(const std::vector<std::string>& help_groups) const
|
|||||||
return toUTF8String(result);
|
return toUTF8String(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
const std::vector<std::string>
|
const std::vector<std::string>
|
||||||
Options::groups() const
|
Options::groups() const
|
||||||
{
|
{
|
||||||
@ -1736,6 +1734,7 @@ Options::groups() const
|
|||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
const HelpGroupDetails&
|
const HelpGroupDetails&
|
||||||
Options::group_help(const std::string& group) const
|
Options::group_help(const std::string& group) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,4 +29,7 @@ if (CXXOPTS_BUILD_TESTS)
|
|||||||
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
|
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
|
||||||
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
|
"-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_executable(link_test link_a.cpp link_b.cpp)
|
||||||
|
target_link_libraries(link_test cxxopts)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
6
test/link_a.cpp
Normal file
6
test/link_a.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "cxxopts.hpp"
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
1
test/link_b.cpp
Normal file
1
test/link_b.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <cxxopts.hpp>
|
||||||
Loading…
Reference in New Issue
Block a user