29 template<
typename EnumeratorMapInserter,
typename RuntimeLibInserter>
30 std::pair<EnumeratorMapInserter, RuntimeLibInserter>
33 EnumeratorMapInserter enum_it,
34 RuntimeLibInserter lib_it) {
39 return std::make_pair(enum_it, lib_it);
45 for(
auto &entry : boost::make_iterator_range(fs::directory_iterator(dir.
enumerator_plugins()), {})) {
48 std::string p_s = p.string();
49 auto p_size = p_s.size();
51 if(fs::is_regular_file(p) && p_s.compare(p_size - 3, p_size,
".cc") == 0) {
54 std::string f_s = f.string();
55 auto f_size = f_s.size();
57 std::string msg =
"compiling new custom enumerator: " + f_s.substr(0, f_size - 3);
60 auto lib_ptr = std::make_shared<RuntimeLibrary>(
61 p_s.substr(0, p_size - 3),
68 "make_" + f_s.substr(0, f_size - 3) +
"_interface");
70 std::unique_ptr<EnumInterfaceBase> ptr(make_interface());
74 *lib_it++ = std::make_pair(ptr->name(), lib_ptr);
79 return std::make_pair(enum_it, lib_it);
Specification of CASM project directory structure.
std::string include_path(const fs::path &dir)
std::string so_options() const
Get current shared library options string.
Base class for generic use of enumerators that may be accessed through the API.
fs::path enumerator_plugins() const
Return enumerators plugin dir.
Read/modify settings of an already existing CASM project.
fs::path root_dir() const
Return casm project directory path.
std::string compile_options() const
Get current compilation options string.
std::pair< EnumeratorMapInserter, RuntimeLibInserter > load_enumerator_plugins(const ProjectSettings &set, EnumeratorMapInserter enum_it, RuntimeLibInserter lib_it)
Load enumerator plugins from a CASM project.
const DirectoryStructure & dir() const