|
- #pragma once
-
- #include <string>
- #include <cstring>
-
- namespace cppargs
- {
-
- enum class next_result
- {
- finished = 0, //!< context does not have any further arguments
- option_short = 1, //!< moving to next argument was successfull (argument starts with - or --)
- option_long = 2, //!< moving to next argument was successfull (argument starts with - or --)
- argument = 3, //!< moving to next argument was successfull (argument does not starts with - or --)
- };
-
- struct context
- {
- int argc;
- char const * const * argv;
- char const * exe;
- char const * arg { nullptr };
- char const * value { nullptr };
- int index { 0 };
-
- /**
- * @brief Move to the next argument
- *
- * @param[out] key key of the next argument
- */
- inline next_result next(std::string* key = nullptr);
- };
-
- }
|