MCPcopy Create free account
hub / github.com/BabitMF/bmf / parse_entry

Method parse_entry

bmf/sdk/cpp_sdk/src/module_manager.cpp:512–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512std::tuple<std::string, std::string>
513ModuleManager::parse_entry(const std::string &module_entry, bool file_system) {
514 std::vector<std::string> entry_path;
515 string_split(entry_path, module_entry, ".:");
516 if (entry_path.size() < 2) {
517 BMF_Error_(BMF_StsBadArg, "module_entry: ", module_entry.c_str(),
518 "is not satisfy");
519 }
520 auto sep = file_system ? std::string{fs::path::preferred_separator} : ".";
521 auto module_file = entry_path[0];
522 for (int i = 1; i < entry_path.size() - 1; i++) {
523 module_file += sep + entry_path[i];
524 }
525 auto module_class = entry_path[entry_path.size() - 1];
526 return std::make_tuple(module_file, module_class);
527}
528
529std::string ModuleManager::infer_module_type(const std::string &path) {
530 if (fs::path(path).extension() == SharedLibrary::default_extension()) {

Callers 1

install_moduleFunction · 0.80

Calls 2

string_splitFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected