Lines Matching refs:string
39 using std::string;
45 const std::string FilePath::separator = "\\";
47 const std::string FilePath::separator = "/";
50 FilePath::FilePath (const std::vector<std::string>& components)
60 void FilePath::split (std::vector<std::string>& components) const
89 FilePath FilePath::join (const std::vector<std::string>& components)
96 std::vector<std::string> components;
97 std::vector<std::string> reverseNormalizedComponents;
108 const std::string& comp = components[ndx];
129 *this = join(std::vector<std::string>(reverseNormalizedComponents.rbegin(), reverseNormalizedComponents.rend()));
139 std::string FilePath::getBaseName (void) const
141 std::vector<std::string> components;
143 return !components.empty() ? components[components.size()-1] : std::string("");
146 std::string FilePath::getDirName (void) const
148 std::vector<std::string> components;
158 return std::string(".");
161 std::string FilePath::getFileExtension (void) const
163 std::string baseName = getBaseName();
165 if (dotPos == std::string::npos)
166 return std::string("");
226 DE_TEST_ASSERT(string(".") == FilePath(".//.").normalize().getPath());
227 DE_TEST_ASSERT(string(".") == FilePath(".").normalize().getPath());
228 DE_TEST_ASSERT((string("..") + FilePath::separator + "test") == FilePath("foo/../bar/../../test").normalize().getPath());
230 DE_TEST_ASSERT((string("c:") + FilePath::separator + "foo" + FilePath::separator + "foo.txt") == FilePath("c:/foo\\bar/..\\dir\\..\\foo.txt").normalize().getPath());
274 std::vector<std::string> createPaths;
284 std::string parent = curPath.getDirName();
290 for (std::vector<std::string>::const_reverse_iterator parentIter = createPaths.rbegin(); parentIter != createPaths.rend(); parentIter++)