From 397cb011a540d53974a87d94a8ff8576e2024b63 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Thu, 11 Sep 2025 12:32:54 +0200 Subject: Add create actions --- QSThingsPlugin/Helpers/TextParsingHelper.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 QSThingsPlugin/Helpers/TextParsingHelper.h (limited to 'QSThingsPlugin/Helpers/TextParsingHelper.h') diff --git a/QSThingsPlugin/Helpers/TextParsingHelper.h b/QSThingsPlugin/Helpers/TextParsingHelper.h new file mode 100644 index 0000000..2c7029c --- /dev/null +++ b/QSThingsPlugin/Helpers/TextParsingHelper.h @@ -0,0 +1,22 @@ +#import "Constants.h" +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TextParsingHelper : NSObject + +/** + Parses a string and returns a dictionary of parameters according to the following rules: + * The first line is parsed as title + * If the first line contains >> then everything after >> is considered notes. + * If a line starts with #, the rest will be interpreted as a comma separated list of tags. + * If a line starts with @, the rest will be interpreted as the date. + * If a line starts with !, the rest will be interpreted as the deadline. + @param text the + @return A dictionary with the parameters for the `add` route of the things API + */ ++ (NSMutableDictionary *)parseText:(NSString*)text; +@end + +NS_ASSUME_NONNULL_END -- cgit