| 301 | } |
| 302 | |
| 303 | void createDirRecursive(String path) { |
| 304 | String currentPath = ""; |
| 305 | int startIndex = 0; |
| 306 | launcherConsolePrintf("Verifying folder: %s\n", path.c_str()); |
| 307 | |
| 308 | while (startIndex < path.length()) { |
| 309 | int endIndex = path.indexOf("/", startIndex); |
| 310 | if (endIndex == -1) endIndex = path.length(); |
| 311 | |
| 312 | currentPath += path.substring(startIndex, endIndex); |
| 313 | if (currentPath.length() > 0 && !SDM.exists(currentPath)) { |
| 314 | SDM.mkdir(currentPath); |
| 315 | launcherConsolePrintf("Creating folder: %s\n", currentPath.c_str()); |
| 316 | } |
| 317 | |
| 318 | if (endIndex < path.length()) currentPath += "/"; |
| 319 | startIndex = endIndex + 1; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | int findBytes(const std::vector<uint8_t> &data, const String &needle) { |
| 324 | if (needle.isEmpty() || data.size() < static_cast<size_t>(needle.length())) return -1; |
no test coverage detected