Lines Matching defs:Path
27 static bool IsFile(const std::string &Path, const DWORD &FileAttributes) {
36 CreateFileA(Path.c_str(), 0, FILE_SHARE_READ, NULL, OPEN_EXISTING,
40 Printf("CreateFileA() failed for \"%s\" (Error code: %lu).\n", Path.c_str(),
48 Printf("GetFileType() failed for \"%s\" (Error code: %lu).\n", Path.c_str(),
63 bool IsFile(const std::string &Path) {
64 DWORD Att = GetFileAttributesA(Path.c_str());
68 Path.c_str(), GetLastError());
72 return IsFile(Path, Att);
75 std::string Basename(const std::string &Path) {
76 size_t Pos = Path.find_last_of("/\\");
77 if (Pos == std::string::npos) return Path;
78 assert(Pos < Path.size());
79 return Path.substr(Pos + 1);
82 size_t FileSize(const std::string &Path) {
84 if (!GetFileAttributesExA(Path.c_str(), GetFileExInfoStandard, &attr)) {
86 Path.c_str(), GetLastError());
101 std::string Path(Dir);
102 assert(!Path.empty());
103 if (Path.back() != '\\')
104 Path.push_back('\\');
105 Path.push_back('*');
109 HANDLE FindHandle(FindFirstFileA(Path.c_str(), &FindInfo));
160 void RemoveFile(const std::string &Path) {
161 _unlink(Path.c_str());
187 if (!Relative) // Accept relative path?
289 Printf("DirName() failed for \"%s\", invalid path.\n", FileName.c_str());
295 if (!FileLen) { // Path ended in separator.
305 if (!LocationLen) { // Relative path.
319 Printf("Couldn't get Tmp path.\n");