chromium/third_party/dawn/src/dawn/utils/CommandLineParser.cpp

// Copyright 2024 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "dawn/utils/CommandLineParser.h"

#include <algorithm>
#include <tuple>

#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"

namespace dawn::utils {

// OptionBase

CommandLineParser::OptionBase::OptionBase(std::string_view name, std::string_view desc)
    :{}

CommandLineParser::OptionBase::~OptionBase() = default;

const std::string& CommandLineParser::OptionBase::GetName() const {}

std::string CommandLineParser::OptionBase::GetShortName() const {}

const std::string& CommandLineParser::OptionBase::GetDescription() const {}

std::string CommandLineParser::OptionBase::GetParameter() const {}

bool CommandLineParser::OptionBase::IsSet() const {}

CommandLineParser::OptionBase::ParseResult CommandLineParser::OptionBase::Parse(
    absl::Span<const std::string_view> args) {}

// BoolOption

CommandLineParser::BoolOption::BoolOption(std::string_view name, std::string_view desc)
    :{}

CommandLineParser::BoolOption::~BoolOption() = default;

bool CommandLineParser::BoolOption::GetValue() const {}

std::string CommandLineParser::BoolOption::GetParameter() const {}

CommandLineParser::OptionBase::ParseResult CommandLineParser::BoolOption::ParseImpl(
    absl::Span<const std::string_view> args) {}

// StringOption

CommandLineParser::StringOption::StringOption(std::string_view name, std::string_view desc)
    :{}

CommandLineParser::StringOption::~StringOption() = default;

std::string CommandLineParser::StringOption::GetValue() const {}

CommandLineParser::OptionBase::ParseResult CommandLineParser::StringOption::ParseImpl(
    absl::Span<const std::string_view> args) {}

// StringListOption

CommandLineParser::StringListOption::StringListOption(std::string_view name, std::string_view desc)
    :{}

CommandLineParser::StringListOption::~StringListOption() = default;

absl::Span<const std::string> CommandLineParser::StringListOption::GetValue() const {}

std::vector<std::string> CommandLineParser::StringListOption::GetOwnedValue() const {}

CommandLineParser::OptionBase::ParseResult CommandLineParser::StringListOption::ParseImpl(
    absl::Span<const std::string_view> args) {}

// CommandLineParser

CommandLineParser::BoolOption& CommandLineParser::AddBool(std::string_view name,
                                                          std::string_view desc) {}

CommandLineParser::StringOption& CommandLineParser::AddString(std::string_view name,
                                                              std::string_view desc) {}

CommandLineParser::StringListOption& CommandLineParser::AddStringList(std::string_view name,
                                                                      std::string_view desc) {}

// static
std::string CommandLineParser::JoinConversionNames(absl::Span<const std::string_view> names,
                                                   std::string_view separator) {}

CommandLineParser::BoolOption& CommandLineParser::AddHelp() {}

// static
const CommandLineParser::ParseOptions CommandLineParser::kDefaultParseOptions =;

CommandLineParser::ParseResult CommandLineParser::Parse(absl::Span<const std::string_view> args,
                                                        const ParseOptions& parseOptions) {}

CommandLineParser::ParseResult CommandLineParser::Parse(const std::vector<std::string>& args,
                                                        const ParseOptions& parseOptions) {}

CommandLineParser::ParseResult CommandLineParser::Parse(int argc,
                                                        const char** argv,
                                                        const ParseOptions& parseOptions) {}

void CommandLineParser::PrintHelp(std::ostream& s) {}

}  // namespace dawn::utils