5 #include <boost/filesystem.hpp>
36 typedef std::char_traits<char>::pos_type pos_type;
37 return reinterpret_cast<OStringStreamLog *
>(ptr)->ss().tellp() + pos_type(1);
42 std::strcpy(c_str, str.c_str());
53 return reinterpret_cast<cPrimClex *
>(ptr);
57 delete reinterpret_cast<PrimClex *
>(ptr);
61 bool read_settings,
bool read_composition,
62 bool read_chem_ref,
bool read_configs,
68 _primclex->
refresh(read_settings, read_composition, read_chem_ref,
69 read_configs, clear_clex);
75 std::vector<std::string> command_list;
77 command_list.push_back(val.first);
95 std::string
s(
"casm ");
96 s += std::string(args);
108 }
catch (std::exception
const &e) {
109 _log <<
"CASM: Uncaught exception: \n" << e.what();
std::set< std::string > & s
costream * casm_ostringstream_new()
char * casm_ostringstream_strcpy(costream *ptr, char *c_str)
int casm_capi(char *args, cPrimClex *primclex, char *root, costream *log, costream *err_log)
cPrimClex * casm_primclex_new(char *path, costream *log, costream *err_log)
void casm_primclex_refresh(cPrimClex *ptr, costream *log, costream *err_log, bool read_settings, bool read_composition, bool read_chem_ref, bool read_configs, bool clear_clex)
unsigned long casm_ostringstream_size(costream *ptr)
void casm_primclex_delete(cPrimClex *ptr)
void casm_command_list(costream *ostringstream_log)
Print to log the recognized casm commands as a JSON array.
cPrimClex * casm_primclex_null()
void casm_ostringstream_delete(costream *ptr)
costream * casm_nullstream()
PrimClex is the top-level data structure for a CASM project.
CommandMap & command_map()
Return static CommandMap containing all CASM API commands.
struct costream costream
For std::ostream*.
struct cPrimClex cPrimClex
For CASM::PrimClex*.
int casm_api(const CommandArgs &args)
Executes CASM commands specified by args.
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.
Data structure holding basic CASM command info.