Commit graph

14 commits

Author SHA1 Message Date
wlux
f7afd83ded Correct result of NSRegularExpression -rangeOfFirstMatchInString:...
When no match is found location must be set to NSNotFound.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34348 72102866-910b-0410-8b05-ffd578937521
2011-12-23 14:59:14 +00:00
wlux
42ffcb55bf Introduce NSRegularExpression support for libicu versions prior to 4.4,
which don't provide the UText interface to regular expressions.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34345 72102866-910b-0410-8b05-ffd578937521
2011-12-22 12:52:56 +00:00
theraven
157da23407 Fix the build with the pure non-fragile ABI by declaring macros before using them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33724 72102866-910b-0410-8b05-ffd578937521
2011-08-13 15:28:22 +00:00
theraven
f72d31cd68 Clean up NSRegularExpression, so that it compiles without warnings with or without ICU, but we don't pretend that we support things that we don't and silently return nonsense results to make debugging difficult for GNUstep users.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33688 72102866-910b-0410-8b05-ffd578937521
2011-08-03 12:04:27 +00:00
fredkiefer
dafc3301e5 Remove some of the compiler warnings on system without clang or ICU.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33680 72102866-910b-0410-8b05-ffd578937521
2011-08-02 08:33:33 +00:00
theraven
a76cd2adb3 I give up. No brain left.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33605 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:37:38 +00:00
theraven
d24eeb55ce Third try.
[NSException raise: GSNotEnoughCoffeeException];



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33604 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:34:08 +00:00
theraven
0d5d27b6a1 Add missing #import.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33603 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:27:04 +00:00
theraven
4a277ee9ac Stub for NSRegularExpression when a compatible version of ICU is not present.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33602 72102866-910b-0410-8b05-ffd578937521
2011-07-22 13:23:11 +00:00
rfm
09206b0e5b 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
rfm
ee053452a9 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
ericwa
a1bde310e3 Don't compile NSRegularExpression with ICU older than 4.4
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31702 72102866-910b-0410-8b05-ffd578937521
2010-12-02 19:12:24 +00:00
thebeing
ab12ea7243 Small rearrangements to make non-C99 compilers happy.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31637 72102866-910b-0410-8b05-ffd578937521
2010-11-19 22:29:04 +00:00
theraven
ddbaf75490 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