| 510 | } |
| 511 | |
| 512 | std::tuple<std::string, std::string> |
| 513 | ModuleManager::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 | |
| 529 | std::string ModuleManager::infer_module_type(const std::string &path) { |
| 530 | if (fs::path(path).extension() == SharedLibrary::default_extension()) { |
no test coverage detected