aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Helpers/TextParsingHelper.h
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-09-11 12:32:54 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-09-11 12:32:54 +0200
commit397cb011a540d53974a87d94a8ff8576e2024b63 (patch)
tree616de785531442329f42333724c9fa9a728cf4e3 /QSThingsPlugin/Helpers/TextParsingHelper.h
parent1613c951d49e6d85aff52f312d57fa087b35c079 (diff)
Add create actions
Diffstat (limited to 'QSThingsPlugin/Helpers/TextParsingHelper.h')
-rw-r--r--QSThingsPlugin/Helpers/TextParsingHelper.h22
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