Blender V5.3
blender::CommandHandler Class Referenceabstract

#include <BKE_blender_cli_command.hh>

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

Inherited by blender::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 26 of file BKE_blender_cli_command.hh.

Constructor & Destructor Documentation

◆ CommandHandler()

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

Definition at line 28 of file BKE_blender_cli_command.hh.

References id.

Referenced by blender::BPyCommandHandler::BPyCommandHandler().

◆ ~CommandHandler()

virtual blender::CommandHandler::~CommandHandler ( )
virtualdefault

Member Function Documentation

◆ exec()

virtual int blender::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 blender::BPyCommandHandler.

References C.

Referenced by blender::BKE_blender_cli_command_exec().

Member Data Documentation

◆ id

const std::string blender::CommandHandler::id

◆ is_duplicate

bool blender::CommandHandler::is_duplicate = false

True when one or more registered commands share an ID.

Definition at line 41 of file BKE_blender_cli_command.hh.

Referenced by blender::BKE_blender_cli_command_exec(), and blender::BKE_blender_cli_command_unregister().


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