CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::CommandArgs Struct Reference

#include <casm_functions.hh>

+ Inheritance diagram for CASM::CommandArgs:

Detailed Description

Data structure holding basic CASM command info.

Definition at line 52 of file casm_functions.hh.

Public Member Functions

 CommandArgs (int _argc, char *_argv[], PrimClex *_primclex=nullptr, fs::path _root=fs::path())
 CommandArgs constructor. More...
 
 CommandArgs (std::string _args, PrimClex *_primclex=nullptr, fs::path _root=fs::path())
 CommandArgs constructor. More...
 
 CommandArgs (const CommandArgs &other)=delete
 
 CommandArgs (CommandArgs &&other)=delete
 
CommandArgsoperator= (const CommandArgs &)=delete
 
CommandArgsoperator= (CommandArgs &&)=delete
 
 ~CommandArgs ()
 CommandArgs destructor. More...
 
int argc () const
 
char ** argv () const
 
int parse_result () const
 

Public Attributes

PrimClexprimclex
 
fs::path root
 
bool is_help
 
bool write_log
 
std::string command
 

Private Member Functions

void _init ()
 

Private Attributes

int m_argc
 
char ** m_argv
 
int m_parse_result
 
bool m_free_p
 
wordexp_t m_p
 

Constructor & Destructor Documentation

◆ CommandArgs() [1/4]

CASM::CommandArgs::CommandArgs ( int  _argc,
char *  _argv[],
PrimClex _primclex = nullptr,
fs::path  _root = fs::path() 
)

CommandArgs constructor.

Parameters
_argcint, as from main
_argvchar*[], as from main
_primclexpointer to PrimClex or nullptr
_rootlocation of CASM project. If empty path, will use root of the CASM project containing current working directory

Definition at line 72 of file casm_functions.cc.

◆ CommandArgs() [2/4]

CASM::CommandArgs::CommandArgs ( std::string  _args,
PrimClex _primclex = nullptr,
fs::path  _root = fs::path() 
)

CommandArgs constructor.

Parameters
_argsstd::string of form 'casm [subcommand] [opt...]'
_primclexpointer to PrimClex or nullptr
_rootlocation of CASM project. If empty path, will use root of the CASM project containing current working directory

Definition at line 85 of file casm_functions.cc.

◆ CommandArgs() [3/4]

CASM::CommandArgs::CommandArgs ( const CommandArgs other)
delete

◆ CommandArgs() [4/4]

CASM::CommandArgs::CommandArgs ( CommandArgs &&  other)
delete

◆ ~CommandArgs()

CASM::CommandArgs::~CommandArgs ( )

CommandArgs destructor.

Definition at line 90 of file casm_functions.cc.

Member Function Documentation

◆ _init()

void CASM::CommandArgs::_init ( )
private

Definition at line 92 of file casm_functions.cc.

◆ argc()

int CASM::CLIParse::argc ( ) const
inlineinherited

Definition at line 20 of file CLIParse.hh.

◆ argv()

char** CASM::CLIParse::argv ( ) const
inlineinherited

Definition at line 22 of file CLIParse.hh.

◆ operator=() [1/2]

CommandArgs& CASM::CommandArgs::operator= ( CommandArgs &&  )
delete

◆ operator=() [2/2]

CommandArgs& CASM::CommandArgs::operator= ( const CommandArgs )
delete

◆ parse_result()

int CASM::CLIParse::parse_result ( ) const
inlineinherited

Definition at line 24 of file CLIParse.hh.

Member Data Documentation

◆ command

std::string CASM::CommandArgs::command

Definition at line 79 of file casm_functions.hh.

◆ is_help

bool CASM::CommandArgs::is_help

Definition at line 73 of file casm_functions.hh.

◆ m_argc

int CASM::CLIParse::m_argc
privateinherited

Definition at line 27 of file CLIParse.hh.

◆ m_argv

char** CASM::CLIParse::m_argv
privateinherited

Definition at line 28 of file CLIParse.hh.

◆ m_free_p

bool CASM::CLIParse::m_free_p
privateinherited

Definition at line 34 of file CLIParse.hh.

◆ m_p

wordexp_t CASM::CLIParse::m_p
privateinherited

Definition at line 35 of file CLIParse.hh.

◆ m_parse_result

int CASM::CLIParse::m_parse_result
privateinherited

stores error codes when attempting to parse std::string _args -> argc, argv

Definition at line 32 of file CLIParse.hh.

◆ primclex

PrimClex* CASM::CommandArgs::primclex

Definition at line 69 of file casm_functions.hh.

◆ root

fs::path CASM::CommandArgs::root

Definition at line 71 of file casm_functions.hh.

◆ write_log

bool CASM::CommandArgs::write_log

Definition at line 76 of file casm_functions.hh.


The documentation for this struct was generated from the following files: