29 Commits
Author SHA1 Message Date
Danny Greenstein 64a428f622 header only build option (#54)
* 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
2026-02-22 15:30:28 -08:00
Danny Greenstein 76a2024e13 Merge pull request #30 from niclasr/removestarfix
Add removeprefix and removesuffix to pystring
2023-07-22 19:37:05 -07:00
Larry Gritz cce54a1bcb Revise license formatting to match other modern projects. (#33)
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.
2022-06-08 21:51:45 -07:00
Niclas Rosenvik 5a0840a737 Add removeprefix and removesuffix to pystring
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.
2022-03-04 13:21:02 +01:00
Daniel Greenstein 9bfc0b94ec more efficient comparison with the colon string 2020-02-04 06:19:00 +00:00
Daniel Greenstein b9b2a2eb46 declaring global string constants for performance improvement 2020-02-04 05:32:18 +00:00
Daniel Greenstein 8c0f1738fc accepting fix proposed in issue #20 - for deadlock in path split when the path ends in a double slash 2019-03-04 02:20:11 +00:00
Jeremy Selan c2de99deb4 fix replace on empty strings 2012-10-16 14:31:17 -07:00
Jeremy Selan f38e93591b fix rsplit for non-space characters 2012-10-16 14:30:43 -07:00
Jeremy Selan 9dc73e8533 switch ssize_t -> Py_ssize_t for windows friendliness 2012-04-13 10:19:29 -07:00
Jeremy Selan ae50dda1ea exposed all os::path posix vs. nt varients 2012-04-10 17:05:23 -07:00
Jeremy Selan a5c3cfa274 do_strip windows bugfix
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.
2012-04-10 16:29:12 -07:00
Jeremy Selan 6c7eadc6c2 added os::path::abspath 2011-10-25 10:52:49 -07:00
Jeremy Selan 1080f1a199 os::path::join : added addl vector signature for joining >2 dir paths 2011-06-21 13:39:11 -07:00
Jeremy Selan 235bcf5ddf windows #define belongs in .cpp, not .h 2011-06-20 18:51:38 -07:00
Jeremy Selan fef753074e bugfix : find/rfind dont return bad valid results when start/end points smaller
than the seach string are specified.

Addressed github #7
2011-06-20 18:44:37 -07:00
Jeremy Selan aa52269ea2 added os.path functionality (limited subset)
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.
2011-06-20 16:53:56 -07:00
Jeremy Selan 0f4ab0dd3f bugfix: startswith / endswith does not overflow when suffix size > str size
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
2011-06-20 15:15:13 -07:00
Jeremy Selan 38b83f0373 bugfix: pystring::translate works when using both table + deletechars
Fixed bug in translate, documented in github issue #3, and previously at
http://code.google.com/p/pystring/issues/detail?id=4
2011-06-20 13:41:32 -07:00
Jeremy Selan af3cdaaa7c added pystring::mul
Add the __mul__ function, the string multiplication operator.
2011-06-20 12:00:38 -07:00
Jeremy Selan 1076a670f2 misc compilation warning fixes
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.
2011-06-20 11:52:45 -07:00
Blair Zajac 1bae479a99 remove the 'svn:executable' property on non-executable files
git-svn-id: http://pystring.googlecode.com/svn/trunk@18 e90ac086-db91-11dd-a3d5-f9b94b98161c
2010-01-29 05:02:20 +00:00
Blair Zajac b195993d53 trim trailing whitespace
git-svn-id: http://pystring.googlecode.com/svn/trunk@16 e90ac086-db91-11dd-a3d5-f9b94b98161c
2010-01-29 04:35:57 +00:00
Steve LaVietes 2ef1c09627 -updated license strings
git-svn-id: http://pystring.googlecode.com/svn/trunk@15 e90ac086-db91-11dd-a3d5-f9b94b98161c
2010-01-26 02:00:33 +00:00
Pete Shinners 59c7e44611 add partition and rpartition
git-svn-id: http://pystring.googlecode.com/svn/trunk@11 e90ac086-db91-11dd-a3d5-f9b94b98161c
2009-08-07 05:29:36 +00:00
Pete Shinners a4d4d59589 commit patch for issue #1 from dsevilla
git-svn-id: http://pystring.googlecode.com/svn/trunk@10 e90ac086-db91-11dd-a3d5-f9b94b98161c
2009-08-07 04:40:30 +00:00
Pete Shinners cf5c8cf10b cleanup rsplit corner case
git-svn-id: http://pystring.googlecode.com/svn/trunk@4 e90ac086-db91-11dd-a3d5-f9b94b98161c
2009-01-07 07:32:22 +00:00
Pete Shinners e86429c544 add rsplit function
git-svn-id: http://pystring.googlecode.com/svn/trunk@3 e90ac086-db91-11dd-a3d5-f9b94b98161c
2009-01-07 07:24:47 +00:00
Steve LaVietes 51b608b439 -initial check-in of public snapshot
git-svn-id: http://pystring.googlecode.com/svn/trunk@2 e90ac086-db91-11dd-a3d5-f9b94b98161c
2009-01-06 01:45:04 +00:00