Revision: 28902
http://sourceforge.net/p/bibdesk/svn/28902
Author: hofman
Date: 2024-05-14 09:35:56 +0000 (Tue, 14 May 2024)
Log Message:
-----------
template keys to get string prefixes
Modified Paths:
--------------
trunk/bibdesk/BibDesk.help/Contents/Resources/en.lproj/bibdesk.texi
trunk/bibdesk/NSString_BDSKExtensions.h
trunk/bibdesk/NSString_BDSKExtensions.m
Modified: trunk/bibdesk/BibDesk.help/Contents/Resources/en.lproj/bibdesk.texi
===================================================================
--- trunk/bibdesk/BibDesk.help/Contents/Resources/en.lproj/bibdesk.texi
2024-05-14 09:14:58 UTC (rev 28901)
+++ trunk/bibdesk/BibDesk.help/Contents/Resources/en.lproj/bibdesk.texi
2024-05-14 09:35:56 UTC (rev 28902)
@@ -4538,7 +4538,13 @@
@item stringByTeXifyingString
@tab
@item stringByDeTeXifyingString
-@tab
+@tab
+@item oneCharacterPrefix
+@tab
+@item twoCharacterPrefix
+@tab
+@item threeCharacterPrefix
+@tab
@end multitable
@subheading Appending
Modified: trunk/bibdesk/NSString_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.h 2024-05-14 09:14:58 UTC (rev
28901)
+++ trunk/bibdesk/NSString_BDSKExtensions.h 2024-05-14 09:35:56 UTC (rev
28902)
@@ -469,6 +469,9 @@
@property (nonatomic, readonly) NSString
*stringByRemovingSurroundingWhitespaceAndNewlines;
@property (nonatomic, readonly) NSString
*stringByCollapsingWhitespaceAndNewlines;
@property (nonatomic, readonly) NSString
*stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines;
+@property (nonatomic, readonly) NSString *oneCharacterPrefix;
+@property (nonatomic, readonly) NSString *twoCharacterPrefix;
+@property (nonatomic, readonly) NSString *threeCharacterPrefix;
@property (nonatomic, readonly) NSString *fullyEncodeAsIURI;
@property (nonatomic, readonly) NSData *sha1Signature;
Modified: trunk/bibdesk/NSString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.m 2024-05-14 09:14:58 UTC (rev
28901)
+++ trunk/bibdesk/NSString_BDSKExtensions.m 2024-05-14 09:35:56 UTC (rev
28902)
@@ -1350,6 +1350,18 @@
return [self stringByCollapsingAndTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
}
+- (NSString *)oneCharacterPrefix {
+ return [self substringToIndex:MIN (1, [self length])];
+}
+
+- (NSString *)twoCharacterPrefix {
+ return [self substringToIndex:MIN (2, [self length])];
+}
+
+- (NSString *)threeCharacterPrefix {
+ return [self substringToIndex:MIN (3, [self length])];
+}
+
// This method is copied and modified from NSString-OFStringExtensions.m
- (NSString *)fullyEncodeAsIURI {
static const char hexDigits[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit