fs/Traits: add Find()
This commit is contained in:
@@ -129,7 +129,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
gcc_pure
|
gcc_pure
|
||||||
bool HasNewline() const {
|
bool HasNewline() const {
|
||||||
return strchr(value, '\n') != nullptr;
|
return PathTraitsFS::Find(value, '\n') != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -101,6 +101,16 @@ struct PathTraitsFS {
|
|||||||
return char_traits::length(p);
|
return char_traits::length(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcc_pure gcc_nonnull_all
|
||||||
|
static const_pointer Find(const_pointer p, size_t n, value_type ch) {
|
||||||
|
return char_traits::find(p, n, ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
gcc_pure gcc_nonnull_all
|
||||||
|
static const_pointer Find(const_pointer p, value_type ch) {
|
||||||
|
return strchr(p, ch);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the "base" file name of the given native path.
|
* Determine the "base" file name of the given native path.
|
||||||
* The return value points inside the given string.
|
* The return value points inside the given string.
|
||||||
@@ -195,6 +205,16 @@ struct PathTraitsUTF8 {
|
|||||||
return char_traits::length(p);
|
return char_traits::length(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcc_pure gcc_nonnull_all
|
||||||
|
static const_pointer Find(const_pointer p, size_t n, value_type ch) {
|
||||||
|
return char_traits::find(p, n, ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
gcc_pure gcc_nonnull_all
|
||||||
|
static const_pointer Find(const_pointer p, value_type ch) {
|
||||||
|
return strchr(p, ch);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the "base" file name of the given UTF-8 path.
|
* Determine the "base" file name of the given UTF-8 path.
|
||||||
* The return value points inside the given string.
|
* The return value points inside the given string.
|
||||||
|
Reference in New Issue
Block a user