VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::CommandSyntax Namespace Reference

Functions

std::vector< std::string > Tokenize (std::string_view text)
 
std::optional< std::string_view > StripPrefix (std::string_view message)
 

Variables

constexpr std::string_view ChatPrefix = "!"
 

Function Documentation

◆ StripPrefix()

std::optional< std::string_view > VoltMod::CommandSyntax::StripPrefix ( std::string_view  message)

message without its command prefix, or nullopt when it carries none.

Definition at line 49 of file CommandSyntax.cpp.

References ChatPrefix, and VoltMod::ReadFile().

Referenced by VoltMod::CommandManager::HandleChatMessage(), and VoltMod::CommandManager::IsForeign().

◆ Tokenize()

std::vector< std::string > VoltMod::CommandSyntax::Tokenize ( std::string_view  text)

Split text on spaces. A "quoted run" is one token and \"</tt> is a literal quote. Repeated spaces produce no blank arguments; an explicit <tt>"" is an empty argument.

Definition at line 6 of file CommandSyntax.cpp.

References VoltMod::ReadFile().

Referenced by VoltMod::CommandManager::HandleChatMessage(), and VoltMod::CommandManager::IsForeign().

Variable Documentation

◆ ChatPrefix

constexpr std::string_view VoltMod::CommandSyntax::ChatPrefix = "!"
inlineconstexpr

What starts a chat command, and what a chat usage line shows.

Definition at line 28 of file CommandSyntax.hpp.

Referenced by StripPrefix().