Blender V4.3
CommandHandler Class Referenceabstract

#include <BKE_blender_cli_command.hh>

Inherits blender::NonCopyable, and blender::NonMovable.

Inherited by BPyCommandHandler.

Public Member Functions

 CommandHandler (const std::string &id)
 
virtual ~CommandHandler ()=default
 
virtual int exec (struct bContext *C, int argc, const char **argv)=0
 

Public Attributes

const std::string id
 
bool is_duplicate = false
 

Detailed Description

Each instance of this class can run the command with an argument list. The arguments begin at the first argument after the command identifier.

Definition at line 24 of file BKE_blender_cli_command.hh.

Constructor & Destructor Documentation

◆ CommandHandler()

CommandHandler::CommandHandler ( const std::string & id)
inline

Definition at line 26 of file BKE_blender_cli_command.hh.

◆ ~CommandHandler()

virtual CommandHandler::~CommandHandler ( )
virtualdefault

Member Function Documentation

◆ exec()

virtual int CommandHandler::exec ( struct bContext * C,
int argc,
const char ** argv )
pure virtual

The main execution function. The return value is used as the commands exit-code.

Implemented in BPyCommandHandler.

Referenced by BKE_blender_cli_command_exec().

Member Data Documentation

◆ id

const std::string CommandHandler::id

Matched against --command {id}.

Definition at line 30 of file BKE_blender_cli_command.hh.

Referenced by BKE_blender_cli_command_unregister().

◆ is_duplicate

bool CommandHandler::is_duplicate = false

True when one or more registered commands share an ID.

Definition at line 39 of file BKE_blender_cli_command.hh.

Referenced by BKE_blender_cli_command_exec(), and BKE_blender_cli_command_unregister().


The documentation for this class was generated from the following file: