Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

35 Zeilen
1.0 KiB

  1. #pragma once
  2. #include <string>
  3. #include <cstring>
  4. namespace cppargs
  5. {
  6. enum class next_result
  7. {
  8. finished = 0, //!< context does not have any further arguments
  9. option_short = 1, //!< moving to next argument was successfull (argument starts with - or --)
  10. option_long = 2, //!< moving to next argument was successfull (argument starts with - or --)
  11. argument = 3, //!< moving to next argument was successfull (argument does not starts with - or --)
  12. };
  13. struct context
  14. {
  15. int argc;
  16. char const * const * argv;
  17. char const * exe;
  18. char const * arg { nullptr };
  19. char const * value { nullptr };
  20. int index { 0 };
  21. /**
  22. * @brief Move to the next argument
  23. *
  24. * @param[out] key key of the next argument
  25. */
  26. inline next_result next(std::string* key = nullptr);
  27. };
  28. }