aboutsummaryrefslogtreecommitdiff
path: root/builtins/text.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-20 15:19:31 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-20 15:19:31 -0400
commit5b1960859fcc6331a486ced98c5f25d93168fa18 (patch)
treea4969d21479d68f86a65f2cbb396878336db7bf2 /builtins/text.h
parent7dddfb71a0ebf8dbbe8a9bdfc156d7471ff943bd (diff)
Hook up Text.has(), Text.trimmed(), Text.without()
Diffstat (limited to 'builtins/text.h')
-rw-r--r--builtins/text.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtins/text.h b/builtins/text.h
index cd191cb6..e97c4010 100644
--- a/builtins/text.h
+++ b/builtins/text.h
@@ -8,11 +8,10 @@
#include <stdint.h>
#include "types.h"
+#include "where.h"
#define Text_t CORD
-typedef enum { WHERE_ANYWHERE, WHERE_START, WHERE_END } where_e;
-
typedef struct {
enum { FIND_FAILURE, FIND_SUCCESS } status;
int32_t index;
@@ -27,9 +26,9 @@ CORD Text$slice(CORD text, int64_t first, int64_t length);
CORD Text$upper(CORD str);
CORD Text$lower(CORD str);
CORD Text$title(CORD str);
-bool Text$has(CORD str, CORD target, where_e where);
-CORD Text$without(CORD str, CORD target, where_e where);
-CORD Text$trimmed(CORD str, CORD skip, where_e where);
+bool Text$has(CORD str, CORD target, Where_t where);
+CORD Text$without(CORD str, CORD target, Where_t where);
+CORD Text$trimmed(CORD str, CORD skip, Where_t where);
find_result_t Text$find(CORD str, CORD pat);
CORD Text$replace(CORD text, CORD pat, CORD replacement, int64_t limit);
array_t Text$split(CORD str, CORD split);