Commit graph

7993 commits

Author SHA1 Message Date
Frederik Seiffert
b549dbbaec NSLocale improvements
Use "instancetype" for instance-returning methods. Fix method signature of -displayNameForKey:value:.
2020-05-07 15:30:36 +02:00
Richard Frith-Macdonald
6fc9449241 Reorganise to make the separation of the two parsers clearer. NSXMLParser is the sloppy parser and can be selected using the dummy subclass GSSloppyXMLParser while, if we have libxml2, we can specifically select the strict parser using the GSStrictXMLParser class. 2020-05-06 15:24:04 +01:00
rfm
ca2abf51f7
Merge pull request #130 from triplef/add-nsxmlparser-stream-support
Implement -[NSXMLParser initWithStream:].
2020-05-06 14:08:39 +01:00
Fred Kiefer
0b4f3b382a
Merge pull request #126 from alotorev/bugfix/NSURLComponents
Bugfix/nsurl components
2020-05-06 13:09:35 +02:00
Gregory John Casamento
e2ce929761 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch 2020-05-06 05:04:45 -04:00
Frederik Seiffert
5dfda50d82 Implement -[NSXMLParser initWithStream:]. 2020-05-05 19:41:22 +02:00
Frederik Seiffert
547983738a Add NSInputStream support for reading Android assets from main bundle. 2020-05-05 15:42:10 +02:00
Richard Frith-Macdonald
dcfe2a2ce3 Fix -[NSCharacterSet invertedSet] to work by calling -invert on a mutable copy 2020-05-05 09:51:34 +01:00
Gregory John Casamento
76fac00cd2 Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch 2020-05-04 05:50:58 -04:00
Riccardo Mottola
bfcc2db53c In changeFileAttributes implement setting of creation date also for Unix, which needs to be done before setting the modification date. Also, implement reading the creation (birth time) date if a supported method was detected. 2020-05-04 10:17:25 +02:00
alotorev
4aa11f3e48 Improvements suggested by Fred Kiefer for the current pull request 2020-05-04 10:55:41 +03:00
alotorev
2a547271ad OSX like behaviour for NSURLQueryItem initialisers 2020-05-04 02:27:26 +03:00
alotorev
ce1c03f6da Fixed bugs leading to leaks, no autorelease in NSURLComponents factory methods. 2020-05-04 02:00:53 +03:00
alotorev
ec62905dd6 Fixed initialization NSURLComponents with NSURL, should treat a query from NSURL as a percent-encoded string. 2020-05-04 01:58:54 +03:00
niwatako
6869df9a50 Fix loss of buffer in NSJSONSerialization.
The first time bufferSize is extended, number loses the previously parsed characters.
After malloc the number, copy the numberBuffer to the number.
2020-05-01 23:51:55 +09:00
Riccardo Mottola
dfb4fc1976 fix log info 2020-05-01 02:06:00 +02:00
Riccardo Mottola
21c79c3500 Use utimensat() to set file modification date, if available. 2020-05-01 02:03:25 +02:00
Riccardo
e23ab3b394
Merge pull request #123 from gnustep/master
keep up with master
2020-04-30 11:14:10 +02:00
Richard Frith-Macdonald
0aeaee68da Fixup -stringByAddingPercentEncodingWithAllowedCharacters: to ignore membership
of the supplied set if the character is not in the ASCII range.
2020-04-27 20:25:24 +01:00
Richard Frith-Macdonald
9eb0fd4e1a Fix typo spotted by 'alotrev' 2020-04-27 09:14:36 +01:00
fredkiefer
a48694941c Add newer features for NSDateComponents and
started to clean up NSCalendar implementation.
2020-04-26 21:13:22 +02:00
fredkiefer
4fe6cb20a1 Started to rewrite NSCalendar to handle more components correctly. 2020-04-26 00:32:49 +02:00
fredkiefer
82e9ddc21f Add missing NSDateComponents methods. 2020-04-25 22:19:20 +02:00
Gregory John Casamento
082f87fbc3 Start implementing some secure coding methods. 2020-04-24 03:59:17 -04:00
Richard Frith-Macdonald
a9767cdff7 Override -hash and -isEqual: so that notifications with the name name, object, and userInfo are considered equal. This is the OSX behavior. 2020-04-21 09:16:53 +01:00
Richard Frith-Macdonald
05f442de8b Fix for NSURLResponse does not allow for multiple Set-Cookie headers in the same response #85 ... combine multiple header values as a comma separated list. 2020-04-16 23:04:37 +01:00
Richard Frith-Macdonald
6d714c8ee1 Fix for Deadlock in NSOperationQueue #49: If an exception occurs when trying to detach thread, catch it and log it so that locking is not broken by the exception breaking out of the lock protected region. 2020-04-16 22:48:25 +01:00
Richard Frith-Macdonald
6ee0cfff00 Add testcase for multiple clookies in a header. Fix error parsing a literal
string (writing nul terminator to read only memory)
2020-04-16 20:19:53 +01:00
Richard Frith-Macdonald
3d1e84f6fe rewrite code for separating individual cookies from a comma separated header so
it better matches what OSX does (and is hopefully a bit simpler)/
2020-04-16 19:39:32 +01:00
Richard Frith-Macdonald
132729e6e0 Add casts to avoid compiler warnings bout type of method 2020-04-15 10:40:41 +01:00
Richard Frith-Macdonald
09e9354f08 Fully type method implementatyion pointers. 2020-04-15 10:31:55 +01:00
Richard Frith-Macdonald
53f5957030 When building outside GNUstep (additions for apple), include the runtime
declarations and fix error in casting self.
2020-04-14 17:18:24 +01:00
Richard Frith-Macdonald
7829ab86b5 Fix line somehow missed from ast commit 2020-04-14 08:26:07 +01:00
Richard Frith-Macdonald
47ce8d3da7 Remove custom code for percent escaping and replace it with standard code using
custom charactersets.
2020-04-13 10:05:57 +01:00
Richard Frith-Macdonald
ccb8594bc0 Fix [NSURLProtocol -initWithRequest:cachedResponse:client:] to retain the client (up until the last message is sent to it) as OSX does. 2020-04-13 08:53:02 +01:00
Richard Frith-Macdonald
df1b6dd6d5 Characterset memory usage and code organisation consistency improvements. 2020-04-12 12:28:07 +01:00
Riccardo Mottola
ce313e1384 Implement read and set of File Creation Date attribute on Windows. 2020-04-09 23:43:41 +02:00
Frederik Seiffert
cc56c9cc97 Fixed NSOperation completion block memory mgmt. 2020-04-09 09:24:43 +02:00
Richard Frith-Macdonald
882b1419f5 remove redundant/repeated line 2020-04-05 10:27:02 +01:00
Richard Frith-Macdonald
ebaf23e295 Fix boundary error removing percent escapes 2020-04-05 10:26:28 +01:00
Fred Kiefer
adb67ee405
Merge pull request #118 from gnustep/fix-nsurlcomponents
fixups for setting/getting nil/empty query string values
2020-04-05 09:06:24 +02:00
Richard Frith-Macdonald
2a24e8d080 fixups for setting/getting nil/empty query string values 2020-04-04 22:37:40 +01:00
Gregory Casamento
a7867718b0
Merge pull request #115 from gnustep/fix-nsurlcomponents
Merging since all outstanding bugs appear to have been addressed.
2020-04-04 15:55:00 -04:00
fredkiefer
b0c763de36 Build the string instead of the URL.
Build the URL on the fly.
2020-04-04 20:33:55 +02:00
Richard Frith-Macdonald
ac45beb4c1 fix error in refactoring query (storing name twice rather than name/value) 2020-04-04 17:32:27 +01:00
Gregory John Casamento
cf13a7c21b Merge branch 'fix-nsurlcomponents' of github.com:gnustep/libs-base into fix-nsurlcomponents 2020-04-04 12:15:24 -04:00
Gregory John Casamento
213344d862 Add tests and modifications to pass them 2020-04-04 12:15:17 -04:00
Richard Frith-Macdonald
8eff23e780 Rewrite query handling code to try to mimic OSX documentation with regards to
the differences between setting nil/empty query strings/items and also in the
handling of query items with nothing before the '=', nothing after the '=',
and the case where there is no '=' character (also the totally empty case
where the query string contains a double ampersand (&&) sequence).
2020-04-04 15:13:14 +01:00
Gregory John Casamento
86276f0c7f Fix issue with scheme 2020-04-04 09:54:42 -04:00
Gregory John Casamento
564f61d572 Add tests for NSURLComponents 2020-04-04 09:44:22 -04:00
Richard Frith-Macdonald
4ffce48b04 I suggest when we regenerate we build the URL by appending to a mutable string
sas this would be hugely more efficient.
2020-04-04 14:22:25 +01:00
fredkiefer
d05b799740 Restore caching of URL.
Rewrite URL building to get the ranges correct.
Build URL with escaped components.
Build query from percentEncodedQueryItems.
2020-04-04 13:36:51 +02:00
Gregory John Casamento
ca6e48910a Minor fix to remove/add percent encoding to name portion of query item 2020-04-04 07:04:06 -04:00
Gregory John Casamento
5f1541d154 Always regenerate when we call [NSURLComponents URL] otherwise subsequent calls will return nil 2020-04-04 06:48:02 -04:00
Gregory John Casamento
b71f65f478 Fixes for FIXME's 2020-04-04 06:38:19 -04:00
Gregory John Casamento
d5c163397f Remove explicit reference to _url. Always regenerate when needed. 2020-04-03 17:39:35 -04:00
Gregory John Casamento
2d135069fb Remove query 2020-04-03 15:48:27 -04:00
fredkiefer
0bc1052bd6 Fix typo in last commit. 2020-04-03 18:37:55 +02:00
fredkiefer
c170c8c1e7 Correct more issues and flag the remaining ones with "FIXME". 2020-04-03 18:15:07 +02:00
fredkiefer
181346c568 Get too compile with gcc.
Address some pull request comments.
2020-04-03 17:53:34 +02:00
Gregory John Casamento
14274bffd2 Fix issues pointed out by fred k. 2020-04-02 06:08:17 -04:00
Gregory John Casamento
fd354f4167 Changes to fix issues pointed out by Fred and RFM 2020-04-01 10:08:44 -04:00
Gregory John Casamento
bc614d4bd8 Regenerate in one place. 2020-04-01 08:48:51 -04:00
Gregory John Casamento
b594d047c1 Fix issues with regeneration. 2020-04-01 08:46:45 -04:00
Gregory John Casamento
4dff7a76a9 Refactor regeneration of URL. 2020-04-01 08:00:26 -04:00
Gregory John Casamento
f6940daac9 Add code to allow percent coded set/get methods to reflect the values set by the non-encoded versions 2020-03-31 05:07:38 -04:00
Gregory John Casamento
2fb63480be Remove slash 2020-03-30 09:24:18 -04:00
Gregory John Casamento
7c52cd9f72 Added method to handle query encoding. Theoretically URLQueryAllowedCharacter set should cover this. I'm wondering why I had to do this to get the correct result. 2020-03-30 08:53:42 -04:00
Richard Frith-Macdonald
bf440e83fa fixup indentation etc to conform to coding stype 2020-03-30 13:35:35 +01:00
Gregory John Casamento
31e7bbb7e6 Get rid of trailing whitespace. 2020-03-30 06:58:10 -04:00
Gregory John Casamento
a92491268b URL percent escape query items. 2020-03-30 06:52:34 -04:00
Gregory John Casamento
7fc9033aa8 Fix for case where password is not specified. Conformation to RFC1738. 2020-03-30 04:58:51 -04:00
Gregory John Casamento
7e75310531 Build query items, fix rendering of URL when user/password are not specified together. 2020-03-30 04:37:36 -04:00
Gregory John Casamento
5db21d0a83 Merge branch 'master' into fix-nsurlcomponents 2020-03-29 11:35:59 -04:00
rfm
da6be9daac
Merge branch 'master' into fix-pthread-setname 2020-03-29 11:33:39 +01:00
rfm
73baca1056
Merge branch 'master' into fix-nsurlresponse 2020-03-29 11:30:18 +01:00
rfm
81d70b37c8
Merge branch 'master' into numerical_locale 2020-03-29 11:26:40 +01:00
Gregory John Casamento
a785456d5f Copy URL 2020-03-28 03:13:36 -04:00
Gregory John Casamento
bda473e9bd Remove set for percent escapes in setURL: 2020-03-27 07:06:20 -04:00
Gregory John Casamento
746d3ea8ae Remove infinite recursion 2020-03-27 06:18:11 -04:00
Gregory John Casamento
5bf97288d0 remove variable 2020-03-27 05:58:10 -04:00
Gregory John Casamento
6fb90273fe Update implementation 2020-03-27 05:51:07 -04:00
Gregory John Casamento
7019e849cc Add method to update url when any set method is called 2020-03-27 04:30:13 -04:00
Fred Kiefer
77468b0b9e
Merge branch 'master' into fix-nsurlresponse 2020-03-26 18:46:33 +01:00
Gregory John Casamento
56f0d5aa8b Merge branch 'fix-nsurlcomponents' of github.com:gnustep/libs-base into fix-nsurlcomponents 2020-03-26 09:28:53 -04:00
Frederik Seiffert
5f9982812e Added NSErrorDomain typedef. 2020-03-26 14:16:44 +01:00
Frederik Seiffert
8774e5f55d NSURLComponents fixes
- Moved NSURLComponents internal declaration to correct place.
- Added GS_DESTROY_INTERNAL() calls for NSURLComponents and NSURLQueryItem.
2020-03-23 14:46:45 +01:00
Frederik Seiffert
8e093a519e Added misssing GSInternal declaration for NSURLQueryItem. 2020-03-23 13:40:09 +01:00
Frederik Seiffert
a0779f4e62 Fixed internal ivar usage for NSURLQueryItem. 2020-03-23 11:56:20 +01:00
Frederik Seiffert
a3b8ea0937 Use pthread_setname_np result instead of errno.
Fixes setting thread name on platforms where errno is not set.
2020-03-17 14:49:02 +01:00
Gregory John Casamento
fdb8c95a17 Merge branch 'master' of github.com:gnustep/libs-base into fix-nsurlcomponents 2020-03-13 05:22:17 -04:00
fredkiefer
95abcbd694 * Source/NSURL.m: Fix compiler warnigns.
* Headers/Foundation/NSLocale.h,
* Source/NSLocale.m: Add a few convenience methods from MacOS 10.12.
2020-03-12 14:58:46 +01:00
Frederik Seiffert
5150ab1d5a Fixed parsing of NSURLResponse content type header. 2020-03-12 11:44:13 +01:00
Frederik Seiffert
3743e1d643 Added missing NSURLQueryItem implementation. 2020-03-11 10:55:10 +01:00
Richard Frith-Macdonald
4a7325b00e Merge branch 'master' of ssh://github.com/gnustep/libs-base
Conflicts:
	Source/GSAttributedString.m
2020-03-11 09:05:44 +00:00
Richard Frith-Macdonald
e4ea6672df Add comments to note that initial values are unused. 2020-03-11 09:01:39 +00:00
rfm
9ff3af1ead
Merge pull request #111 from triplef/fix-attributed-string-ranges
Fixed attributed string range initialization.
2020-03-11 08:58:37 +00:00
Frederik Seiffert
15610acb62 Fixed attributed string range initialization. 2020-03-10 18:09:44 +01:00
Frederik Seiffert
1e51ef1b1e Fixed NSURLComponents setURL: throwing exceptions.
This happened when setting an URL that didn't have all the different parts like fragment or query, as rangeOfString: throws for nil values.
2020-03-10 18:06:44 +01:00
fredkiefer
8794339073 * Source/NSString.m: Attempt to make calls to GSICUCollatorOpen()
more consistent and correct for ICU 65.
2020-03-07 23:36:30 +01:00
Mingye Wang
7df4ec1482 fixup! buf type (strtod commit) 2020-03-04 14:26:43 +08:00
Richard Frith-Macdonald
d1af1d0244 Fix for class lookup when using the 2.0 ABI 2020-02-24 10:23:22 +00:00
Mingye Wang
69b202274a NSPropertyList: use strtod to handle inf and nan
Apple's implementation seems to understand these things. We should too.
2020-02-20 12:07:04 +08:00
Mingye Wang
a76677623a plutil: use GS text for pretty print 2020-02-20 11:28:09 +08:00
Richard Frith-Macdonald
31f277d751 Fix to consider explicitly configured hosts to be probled for servers. Add -S 2020-02-17 15:30:21 +00:00
Richard Frith-Macdonald
2e07244f8e Updates to move towards ARC 2020-02-08 16:42:17 +00:00
Richard Frith-Macdonald
b91fab7665 Fix method types. Fix indentation/line-wrapping. Fix stubs to raise exception 2020-01-27 14:43:59 +00:00
fredkiefer
d1d9cd65a1 Handle case where scheme is missing from the URL. 2020-01-24 23:27:30 +01:00
fredkiefer
4d7da7ee80 Allow simple predicates on NSDate. 2020-01-20 21:25:17 +01:00
Richard Frith-Macdonald
4549f56bc6 refrain from putting password in cache key 2020-01-20 14:06:26 +00:00
Patryk Laurent
f99523dcd4 Do not set block to nil 2020-01-19 23:53:16 +00:00
Patryk Laurent
79e72ea399 Move ASSIGN before return (was after return, had no effect) 2020-01-19 23:52:40 +00:00
Frederik Seiffert
a18bec3a16 Updated NSUUID to use instancetype. 2020-01-13 16:27:12 +01:00
fredkiefer
88f5cc2444 Add support for NSDate constants in NSPredicate. 2020-01-12 20:56:09 +01:00
fredkiefer
36d00c7f00 Implement two missing KVO methods on NSArray. 2020-01-12 10:37:27 +01:00
Frederik Seiffert
5036cb4734 Fixed incorrect while loops for noreturn functions
Silences warnings "function declared 'noreturn' should not return [-Winvalid-noreturn]".
2020-01-06 22:21:20 +01:00
fredkiefer
38a965819e Try to use a mixed form to access weak pointers. 2019-12-15 14:18:00 +01:00
fredkiefer
d1cf30dd9f * Headers/GNUstepBase/GSIMap.h: Use GSI_MAP_NODE_IS_EMPTY macros
when checking in enumerator.
* Source/NSConcreteHashTable.m,
* Source/NSConcreteMapTable.m: Revert part of the weak pointer change.
2019-12-15 13:40:51 +01:00
Gregory John Casamento
753c907938 Fix address for FSF and License name in all headers in base 2019-12-09 18:36:00 -05:00
Fred Kiefer
01e7ea8372
Merge pull request #84 from gnustep/weak-table
Rework some of the weak handling for NS{Map,Hash}Table.

@Richard, feel free to revert this and to provide a cleaner solution. I am no expert here, but part of this code looks correct and part just like a workaround for a deeper problem.
2019-12-07 10:55:52 +01:00
Niels Grewe
c77f40f73c
Merge pull request #87 from gnustep/swift-corelibs-libdispatch
Fix runloop integration for libdispatch from swift
2019-12-06 23:05:38 +01:00
rmottola
cbad92f8a8 minor fix to get Windos compiling again 2019-12-05 11:07:40 +01:00
Niels Grewe
ecd2d85cb9
Fix runloop integration for libdispatch from swift 2019-11-28 19:12:13 +01:00
David Chisnall
6513da4d8c Reorder macros as per @fredkiefer's review comment. 2019-11-25 10:41:07 +00:00
David Chisnall
f957b21972 Rework some of the weak handling for NS{Map,Hash}Table.
The existing code was assuming that weak object pointers were safe to
read directly, without going via the read barrier, which is incorrect.
It was also attempting to retain the result in some places.  The new
code is hopefully somewhat more correct.
2019-11-25 10:40:16 +00:00
Gregory Casamento
69f7130fa7
Merge pull request #81 from triplef/android-temp-dir
Added support for temp and caches dir on Android.
2019-11-25 04:09:56 -05:00
Frederik Seiffert
0eedef5080 Added NSException symbolication support using libunwind.
This is used when backtrace() is unavailable.
2019-11-18 10:47:47 +01:00
Frederik Seiffert
a9641e6818 Added support for temp and caches dir on Android. 2019-11-15 09:04:58 +01:00
fredkiefer
1915415b48 * Headers/Foundation/NSXPCConnection.h,
* Source/NSXPCConnection.m: Fix broken compilation on gcc.
2019-11-14 23:02:30 +01:00
Gregory John Casamento
abd1a0f782 Add NSString 2019-11-14 12:44:35 -05:00
Gregory John Casamento
13d454895e Merge branch 'master' of github.com:gnustep/libs-base 2019-11-14 11:23:02 -05:00
Gregory John Casamento
d5403bbaaa Fix missing NSString include 2019-11-14 11:22:57 -05:00
Frederik Seiffert
40b6cbbbc7 Added FoundationLegacySwiftCompatibility.h to Foundation headers 2019-11-14 15:11:38 +01:00
Gregory John Casamento
fe22c1f998 Add final files 2019-11-13 04:17:00 -05:00
Gregory John Casamento
2c1be24ac3 Add skeletons of NSXPCConnection. 2019-11-13 02:31:09 -05:00
Gregory John Casamento
d33e0f2605 NSItemProvider skeleton implementation. 2019-11-12 22:59:47 -05:00
Gregory John Casamento
3d9598e2a0 Make NSExtensionRequest conform to protocol 2019-11-10 23:02:59 -05:00
Gregory John Casamento
73bcd161cc Add files 2019-11-10 18:43:12 -05:00
Gregory John Casamento
6b6a11aaa7 Skeleton of extension context 2019-11-10 16:48:48 -05:00
Gregory John Casamento
3d77109fb6 Skeleton implementation of coding 2019-11-09 06:39:15 -05:00
Gregory John Casamento
027cb381bb Adding logic to handle options. 2019-11-09 06:34:10 -05:00
Gregory John Casamento
6965067c3c implement spell out function 2019-11-08 07:01:59 -05:00
Gregory John Casamento
94719e87ca Initial part of formatting 2019-11-08 04:30:17 -05:00
Gregory John Casamento
996b40ad34 Implement other formatting methods in terms of the main one 2019-11-07 03:55:31 -05:00
Gregory John Casamento
d23af67ea7 Skeletons 2019-11-06 19:16:23 -05:00
Gregory John Casamento
d7b854a0d2 Add NSDateComponentsFormatter 2019-11-06 19:04:41 -05:00
Gregory John Casamento
ba3d60c5ab Update stringForObjectValue: 2019-11-06 00:19:23 -05:00
Gregory John Casamento
f230b901a0 Merge branch 'master' of github.com:gnustep/libs-base 2019-11-05 20:30:52 -05:00
Gregory John Casamento
245e3927df Merge branch 'NSLinguisticTagger_branch' 2019-11-05 20:30:36 -05:00
Gregory John Casamento
4a3de6cb47 Implement simple methods 2019-11-05 19:59:03 -05:00