* new header only build option
* removed extra semi colon
* remaing marcos in new header file with a PYSTRING prefix so that they don't clash with other definitions when used in different contexts
No change to the fact that this project is BSD-3-clause licensed.
But this slight rewording/reformatting:
* Brings the notices in line with the exact wording we use in other
projects such as OSL.
* Now will be correctly recognized by GitHub and other automated
license checkers as being EXACTLY the same as the canonical BSD
3-clause license.
This was approved by SPI legal.
Add removeprefix and removesuffix to pystring.
Python 3.9 added removeprefix and removesuffix
methods to Pythons string class. Add them to
pystring to match the interfaces.
switched to use ssize_t (signed) for internal counters, to match the python
source. (see Modules/stropmodule.c : do_strip)
This addresses a bug uncovered by Laszlo Sebo on Windows, when stripping an
empty string.
Exposed a limited set of function from os.path (most of those which rely on pur
string processing have been implemented). These have been added in an
architecture specific manner to match the python implementation. (I.e., join on
windows uses '\', and joing on linux uses '/'. The python 2.6 implementation
were used as reference, and for unit test validation.
The previous implementation of startswith / endswith would overflow when the
suffix size > str size, due to an issue with the __substrcmp(str, suffix, lower
) implementation. The updated fix was to re-implement both of these functions looking at the
python 2.7 source, which relies on the _string_tailmatch convenience function.
Addresses issue #2
This makes pystring compile without warnings on gcc44, when compiled using the da
-Wall flag. Most of the changes are issues related to the intermixing of size_type / int
types, where the updated version of the code attempts to do as few type changes
to the user arguments as possible. This code has been running cross-platform
in OpenColorIO for the last few months, and is well tested.