aboutsummaryrefslogtreecommitdiff
path: root/include/Command.hpp
blob: fe8a947aaebcbbb1520fa13773b00e2efb9f2bec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include <vector>
#include <string>
#include <functional>

namespace dchat
{
    using CommandHandlerFunc = std::function<void(const std::vector<std::string> &args)>;
    
    class Command
    {
    public:
        static bool add(const std::string &cmd, CommandHandlerFunc handlerFunc);
        static bool call(const std::string &cmd, const std::vector<std::string> &args);
    };
}