mirror of
https://github.com/boostorg/python.git
synced 2026-01-19 04:22:16 +00:00
Implement str::endswith()
This commit is contained in:
committed by
Stefan Seefeld
parent
bc2f77a3db
commit
03adaee6d2
16
src/str.cpp
16
src/str.cpp
@@ -162,6 +162,22 @@ bool str_base::endswith(object_cref suffix) const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool str_base::endswith(object_cref suffix, object_cref start) const
|
||||
{
|
||||
bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start).ptr());
|
||||
if (PyErr_Occurred())
|
||||
throw_error_already_set();
|
||||
return result;
|
||||
}
|
||||
|
||||
bool str_base::endswith(object_cref suffix, object_cref start, object_cref end) const
|
||||
{
|
||||
bool result = _BOOST_PYTHON_ASLONG(this->attr("endswith")(suffix,start,end).ptr());
|
||||
if (PyErr_Occurred())
|
||||
throw_error_already_set();
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 0)
|
||||
BOOST_PYTHON_DEFINE_STR_METHOD(expandtabs, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user