| 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) { |
nothing calls this directly
no test coverage detected