37 typedef std::char_traits<char>::pos_type pos_type;
38 return reinterpret_cast<OStringStreamLog *
>(ptr)->ss().tellp() + pos_type(1);
43 std::strcpy(c_str, str.c_str());
52 Log &_log(*reinterpret_cast<Log *>(log));
53 Log &_debug_log(*reinterpret_cast<Log *>(debug_log));
54 Log &_err_log(*reinterpret_cast<Log *>(err_log));
56 return reinterpret_cast<cPrimClex *
>(ptr);
60 delete reinterpret_cast<PrimClex *
>(ptr);
65 bool read_composition,
70 _primclex->
refresh(read_settings, read_composition, read_chem_ref, read_configs, clear_clex);
75 Log &_log(*reinterpret_cast<OStringStreamLog *>(ostringstream_log));
76 std::vector<std::string> command_list;
78 command_list.push_back(val.first);
87 Log &_log(*reinterpret_cast<Log *>(log));
89 Log &_err_log(*reinterpret_cast<Log *>(err_log));
91 std::string s(
"casm ");
92 s += std::string(args);
96 CommandArgs command_args(s, _primclex, _root, _log, _err_log);
Data structure holding basic CASM command info.
struct costream costream
For std::ostream*.
void casm_primclex_refresh(cPrimClex *ptr, bool read_settings, bool read_composition, bool read_chem_ref, bool read_configs, bool clear_clex)
costream * casm_ostringstream_new()
costream * casm_nullstream()
void refresh(bool read_settings=false, bool read_composition=false, bool read_chem_ref=false, bool read_configs=false, bool clear_clex=false)
Reload PrimClex data from settings.
void casm_command_list(costream *ostringstream_log)
CommandMap & command_map()
Return static CommandMap containing all CASM API commands.
struct cPrimClex cPrimClex
For CASM::PrimClex*.
void casm_ostringstream_delete(costream *ptr)
PrimClex is the top-level data structure for a CASM project.
char * casm_ostringstream_strcpy(costream *ptr, char *c_str)
unsigned long casm_ostringstream_size(costream *ptr)
cPrimClex * casm_primclex_new(char *path, costream *log, costream *debug_log, costream *err_log)
cPrimClex * casm_primclex_null()
void casm_primclex_delete(cPrimClex *ptr)
int parse_result
stores error codes when attempting to parse std::string _args -> argc, argv
int casm_capi(char *args, cPrimClex *primclex, char *root, costream *log, costream *debug_log, costream *err_log)
int casm_api(const CommandArgs &args)
Executes CASM commands specified by args.