Commit graph

13 commits

Author SHA1 Message Date
Wolfgang Lux
e3caba204b Fix a serious misunderstanding of the icu string access API: The value
of nativeIndexingLimit must not exceed the length of the current chunk.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40333 72102866-910b-0410-8b05-ffd578937521
2017-02-11 14:24:58 +00:00
Richard Frith-MacDonald
d05eee4fda Change incorrect use of unsigned integers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39977 72102866-910b-0410-8b05-ffd578937521
2016-07-12 08:18:35 +00:00
Wolfgang Lux
fc436a1ea4 Fix unsigned comparison to properly detect integer underflows in
UTextNSStringAccess.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39976 72102866-910b-0410-8b05-ffd578937521
2016-07-12 07:31:22 +00:00
Richard Frith-MacDonald
197fdeaecb Optimisation for ICU access to immutable NSString objects ... we don't need to
call -length every time because we can keep the length in the UText state.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39956 72102866-910b-0410-8b05-ffd578937521
2016-07-01 15:22:02 +00:00
Wolfgang Lux
d725240fbd Make use of local variables that have been assigned already.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39955 72102866-910b-0410-8b05-ffd578937521
2016-07-01 12:33:11 +00:00
Richard Frith-MacDonald
670d202b1a ICU string access rewrite
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39951 72102866-910b-0410-8b05-ffd578937521
2016-06-30 14:21:32 +00:00
Richard Frith-MacDonald
60885954c6 Recommit tested changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32075 72102866-910b-0410-8b05-ffd578937521
2011-02-11 14:31:25 +00:00
Richard Frith-MacDonald
336c7bf021 Revert back to working code!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32072 72102866-910b-0410-8b05-ffd578937521
2011-02-11 13:53:54 +00:00
Richard Frith-MacDonald
0870dec426 leak fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32063 72102866-910b-0410-8b05-ffd578937521
2011-02-11 12:25:20 +00:00
Richard Frith-MacDonald
47fdf3d48d get closer to coding standards
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31743 72102866-910b-0410-8b05-ffd578937521
2010-12-16 10:59:50 +00:00
Richard Frith-MacDonald
62de5b485f mostly fixups for ICU
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31742 72102866-910b-0410-8b05-ffd578937521
2010-12-16 10:09:43 +00:00
David Chisnall
a5335c34fb Added implementation of NSRegularExpression, from iOS 4 Foundation.
This class is a thin wrapper around libicu regular expressions, so if we don't
have libicu we simply don't compile it at all.  This will give people a linker
failure, rather than a nonfunctional class if they try to use GNUstep without
ICU with code that requires it.

The Apple documentation says that this class has a primitive method that takes
a block as an argument and that this method is called by others, so subclasses
can replace that block method without touching the convenience methods.  We
mimic this behaviour when compiling with block, but when compiling without them
it's a problem.  The current code contains some ugly hacks that will work in
normal usage but break with subclassing when not compiling with blocks.

This commit also includes a partial implementation of NSTextCheckingResult,
implementing the subset of its functionality required for NSRegularExpression
to work.

It also includes numerous fixes to GSICUString.  This is heavily used by
NSRegularExpression, to avoid copying strings when mapping between UText for
libicu and NSString for GNUstep.


Note: I don't have a copy of iOS anywhere to test this against, so it's
entirely possible that there are significant discrepancies between this
implementation of NSRegularExpression and the iOS version.  This version should
function exactly as the iOS one is described as functioning, but I think we've
all seen that Apple documentation refers more to hopes than facts.  Any testing
that someone who does have an ip{hone,od,ad} can do is very welcome.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31635 72102866-910b-0410-8b05-ffd578937521
2010-11-19 22:06:18 +00:00
David Chisnall
f8b8dc5e59 Added libicu UText <-> NSString wrappers. These allow NSString objects to be used as the underlying storage for UText structures, and vice versa. Not yet used for anything, and therefore not connected to the build. These will be used by NSRegularExpression and by some stuff in CoreText.
This avoids the round-trip though C strings that CFLite seems to like using whenever using any libicu functions.  Converting between NSString and UText is now trivial to do and the implementation is O(1).

Documentation in the headers.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31631 72102866-910b-0410-8b05-ffd578937521
2010-11-18 22:52:36 +00:00