#include <PathResolver.h>
Public Types | |
enum | SearchPathStatus { Ok, EnvironmentVariableUndefined, UnknownDirectory } |
enum | SearchPathStatus { Ok, EnvironmentVariableUndefined, UnknownDirectory } |
enum | SearchType { LocalSearch, RecursiveSearch } |
enum | SearchType { LocalSearch, RecursiveSearch } |
Static Public Member Functions | |
SearchPathStatus | check_search_path (const std::string &search_path) |
SearchPathStatus | check_search_path (const std::string &search_path) |
std::string | find_directory (const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch) |
std::string | find_directory (const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch) |
std::string | find_directory_from_list (const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch) |
std::string | find_directory_from_list (const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch) |
std::string | find_file (const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch) |
std::string | find_file (const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch) |
std::string | find_file_from_list (const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch) |
std::string | find_file_from_list (const std::string &logical_file_name, const std::string &search_list, SearchType search_type=LocalSearch) |
|
00010 { 00011 Ok, 00012 EnvironmentVariableUndefined, 00013 UnknownDirectory 00014 } SearchPathStatus;
|
|
00010 { 00011 Ok, 00012 EnvironmentVariableUndefined, 00013 UnknownDirectory 00014 } SearchPathStatus;
|
|
00017 { 00018 LocalSearch, 00019 RecursiveSearch 00020 } SearchType;
|
|
00017 { 00018 LocalSearch, 00019 RecursiveSearch 00020 } SearchType;
|
|
|
|
00599 { 00600 const char* path_env = ::getenv (search_path.c_str ()); 00601 00602 if (path_env == 0) return (EnvironmentVariableUndefined); 00603 00604 #ifdef WIN32 00605 static const char path_separator = ';'; 00606 #else 00607 static const char path_separator = ':'; 00608 #endif 00609 00610 std::string path_list (path_env); 00611 00612 std::string::size_type pos = 0; 00613 00614 for (int i = 0;;i++) 00615 { 00616 bool ending = false; 00617 00618 std::string::size_type next = path_list.find (path_separator, pos); 00619 00620 std::string path = path_list.substr (pos, next - pos); 00621 00622 if (next == std::string::npos) 00623 { 00624 path = path_list.substr (pos); 00625 ending = true; 00626 } 00627 else 00628 { 00629 path = path_list.substr (pos, next - pos); 00630 pos = next + 1; 00631 } 00632 00633 std::string real_name = ""; 00634 00635 if (!PR_test_exist (path, real_name, PR_directory)) 00636 { 00637 return (UnknownDirectory); 00638 } 00639 00640 if (ending) break; 00641 } 00642 00643 return (Ok); 00644 }
|
|
|
|
00571 { 00572 const char* path_env = ::getenv (search_path.c_str ()); 00573 00574 std::string path_list; 00575 00576 if (path_env != 0) 00577 { 00578 path_list = path_env; 00579 } 00580 00581 return (find_directory_from_list (logical_file_name, path_list, search_type)); 00582 }
|
|
|
|
00587 { 00588 std::string result; 00589 00590 if (!PR_find_from_list (logical_file_name, search_list, PR_directory, search_type, result)) 00591 { 00592 result = ""; 00593 } 00594 00595 return (result); 00596 }
|
|
|
|
00541 { 00542 const char* path_env = ::getenv (search_path.c_str ()); 00543 00544 std::string path_list; 00545 00546 if (path_env != 0) 00547 { 00548 path_list = path_env; 00549 } 00550 00551 return (find_file_from_list (logical_file_name, path_list, search_type)); 00552 }
|
|
|
|
00557 { 00558 std::string result; 00559 00560 if (!PR_find_from_list (logical_file_name, search_list, PR_regular_file, search_type, result)) 00561 { 00562 result = ""; 00563 } 00564 00565 return (result); 00566 }
|