#include "tensorflow/lite/tools/command_line_flags.h"
#include <algorithm>
#include <cstring>
#include <functional>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "absl/strings/match.h"
#include "tensorflow/lite/tools/logging.h"
namespace tflite {
namespace {
template <typename T>
std::string ToString(T val) { … }
template <>
std::string ToString(bool val) { … }
template <>
std::string ToString(const std::string& val) { … }
bool ParseFlag(const std::string& arg, int argv_position,
const std::string& flag, bool positional,
const std::function<bool(const std::string&, int argv_position)>&
parse_func,
bool* value_parsing_ok) { … }
template <typename T>
bool ParseFlag(const std::string& flag_value, int argv_position,
const std::function<void(const T&, int)>& hook) { … }
template <>
bool ParseFlag(const std::string& flag_value, int argv_position,
const std::function<void(const bool&, int)>& hook) { … }
template <typename T>
bool ParseFlag(const std::string& flag_value, int argv_position,
const std::function<void(const std::string&, int)>& hook) { … }
}
#define CONSTRUCTOR_IMPLEMENTATION …
CONSTRUCTOR_IMPLEMENTATION
CONSTRUCTOR_IMPLEMENTATION
CONSTRUCTOR_IMPLEMENTATION
CONSTRUCTOR_IMPLEMENTATION
CONSTRUCTOR_IMPLEMENTATION
#undef CONSTRUCTOR_IMPLEMENTATION
bool Flag::Parse(const std::string& arg, int argv_position,
bool* value_parsing_ok) const { … }
std::string Flag::GetTypeName() const { … }
bool Flags::Parse(int* argc, const char** argv,
const std::vector<Flag>& flag_list) { … }
std::string Flags::Usage(const std::string& cmdline,
const std::vector<Flag>& flag_list) { … }
std::string Flags::ArgsToString(int argc, const char** argv) { … }
}