1 #ifndef CASM_FUNCTIONS_HH
2 #define CASM_FUNCTIONS_HH
30 #define ERR_INVALID_ARG 1
39 #define ERR_INVALID_INPUT_FILE 4
42 #define ERR_MISSING_INPUT_FILE 5
45 #define ERR_EXISTING_FILE 6
49 #define ERR_MISSING_DEPENDS 7
52 #define ERR_OTHER_PROJ 8
69 struct CommandArgs :
public Logging {
135 typedef std::function<int (const CommandArgs &)>
Command;
161 std::unique_ptr<std::ostream> &fout,
Data structure holding basic CASM command info.
int update_command(const CommandArgs &args)
int enum_command(const CommandArgs &args)
int rm_command(const CommandArgs &args)
int select_command(const CommandArgs &args)
int files_command(const CommandArgs &args)
int view_command(const CommandArgs &args)
CommandArgs & operator=(const CommandArgs &)=delete
~CommandArgs()
CommandArgs destructor.
int init_command(const CommandArgs &args)
bool m_free_p
Used when parsing std::string args -> argc, argv.
int super_command(const CommandArgs &args)
int query_command(const CommandArgs &args)
CommandMap & command_map()
Return static CommandMap containing all CASM API commands.
int import_command(const CommandArgs &args)
Logging(Log &log=default_log(), Log &debug_log=default_log(), Log &err_log=default_err_log())
int status_command(const CommandArgs &args)
int run_command(const CommandArgs &args)
int bset_command(const CommandArgs &args)
PrimClex is the top-level data structure for a CASM project.
int monte_command(const CommandArgs &args)
int ref_command(const CommandArgs &args)
CommandArgs(int _argc, char *_argv[], PrimClex *_primclex, fs::path _root, const Logging &logging)
CommandArgs constructor.
std::map< std::string, Command > CommandMap
std::ostream & make_ostream_if(bool output, std::ostream &sout, std::unique_ptr< std::ostream > &fout, fs::path out_path, bool gzip)
Return a reference to proper std::ostream.
int perturb_command(const CommandArgs &args)
int help_command(const CommandArgs &args)
Print CASM help info to args.log.
PrimClex & make_primclex_if_not(const CommandArgs &args, std::unique_ptr< PrimClex > &uniq_primclex)
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or c...
int sym_command(const CommandArgs &args)
std::function< int(const CommandArgs &)> Command
int version_command(const CommandArgs &args)
int format_command(const CommandArgs &args)
int parse_result
stores error codes when attempting to parse std::string _args -> argc, argv
CommandArgs(std::string _args, PrimClex *_primclex=nullptr, fs::path _root=fs::path(), Log &_log=default_log(), Log &_err_log=default_err_log())
CommandArgs constructor.
int settings_command(const CommandArgs &args)
CommandArgs(int _argc, char *_argv[], PrimClex *_primclex=nullptr, fs::path _root=fs::path(), Log &_log=default_log(), Log &_err_log=default_err_log())
CommandArgs constructor.
int casm_api(const CommandArgs &args)
Executes CASM commands specified by args.
int composition_command(const CommandArgs &args)