Converts the very "old C-like" console command parsing code into its own class that has a bit more structure and uses modern C++ data types. Also, unit tests!
Aside from cleaning up the code, my motivation here is to allow parsing console commands without actually executing them. This would be especially useful for parsing .ini files - thinking of server.ini or cases like in #1244.
Suggestions for improving the parsing API are welcome. It has to be a bit complex unfortunately, to support situations where the input should only be partially parsed (e. g. tab completion), and because of the wacky command name syntax where parsing depends on which commands are defined...
Converts the very "old C-like" console command parsing code into its own class that has a bit more structure and uses modern C++ data types. Also, unit tests!
Aside from cleaning up the code, my motivation here is to allow parsing console commands without actually executing them. This would be especially useful for parsing .ini files - thinking of server.ini or cases like in #1244.
Suggestions for improving the parsing API are welcome. It has to be a bit complex unfortunately, to support situations where the input should only be partially parsed (e. g. tab completion), and because of the wacky command name syntax where parsing depends on which commands are defined...