RDK Documentation (Open Sourced RDK Components)
AampcliCommandHandler.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 /**
21  * @file AampcliCommandHandler.h
22  * @brief AampcliCommandHandler header file
23  */
24 
25 #ifndef AAMPCLICOMMANDHANDLER_H
26 #define AAMPCLICOMMANDHANDLER_H
27 
28 #include <string>
29 #include <map>
30 #include <vector>
31 #include <priv_aamp.h>
32 
33 using std::string;
34 
35 class Command
36 {
37  public:
38  virtual ~Command( )
39  {}
40  virtual bool execute(char *cmd, PlayerInstanceAAMP *playerInstanceAamp) = 0;
41 };
42 
44 {
45  public:
46  static std::map<std::string, Command*> mCommandMap;
47  void registerAampcliCommands();
48  void registerCommandObjects();
49  void registerCommand(const std::string& commandName, Command* command);
50  bool dispatchAampcliCommands(char *cmd, PlayerInstanceAAMP *playerInstanceAamp);
51  void registerAllCommands();
52  static char **commandCompletion(const char *text, int start, int end);
53 };
54 
55 #endif // AAMPCLICOMMANDHANDLER_H
PlayerInstanceAAMP
Player interface class for the JS pluggin.
Definition: main_aamp.h:692
priv_aamp.h
Private functions and types used internally by AAMP.
Command
Definition: AampcliCommandHandler.h:35
CommandHandler
Definition: AampcliCommandHandler.h:43