.. _program_listing_file_gui_ArgsParser.hpp: Program Listing for File ArgsParser.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``gui/ArgsParser.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include extern const std::string GUI_USAGE; // Usage message for the GUI struct Args { private: std::string host; // Server hostname, NULL-terminated uint16_t port; // Range between 1024 and 65535 bool help = false; // Display help message static uint16_t ParseNumber( const std::string &arg, const char *name, uint16_t min, uint16_t max); bool Dispatcher(char *argv[], int opt); // NOLINT public: [[nodiscard]] bool GetHelp() const { return help; } [[nodiscard]] const std::string &GetHost() const { return host; } [[nodiscard]] uint16_t GetPort() const { return port; } bool Parse(int argc, char *argv[]); // NOLINT [[nodiscard]] std::string ToString() const; friend std::ostream &operator<<(std::ostream &os, const Args &args) { os << args.ToString(); return os; } };