h2-mod/src/client/component/command.hpp

29 lines
546 B
C++
Raw Normal View History

2021-04-19 18:56:11 -04:00
#pragma once
namespace command
{
class params
{
public:
params();
int size() const;
const char* get(int index) const;
std::string join(int index) const;
const char* operator[](const int index) const
{
return this->get(index); //
}
private:
int nesting_;
};
void add_raw(const char* name, void (*callback)());
void add(const char* name, const std::function<void(const params&)>& callback);
void add(const char* name, const std::function<void()>& callback);
void execute(std::string command, bool sync = false);
}