| 95 | } |
| 96 | |
| 97 | std::vector<std::string> SplitSearchPath(const char* raw) { |
| 98 | std::vector<std::string> entries; |
| 99 | if (raw == nullptr || *raw == '\0') { |
| 100 | return entries; |
| 101 | } |
| 102 | const char separator = |
| 103 | #if defined(_WIN32) || defined(_WIN64) |
| 104 | ';'; |
| 105 | #else |
| 106 | ':'; |
| 107 | #endif |
| 108 | std::string path(raw); |
| 109 | std::string::size_type start = 0; |
| 110 | while (start <= path.size()) { |
| 111 | const std::string::size_type end = path.find(separator, start); |
| 112 | const std::string entry = path.substr(start, end - start); |
| 113 | if (!entry.empty()) { |
| 114 | entries.push_back(entry); |
| 115 | } |
| 116 | if (end == std::string::npos) { |
| 117 | break; |
| 118 | } |
| 119 | start = end + 1; |
| 120 | } |
| 121 | return entries; |
| 122 | } |
| 123 | |
| 124 | #if defined(_WIN32) || defined(_WIN64) |
| 125 | using internal::Utf8FromWide; |