Lines Matching defs:StringType

43 typedef FilePath::StringType StringType;
54 StringType::size_type FindDriveLetter(const StringType& path) {
64 return StringType::npos;
68 bool EqualDriveLetterCaseInsensitive(const StringType& a,
69 const StringType& b) {
73 if (a_letter_pos == StringType::npos || b_letter_pos == StringType::npos)
76 StringType a_letter(a.substr(0, a_letter_pos + 1));
77 StringType b_letter(b.substr(0, b_letter_pos + 1));
81 StringType a_rest(a.substr(a_letter_pos + 1));
82 StringType b_rest(b.substr(b_letter_pos + 1));
87 bool IsPathAbsolute(const StringType& path) {
89 StringType::size_type letter = FindDriveLetter(path);
90 if (letter != StringType::npos) {
104 bool AreAllSeparators(const StringType& input) {
105 for (StringType::const_iterator it = input.begin();
121 StringType::size_type ExtensionSeparatorPosition(const StringType& path) {
124 return StringType::npos;
126 const StringType::size_type last_dot =
130 if (last_dot == StringType::npos || last_dot == 0U)
135 StringType extension(path, last_dot + 1);
146 const StringType::size_type penultimate_dot =
148 const StringType::size_type last_separator =
151 if (penultimate_dot != StringType::npos &&
152 (last_separator == StringType::npos ||
170 FilePath::FilePath(const StringType& path) : path_(path) {
208 void FilePath::GetComponents(std::vector<StringType>* components) const {
216 std::vector<StringType> ret_val;
235 StringType::size_type letter = FindDriveLetter(dir.value());
236 if (letter != StringType::npos) {
237 ret_val.push_back(StringType(dir.value(), 0, letter + 1));
240 *components = std::vector<StringType>(ret_val.rbegin(), ret_val.rend());
249 std::vector<StringType> parent_components;
250 std::vector<StringType> child_components;
258 std::vector<StringType>::const_iterator parent_comp =
260 std::vector<StringType>::const_iterator child_comp =
267 if ((FindDriveLetter(*parent_comp) != StringType::npos) &&
268 (FindDriveLetter(*child_comp) != StringType::npos)) {
303 StringType::size_type letter = FindDriveLetter(new_path.path_);
305 StringType::size_type last_separator =
306 new_path.path_.find_last_of(kSeparators, StringType::npos,
308 if (last_separator == StringType::npos) {
336 StringType::size_type letter = FindDriveLetter(new_path.path_);
337 if (letter != StringType::npos) {
343 StringType::size_type last_separator =
344 new_path.path_.find_last_of(kSeparators, StringType::npos,
346 if (last_separator != StringType::npos &&
354 StringType FilePath::Extension() const {
356 const StringType::size_type dot = ExtensionSeparatorPosition(base.path_);
357 if (dot == StringType::npos)
358 return StringType();
360 return base.path_.substr(dot, StringType::npos);
367 const StringType::size_type dot = ExtensionSeparatorPosition(path_);
368 if (dot == StringType::npos)
374 FilePath FilePath::InsertBeforeExtension(const StringType& suffix) const {
381 StringType base = BaseName().value();
391 StringType ext = Extension();
392 StringType ret = RemoveExtension().value();
408 FilePath FilePath::ReplaceExtension(const StringType& extension) const {
412 StringType base = BaseName().value();
424 if (extension.empty() || extension == StringType(1, kExtensionSeparator))
427 StringType str = no_ext.value();
434 bool FilePath::MatchesExtension(const StringType& extension) const {
437 StringType current_extension = Extension();
445 FilePath FilePath::Append(const StringType& component) const {
504 std::vector<StringType> components;
507 std::vector<StringType>::const_iterator it = components.begin();
509 const StringType& component = *it;
556 const StringType& path) {
568 StringType* path) {
594 int FilePath::CompareIgnoreCase(const StringType& string1,
595 const StringType& string2) {
599 StringType::const_iterator i1 = string1.begin();
600 StringType::const_iterator i2 = string2.begin();
601 StringType::const_iterator string1end = string1.end();
602 StringType::const_iterator string2end = string2.end();
1068 int FilePath::HFSFastUnicodeCompare(const StringType& string1,
1069 const StringType& string2) {
1092 StringType FilePath::GetHFSDecomposedForm(const StringType& string) {
1109 StringType result;
1125 int FilePath::CompareIgnoreCase(const StringType& string1,
1126 const StringType& string2) {
1134 StringType hfs1 = GetHFSDecomposedForm(string1);
1135 StringType hfs2 = GetHFSDecomposedForm(string2);
1168 int FilePath::CompareIgnoreCase(const StringType& string1,
1169 const StringType& string2) {
1187 StringType::size_type start = FindDriveLetter(path_) + 2;
1189 StringType::size_type last_stripped = StringType::npos;
1190 for (StringType::size_type pos = path_.length();
1205 StringType copy = path_;