MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / BuildSearchDirs

Method BuildSearchDirs

src/PluginSegmentation.cpp:417–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415 }
416
417 static std::vector<std::string> BuildSearchDirs() {
418 std::vector<std::string> dirs =
419 SplitSearchPath(std::getenv("OPENCC_SEGMENTATION_PLUGIN_PATH"));
420 AppendUnique(dirs, PACKAGE_SEGMENTATION_PLUGIN_DIRECTORY);
421
422 const std::string currentLibraryDir = GetCurrentLibraryDirectory();
423 if (!currentLibraryDir.empty()) {
424#if defined(_WIN32) || defined(_WIN64)
425 AppendUnique(dirs, JoinPath(currentLibraryDir, "plugins"));
426#else
427 AppendUnique(dirs, JoinPath(currentLibraryDir, "opencc/plugins"));
428#endif
429 AppendUnique(dirs, currentLibraryDir);
430 }
431 return dirs;
432 }
433
434 static std::shared_ptr<PluginLibrary> LoadFromPath(const std::string& path,
435 const std::string& type) {

Callers

nothing calls this directly

Calls 5

AppendUniqueFunction · 0.85
SplitSearchPathFunction · 0.70
JoinPathFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected