diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-11 12:32:54 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-11 12:32:54 +0200 |
| commit | 397cb011a540d53974a87d94a8ff8576e2024b63 (patch) | |
| tree | 616de785531442329f42333724c9fa9a728cf4e3 /QSThingsPlugin/Helpers/TextParsingHelper.h | |
| parent | 1613c951d49e6d85aff52f312d57fa087b35c079 (diff) | |
Add create actions
Diffstat (limited to 'QSThingsPlugin/Helpers/TextParsingHelper.h')
| -rw-r--r-- | QSThingsPlugin/Helpers/TextParsingHelper.h | 22 |
1 files changed, 22 insertions, 0 deletions
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 <Foundation/Foundation.h> +#import <Security/Security.h> + +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 |