#include "ChatCommandTags.h"
◆ value_type
◆ TryConsume()
29{
30 if (args.empty())
31 return std::nullopt;
32
33 if ((args[0] != '"') && (args[0] != '\''))
35
36 char const QUOTE = args[0];
37 for (std::size_t i = 1; i < args.length(); ++i)
38 {
39 if (args[i] == QUOTE)
40 {
41 auto [remainingToken, tail] =
tokenize(args.substr(i + 1));
42 if (remainingToken.empty())
43 return tail;
44 else
45 return std::nullopt;
46 }
47
48 if (args[i] == '\\')
49 {
50 ++i;
51 if (!(i < args.length()))
52 break;
53 }
54 std::string::push_back(args[i]);
55 }
56
57
58 return std::nullopt;
59}
TokenizeResult tokenize(std::string_view args)
Definition: ChatCommandHelpers.h:55
Definition: ChatCommandArgs.h:50
References Acore::Impl::ChatCommands::tokenize().