139 const char* c_str()
const;
164 bool empty()
const {
return m_len == 0; }
171 throw(std::out_of_range(
"OpenImageIO::string_view::at"));
175 const charT&
back()
const {
return m_chars[m_len - 1]; }
198 if (
n == npos || pos +
n >
size())
205 return cmp != 0 ? cmp :
int(m_len - x.m_len);
222 const_iterator i = std::search(this->cbegin() + pos, this->cend(),
224 return i == this->cend() ? npos :
std::distance(this->cbegin(), i);
232 const_iterator i = std::find_if (this->cbegin()+pos, this->cend(),
234 return i == this->cend() ? npos :
std::distance (this->cbegin(), i);
245 return i == e ? npos : (reverse_distance(this->crbegin(),i) - s.
size() + 1);
256 return i == e ? npos : reverse_distance (this->crbegin(),i);
266 const_iterator i = std::find_first_of (this->cbegin()+pos, this->cend(),
268 return i == this->cend() ? npos :
std::distance (this->cbegin(), i);
274 size_t off =
size()-pos;
277 return i == this->crend() ? npos : reverse_distance (this->crbegin(), i);
283 const_iterator i = find_not_of (this->cbegin()+pos, this->cend(), s);
284 return i == this->cend() ? npos :
std::distance (this->cbegin(), i);
290 for (
const_iterator i = this->cbegin()+pos; i != this->cend(); ++i)
291 if (! traits::eq (c, *i))
299 size_t off =
size()-pos;
301 return i == this->crend() ? npos : reverse_distance (this->crbegin(), i);
307 size_t off =
size()-pos;
309 if (! traits::eq (c, *i))
310 return reverse_distance (this->crbegin(), i);
315 const charT* m_chars;
318 void init(
const charT* chars,
size_t len)
324 template<
typename r_iter>
325 size_type reverse_distance(r_iter
first, r_iter last)
const
330 template<
typename iter>
333 for (; first != last; ++
first)
341 traits_eq (charT ch) : ch(ch) {}
342 bool operator () (charT
val)
const {
return traits::eq (ch, val); }
std::char_traits< charT > traits
std::reverse_iterator< const_iterator > const_reverse_iterator
size_type rfind(charT c, size_t pos=npos) const
const charT * const_pointer
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
const_iterator cend() const
ptrdiff_t difference_type
GLuint const GLfloat * val
const charT & back() const
size_type find(string_view s, size_t pos=0) const
string_view()
Default ctr.
bool OIIO_API ends_with(string_view a, string_view b)
Does 'a' end with the string 'b', with a case-sensitive comparison?
const_reverse_iterator rbegin() const
const_iterator cbegin() const
bool operator>=(string_view x, string_view y)
size_type find_first_of(string_view s, size_t pos=0) const
size_type find_first_not_of(charT c, size_t pos=0) const
const charT * data() const
size_type find_first_not_of(string_view s, size_t pos=0) const
const charT & const_reference
size_type find(charT c, size_t pos=0) const
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
const_iterator end() const
const_pointer const_iterator
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLint GLsizei const void * data
size_type find_first_of(charT c, size_t pos=0) const
void remove_prefix(size_type n)
basic_string_view< char > string_view
std::ostream & operator<<(std::ostream &out, const string_view &str)
bool operator<=(string_view x, string_view y)
GLsizei GLsizei GLfloat distance
const_iterator begin() const
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
string_view(const std::string &str)
Construct from std::string.
PUGI__NS_END PUGI__NS_BEGIN PUGI__FN bool starts_with(const char_t *string, const char_t *pattern)
const_reverse_iterator reverse_iterator
GLdouble GLdouble GLdouble b
const charT & front() const
GLsizei const GLchar *const * string
const_reverse_iterator rend() const
string_view(const charT *chars, size_t len)
Construct from char* and length.
size_type find_last_of(string_view s, size_t pos=npos) const
string_view(const string_view ©)
Copy ctr.
const_reverse_iterator crbegin() const
bool operator>(string_view x, string_view y)
FMT_CONSTEXPR bool find(Ptr first, Ptr last, T value, Ptr &out)
int compare(string_view x) const
OIIO_API bool copy(string_view from, string_view to, std::string &err)
string_view substr(size_type pos, size_type n=npos) const
size_type find_last_of(charT c, size_t pos=npos) const
size_type rfind(string_view s, size_t pos=npos) const
size_type find_last_not_of(charT c, size_t pos=npos) const
string_view(const charT *chars)
Construct from char*, use strlen to determine length.
#define OIIO_NAMESPACE_END
vint4 min(const vint4 &a, const vint4 &b)
string_view & operator=(const string_view ©)
const_reverse_iterator crend() const
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
const charT & at(size_t pos) const
size_type max_size() const
const charT & operator[](size_type pos) const
size_type find_last_not_of(string_view s, size_t pos=npos) const
bool operator<(string_view x, string_view y)
#define OIIO_NAMESPACE_BEGIN
void remove_suffix(size_type n)