| 391 | } |
| 392 | |
| 393 | static void AddStaticContent(const char * dir, const char * root) |
| 394 | { |
| 395 | IO::FindHandleT find_handle; |
| 396 | IO::FindDataT find_data; |
| 397 | |
| 398 | if (IO::FindFileOpen(dir, &find_handle, find_data)) |
| 399 | { |
| 400 | do |
| 401 | { |
| 402 | IO::Filename full_path; |
| 403 | IO::Path::Combine(full_path, dir, find_data.Name); |
| 404 | |
| 405 | std::string resource_path = root; |
| 406 | resource_path += '/'; |
| 407 | resource_path += find_data.Name; |
| 408 | |
| 409 | if (IO::Directory::IsDirectory(full_path)) |
| 410 | { |
| 411 | AddStaticContent(full_path, resource_path.c_str()); |
| 412 | } |
| 413 | else if (IO::File::Exists(full_path)) |
| 414 | { |
| 415 | StaticResource resource; |
| 416 | resource.Resource = resource_path; |
| 417 | resource.FullPath = full_path; |
| 418 | |
| 419 | DBGConsole_Msg(0, " adding [M%s] -> [C%s]", |
| 420 | resource.Resource.c_str(), resource.FullPath.c_str()); |
| 421 | |
| 422 | gStaticResources.push_back(resource); |
| 423 | } |
| 424 | } |
| 425 | while (IO::FindFileNext(find_handle, find_data)); |
| 426 | |
| 427 | IO::FindFileClose(find_handle); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | bool WebDebug_Init() |
| 432 | { |
no test coverage detected