| 68 | } |
| 69 | |
| 70 | std::vector<std::string> Context::listModulesInWorkspace() const noexcept { |
| 71 | std::vector<std::string> moduleList; |
| 72 | |
| 73 | fs::path srcDir = workspacePath() / "src"; |
| 74 | |
| 75 | if (!fs::is_directory(srcDir)) { return {}; } |
| 76 | |
| 77 | for (const auto& dirEntry : boost::make_iterator_range( |
| 78 | fs::recursive_directory_iterator{srcDir, fs::symlink_option::recurse}, {})) { |
| 79 | const fs::path& p = dirEntry; |
| 80 | |
| 81 | // see if it's a chigraph module |
| 82 | if (fs::is_regular_file(p) && p.extension() == ".chimod") { |
| 83 | fs::path relPath = fs::relative(p, srcDir); |
| 84 | |
| 85 | relPath.replace_extension(""); // remove .chimod |
| 86 | moduleList.emplace_back(relPath.string()); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | return moduleList; |
| 91 | } |
| 92 | |
| 93 | Result Context::loadModule(const fs::path& name, Flags<LoadSettings> settings, ChiModule** toFill) { |
| 94 | assert(!name.empty() && "Name should not be empty when calling chi::Context::loadModule"); |
nothing calls this directly
no outgoing calls
no test coverage detected