Revision: 29020
          http://sourceforge.net/p/bibdesk/svn/29020
Author:   hofman
Date:     2025-02-18 16:50:52 +0000 (Tue, 18 Feb 2025)
Log Message:
-----------
add nullability to string parser classes

Modified Paths:
--------------
    trunk/bibdesk/BDSKBibTeXParser.h
    trunk/bibdesk/BDSKDOIParser.h
    trunk/bibdesk/BDSKDublinCoreXMLParser.h
    trunk/bibdesk/BDSKJSTORParser.h
    trunk/bibdesk/BDSKMARCParser.h
    trunk/bibdesk/BDSKMODSParser.h
    trunk/bibdesk/BDSKPRISMParser.h
    trunk/bibdesk/BDSKPubMedParser.h
    trunk/bibdesk/BDSKPubMedXMLParser.h
    trunk/bibdesk/BDSKRISParser.h
    trunk/bibdesk/BDSKReferParser.h
    trunk/bibdesk/BDSKReferenceMinerParser.h
    trunk/bibdesk/BDSKSciFinderParser.h
    trunk/bibdesk/BDSKStringParser.h
    trunk/bibdesk/BDSKWebOfScienceParser.h

Modified: trunk/bibdesk/BDSKBibTeXParser.h
===================================================================
--- trunk/bibdesk/BDSKBibTeXParser.h    2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKBibTeXParser.h    2025-02-18 16:50:52 UTC (rev 29020)
@@ -38,6 +38,8 @@
 
 #import <Cocoa/Cocoa.h>
 
+NS_ASSUME_NONNULL_BEGIN
+
 @class BDSKMacroResolver, BibItem;
 
 @protocol BDSKOwner;
@@ -59,12 +61,12 @@
     @param      outError (description)
     @result     (description)
 */
-+ (NSArray *)itemsFromString:(NSString *)aString owner:(id<BDSKOwner>)anOwner 
error:(NSError **)outError;
++ (nullable NSArray *)itemsFromString:(NSString *)aString owner:(nullable 
id<BDSKOwner>)anOwner error:(NSError **)outError;
 
 + (NSArray *)itemsFromData:(NSData *)inData
-                    macros:(NSMapTable **)outMacros
+                    macros:(NSMapTable * _Nullable * _Nullable)outMacros
                   filePath:(NSString *)filePath
-                     owner:(id<BDSKOwner>)anOwner
+                     owner:(nullable id<BDSKOwner>)anOwner
                   encoding:(NSStringEncoding)parserEncoding
                      error:(NSError **)outError;
 
@@ -83,13 +85,13 @@
     @param      outError May be NULL.  If non-NULL and the item has partial 
data, will be filled.
     @result     (description)
 */
-+ (NSArray *)itemsFromData:(NSData *)inData
-                    macros:(NSMapTable **)outMacros
-              documentInfo:(NSDictionary **)outDocumentInfo
-                    groups:(NSDictionary **)outGroups
-               frontMatter:(NSString **)outFrontMatter
++ (nullable NSArray *)itemsFromData:(NSData *)inData
+                    macros:(NSMapTable * _Nullable * _Nullable)outMacros
+              documentInfo:(NSDictionary * _Nullable * 
_Nullable)outDocumentInfo
+                    groups:(NSDictionary * _Nullable * _Nullable)outGroups
+               frontMatter:(NSString * _Nullable * _Nullable)outFrontMatter
                   filePath:(NSString *)filePath
-                     owner:(id<BDSKOwner>)anOwner
+                     owner:(nullable id<BDSKOwner>)anOwner
                   encoding:(NSStringEncoding)parserEncoding
                      error:(NSError **)outError;
 
@@ -102,7 +104,7 @@
     @param      macroResolver (description)
     @result     Returns nil if nothing was found or an error occurred.
 */
-+ (NSDictionary *)macrosFromBibTeXString:(NSString *)stringContents 
macroResolver:(BDSKMacroResolver *)macroResolver;
++ (nullable NSDictionary *)macrosFromBibTeXString:(NSString *)stringContents 
macroResolver:(nullable BDSKMacroResolver *)macroResolver;
 
 /*!
     @method     macrosFromBibTeXStyle:document:
@@ -113,7 +115,7 @@
     @param      macroResolver (description)
     @result     Returns nil if nothing was found or an error occurred.
 */
-+ (NSDictionary *)macrosFromBibTeXStyle:(NSString *)styleContents 
macroResolver:(BDSKMacroResolver *)macroResolver;
++ (nullable NSDictionary *)macrosFromBibTeXStyle:(NSString *)styleContents 
macroResolver:(nullable BDSKMacroResolver *)macroResolver;
     
 /*!
     @method     authorsFromBibtexString:withPublication:forField
@@ -122,8 +124,10 @@
     @param      aString The author string
     @result     An array of BibAuthor objects.
 */
-+ (NSArray *)authorsFromBibtexString:(NSString *)aString 
withPublication:(BibItem *)pub forField:(NSString *)field reuse:(NSArray 
*)oldAuthors;
++ (NSArray *)authorsFromBibtexString:(NSString *)aString 
withPublication:(BibItem *)pub forField:(NSString *)field reuse:(nullable 
NSArray *)oldAuthors;
 
 + (NSDictionary *)nameComponents:(NSString *)aName forPublication:(BibItem 
*)pub;
 
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKDOIParser.h
===================================================================
--- trunk/bibdesk/BDSKDOIParser.h       2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKDOIParser.h       2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,7 +39,11 @@
 #import <Foundation/Foundation.h>
 #import "BDSKStringParser.h"
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface BDSKDOIParser : NSObject <BDSKStringParser>
-+ (NSArray *)itemsFromString:(NSString *)itemString owner:(id<BDSKOwner>)owner 
error:(NSError **)outError;
-+ (void)itemsFromString:(NSString *)itemString owner:(id<BDSKOwner>)owner 
completionHandler:(void (^)(NSArray *publications))completionHandler;
++ (nullable NSArray *)itemsFromString:(NSString *)itemString owner:(nullable 
id<BDSKOwner>)owner error:(NSError **)outError;
++ (void)itemsFromString:(NSString *)itemString owner:(id<BDSKOwner>)owner 
completionHandler:(void (^ _Nullable)(NSArray *publications))completionHandler;
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKDublinCoreXMLParser.h
===================================================================
--- trunk/bibdesk/BDSKDublinCoreXMLParser.h     2025-02-18 16:08:25 UTC (rev 
29019)
+++ trunk/bibdesk/BDSKDublinCoreXMLParser.h     2025-02-18 16:50:52 UTC (rev 
29020)
@@ -39,6 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
+NS_ASSUME_NONNULL_BEGIN
 
 @interface BDSKDublinCoreXMLParser: NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKJSTORParser.h
===================================================================
--- trunk/bibdesk/BDSKJSTORParser.h     2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKJSTORParser.h     2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,7 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKJSTORParser: NSObject <BDSKStringParser> {
-}
+NS_ASSUME_NONNULL_BEGIN
 
+@interface BDSKJSTORParser: NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKMARCParser.h
===================================================================
--- trunk/bibdesk/BDSKMARCParser.h      2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKMARCParser.h      2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,7 +39,10 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
+NS_ASSUME_NONNULL_BEGIN
 
 @interface BDSKMARCParser: NSObject <BDSKStringParser>
-+ (NSArray *)itemsFromMARCXMLString:(NSString *)itemString error:(NSError 
**)outError;
++ (nullable NSArray *)itemsFromMARCXMLString:(NSString *)itemString 
error:(NSError **)outError;
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKMODSParser.h
===================================================================
--- trunk/bibdesk/BDSKMODSParser.h      2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKMODSParser.h      2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,6 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface BDSKMODSParser: NSObject <BDSKStringParser>
+@end
 
-@end
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKPRISMParser.h
===================================================================
--- trunk/bibdesk/BDSKPRISMParser.h     2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKPRISMParser.h     2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,5 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
+NS_ASSUME_NONNULL_BEGIN
+
 @interface BDSKPRISMParser : NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKPubMedParser.h
===================================================================
--- trunk/bibdesk/BDSKPubMedParser.h    2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKPubMedParser.h    2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,6 +39,9 @@
 #import <Foundation/Foundation.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKPubMedParser: NSObject <BDSKStringParser> {
-}
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BDSKPubMedParser: NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKPubMedXMLParser.h
===================================================================
--- trunk/bibdesk/BDSKPubMedXMLParser.h 2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKPubMedXMLParser.h 2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,12 +39,12 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKPubMedXMLParser: NSObject <BDSKStringParser> {
+NS_ASSUME_NONNULL_BEGIN
 
-}
+@interface BDSKPubMedXMLParser: NSObject <BDSKStringParser>
 
-+ (BOOL)canParseString:(NSString *)string;
-+ (NSArray *)itemsFromString:(NSString *)itemString error:(NSError **)outError;
-+ (NSArray *)itemsFromData:(NSData *)itemData error:(NSError **)outError;
++ (nullable NSArray *)itemsFromData:(NSData *)itemData error:(NSError 
**)outError;
 
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKRISParser.h
===================================================================
--- trunk/bibdesk/BDSKRISParser.h       2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKRISParser.h       2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,6 +39,9 @@
 #import <Foundation/Foundation.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKRISParser: NSObject <BDSKStringParser> {
-}
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BDSKRISParser: NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKReferParser.h
===================================================================
--- trunk/bibdesk/BDSKReferParser.h     2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKReferParser.h     2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,8 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKReferParser: NSObject <BDSKStringParser> {
+NS_ASSUME_NONNULL_BEGIN
 
-}
+@interface BDSKReferParser: NSObject <BDSKStringParser>
+@end
 
-@end
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKReferenceMinerParser.h
===================================================================
--- trunk/bibdesk/BDSKReferenceMinerParser.h    2025-02-18 16:08:25 UTC (rev 
29019)
+++ trunk/bibdesk/BDSKReferenceMinerParser.h    2025-02-18 16:50:52 UTC (rev 
29020)
@@ -39,6 +39,9 @@
 #import <Foundation/Foundation.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKReferenceMinerParser: NSObject <BDSKStringParser> {
-}
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BDSKReferenceMinerParser: NSObject <BDSKStringParser>
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKSciFinderParser.h
===================================================================
--- trunk/bibdesk/BDSKSciFinderParser.h 2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKSciFinderParser.h 2025-02-18 16:50:52 UTC (rev 29020)
@@ -39,8 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKSciFinderParser: NSObject <BDSKStringParser> {
+NS_ASSUME_NONNULL_BEGIN
 
-}
+@interface BDSKSciFinderParser: NSObject <BDSKStringParser>
+@end
 
-@end
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKStringParser.h
===================================================================
--- trunk/bibdesk/BDSKStringParser.h    2025-02-18 16:08:25 UTC (rev 29019)
+++ trunk/bibdesk/BDSKStringParser.h    2025-02-18 16:50:52 UTC (rev 29020)
@@ -38,6 +38,8 @@
 
 #import <Foundation/Foundation.h>
 
+ NS_ASSUME_NONNULL_BEGIN
+
 typedef NS_ENUM(NSInteger, BDSKStringType) {
        BDSKStringTypeUnknown = -1, 
        BDSKStringTypeBibTeX,
@@ -63,15 +65,15 @@
 // passing BDSKStringTypeUnknown will use the appropriate -contentStringType
 + (BOOL)canParseString:(NSString *)string ofType:(BDSKStringType)stringType;
 // only for non-BibTeX string types
-+ (NSArray *)itemsFromString:(NSString *)string 
ofType:(BDSKStringType)stringType error:(NSError **)outError;
++ (nullable NSArray *)itemsFromString:(NSString *)string 
ofType:(BDSKStringType)stringType error:(NSError **)outError;
 // all string types including BibTeX
-+ (NSArray *)itemsFromString:(NSString *)string 
ofType:(BDSKStringType)stringType owner:(id <BDSKOwner>)owner error:(NSError 
**)outError;
++ (nullable NSArray *)itemsFromString:(NSString *)string 
ofType:(BDSKStringType)stringType owner:(nullable id <BDSKOwner>)owner 
error:(NSError **)outError;
 @end
 
 
 @protocol BDSKStringParser <NSObject>
 + (BOOL)canParseString:(NSString *)string;
-+ (NSArray *)itemsFromString:(NSString *)string error:(NSError **)outError;
++ (nullable NSArray *)itemsFromString:(NSString *)string error:(NSError 
**)outError;
 @end
 
 
@@ -78,3 +80,5 @@
 @interface NSString (BDSKStringParserExtensions)
 - (BDSKStringType)contentStringType;
 @end
+
+NS_ASSUME_NONNULL_END

Modified: trunk/bibdesk/BDSKWebOfScienceParser.h
===================================================================
--- trunk/bibdesk/BDSKWebOfScienceParser.h      2025-02-18 16:08:25 UTC (rev 
29019)
+++ trunk/bibdesk/BDSKWebOfScienceParser.h      2025-02-18 16:50:52 UTC (rev 
29020)
@@ -39,8 +39,9 @@
 #import <Cocoa/Cocoa.h>
 #import "BDSKStringParser.h"
 
-@interface BDSKWebOfScienceParser: NSObject <BDSKStringParser> {
+NS_ASSUME_NONNULL_BEGIN
 
-}
+@interface BDSKWebOfScienceParser: NSObject <BDSKStringParser>
+@end
 
-@end
+NS_ASSUME_NONNULL_END

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to