aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Helpers/TextParsingHelper.h
blob: 2c7029c3c3ae769bed2fb00620a308ae6a0e2c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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