def38815f24a64a294c4cd5bfb9ab667257d60b8
[iec.git] / src / type3_AndroidCloud / anbox-master / src / anbox / qemu / at_parser.h
1 /*
2  * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17
18 #ifndef ANBOX_QEMU_AT_PARSER_H_
19 #define ANBOX_QEMU_AT_PARSER_H_
20
21 #include <functional>
22 #include <map>
23 #include <memory>
24 #include <string>
25 #include <vector>
26
27 #include "anbox/do_not_copy_or_move.h"
28
29 namespace anbox {
30 namespace qemu {
31 class AtParser {
32  public:
33   typedef std::function<void(const std::string &)> CommandHandler;
34
35   AtParser();
36
37   void register_command(const std::string &command, CommandHandler handler);
38
39   void process_data(std::vector<std::uint8_t> &data);
40
41  private:
42   void processs_command(const std::string &command);
43
44   std::map<std::string, CommandHandler> handlers_;
45 };
46 }  // namespace qemu
47 }  // namespace anbox
48
49 #endif