@@ -36,26 +36,27 @@ CommandLine& CommandLine::operator=(const CommandLine& from) = default;
3636
3737CommandLine& CommandLine::operator =(CommandLine&& from) = default ;
3838
39- bool CommandLine::HasOption (StringView name, size_t * index) const {
40- auto it = option_index_.find (name.ToString ());
39+ bool CommandLine::HasOption (std::string_view name, size_t * index) const {
40+ auto it = option_index_.find (name.data ());
4141 if (it == option_index_.end ())
4242 return false ;
4343 if (index)
4444 *index = it->second ;
4545 return true ;
4646}
4747
48- bool CommandLine::GetOptionValue (StringView name, std::string* value) const {
48+ bool CommandLine::GetOptionValue (std::string_view name,
49+ std::string* value) const {
4950 size_t index;
5051 if (!HasOption (name, &index))
5152 return false ;
5253 *value = options_[index].value ;
5354 return true ;
5455}
5556
56- std::vector<fml::StringView > CommandLine::GetOptionValues (
57- StringView name) const {
58- std::vector<fml::StringView > ret;
57+ std::vector<std::string_view > CommandLine::GetOptionValues (
58+ std::string_view name) const {
59+ std::vector<std::string_view > ret;
5960 for (const auto & option : options_) {
6061 if (option.name == name)
6162 ret.push_back (option.value );
@@ -64,11 +65,11 @@ std::vector<fml::StringView> CommandLine::GetOptionValues(
6465}
6566
6667std::string CommandLine::GetOptionValueWithDefault (
67- StringView name,
68- StringView default_value) const {
68+ std::string_view name,
69+ std::string_view default_value) const {
6970 size_t index;
7071 if (!HasOption (name, &index))
71- return default_value.ToString () ;
72+ return { default_value.data (), default_value. size ()} ;
7273 return options_[index].value ;
7374}
7475
0 commit comments