GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
Command.h
Go to the documentation of this file.
1#ifndef Cpl_TShell_Cmd_Command_h_
2#define Cpl_TShell_Cmd_Command_h_
3/*-----------------------------------------------------------------------------
4* This file is part of the Colony.Core Project. The Colony.Core Project is an
5* open source project with a BSD type of licensing agreement. See the license
6* agreement (license.txt) in the top/ directory or on the Internet at
7* http://integerfox.com/colony.core/license.txt
8*
9* Copyright (c) 2014-2025 John T. Taylor
10*
11* Redistributions of the source code must retain the above copyright notice.
12*----------------------------------------------------------------------------*/
13/** @file */
14
15#include "colony_config.h"
16#include "Cpl/TShell/Command.h"
17#include "Cpl/TShell/Context_.h"
18
19/** Default Permission level for all commands
20 */
21#ifndef OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
22#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL Cpl::TShell::Security::ePUBLIC
23#endif
24
25
26///
27namespace Cpl {
28///
29namespace TShell {
30///
31namespace Cmd {
32
33/** This partially concrete class implements infrastructure and/or common
34 functionality for a Shell command.
35 */
37{
38protected:
39 /// Result when processing a conditional statement
41 {
42 eFALSE, //!< The conditional statement evaluated to false
43 eTRUE, //!< The conditional statement evaluated to true
44 eERROR //!< Error occurring during the evaluation of the conditional
45 };
46
47protected:
48 /// Command verb
49 const char* m_verb;
50
51 /// Minimum required user permission need to execute me
53
54protected:
55 /// Constructor
57 const char* verb,
59
60
61public:
62 /// See Cpl::TShell::Command
63 const char* getVerb() const noexcept;
64
65 /// See Cpl::TShell::Command
66 Security::Permission_T getMinPermissionRequired() const noexcept;
67};
68
69}; // end namespaces
70};
71};
72#endif // end header latch
#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
Default Permission level for all commands.
Definition Command.h:22
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
This partially concrete class implements infrastructure and/or common functionality for a Shell comma...
Definition Command.h:37
Security::Permission_T getMinPermissionRequired() const noexcept
See Cpl::TShell::Command.
const char * getVerb() const noexcept
See Cpl::TShell::Command.
const char * m_verb
Command verb.
Definition Command.h:49
Security::Permission_T m_minPermissionLevel
Minimum required user permission need to execute me.
Definition Command.h:52
CondResult_T
Result when processing a conditional statement.
Definition Command.h:41
@ eFALSE
The conditional statement evaluated to false.
Definition Command.h:42
@ eTRUE
The conditional statement evaluated to true.
Definition Command.h:43
@ eERROR
Error occurring during the evaluation of the conditional.
Definition Command.h:44
Command(Cpl::Container::SList< Cpl::TShell::Command > &commandList, const char *verb, Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
Constructor.
This class defines the interface for a TShell command.
Definition Command.h:32
This abstract defines the interface for validating a 'user login' for TShell.
Definition Security.h:31
Permission_T
Permissions levels.
Definition Security.h:34
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20