Lines Matching full:filepath
45 const std::string FilePath::separator = "\\";
47 const std::string FilePath::separator = "/";
50 FilePath::FilePath (const std::vector<std::string>& components) in FilePath() function in de::FilePath
60 void FilePath::split (std::vector<std::string>& components) const in split()
89 FilePath FilePath::join (const std::vector<std::string>& components) in join()
91 return FilePath(components); in join()
94 FilePath& FilePath::normalize (void) in normalize()
134 FilePath FilePath::normalize (const FilePath& path) in normalize()
136 return FilePath(path).normalize(); in normalize()
139 std::string FilePath::getBaseName (void) const in getBaseName()
146 std::string FilePath::getDirName (void) const in getDirName()
153 return FilePath(components).getPath(); in getDirName()
161 std::string FilePath::getFileExtension (void) const in getFileExtension()
171 bool FilePath::exists (void) const in exists()
173 FilePath normPath = FilePath::normalize(*this); in exists()
179 FilePath::Type FilePath::getType (void) const in getType()
181 FilePath normPath = FilePath::normalize(*this); in getType()
197 bool FilePath::beginsWithDrive (void) const in beginsWithDrive()
209 bool FilePath::isAbsolutePath (void) const in isAbsolutePath()
216 DE_TEST_ASSERT(!FilePath(".").isAbsolutePath()); in FilePath_selfTest()
217 DE_TEST_ASSERT(!FilePath("..\\foo").isAbsolutePath()); in FilePath_selfTest()
218 DE_TEST_ASSERT(!FilePath("foo").isAbsolutePath()); in FilePath_selfTest()
219 DE_TEST_ASSERT(FilePath("\\foo/bar").isAbsolutePath()); in FilePath_selfTest()
220 DE_TEST_ASSERT(FilePath("/foo").isAbsolutePath()); in FilePath_selfTest()
221 DE_TEST_ASSERT(FilePath("\\").isAbsolutePath()); in FilePath_selfTest()
222 DE_TEST_ASSERT(FilePath("\\\\net\\loc").isAbsolutePath()); in FilePath_selfTest()
223 DE_TEST_ASSERT(FilePath("C:\\file.txt").isAbsolutePath()); in FilePath_selfTest()
224 DE_TEST_ASSERT(FilePath("c:/file.txt").isAbsolutePath()); in FilePath_selfTest()
226 DE_TEST_ASSERT(string(".") == FilePath(".//.").normalize().getPath()); in FilePath_selfTest()
227 DE_TEST_ASSERT(string(".") == FilePath(".").normalize().getPath()); in FilePath_selfTest()
228 …DE_TEST_ASSERT((string("..") + FilePath::separator + "test") == FilePath("foo/../bar/../../test").… in FilePath_selfTest()
229 …DE_TEST_ASSERT((FilePath::separator + "foo" + FilePath::separator + "foo.txt") == FilePath("/foo\\… in FilePath_selfTest()
230 …DE_TEST_ASSERT((string("c:") + FilePath::separator + "foo" + FilePath::separator + "foo.txt") == F… in FilePath_selfTest()
231 …DE_TEST_ASSERT((FilePath::separator + FilePath::separator + "foo" + FilePath::separator + "foo.txt… in FilePath_selfTest()
233 DE_TEST_ASSERT(FilePath("foo/bar" ).getBaseName() == "bar"); in FilePath_selfTest()
234 DE_TEST_ASSERT(FilePath("foo/bar/" ).getBaseName() == "bar"); in FilePath_selfTest()
235 DE_TEST_ASSERT(FilePath("foo\\bar" ).getBaseName() == "bar"); in FilePath_selfTest()
236 DE_TEST_ASSERT(FilePath("foo\\bar\\" ).getBaseName() == "bar"); in FilePath_selfTest()
237 DE_TEST_ASSERT(FilePath("foo/bar" ).getDirName() == "foo"); in FilePath_selfTest()
238 DE_TEST_ASSERT(FilePath("foo/bar/" ).getDirName() == "foo"); in FilePath_selfTest()
239 DE_TEST_ASSERT(FilePath("foo\\bar" ).getDirName() == "foo"); in FilePath_selfTest()
240 DE_TEST_ASSERT(FilePath("foo\\bar\\" ).getDirName() == "foo"); in FilePath_selfTest()
241 …DE_TEST_ASSERT(FilePath("/foo/bar/baz" ).getDirName() == FilePath::separator + "foo" + FilePath::s… in FilePath_selfTest()
259 FilePath dirPath = FilePath::normalize(path); in createDirectory()
260 FilePath parentPath (dirPath.getDirName()); in createDirectory()
266 else if (parentPath.getType() != FilePath::TYPE_DIRECTORY) in createDirectory()
275 FilePath curPath (path); in createDirectoryAndParents()
286 curPath = FilePath(parent); in createDirectoryAndParents()