-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringType.h
More file actions
67 lines (45 loc) · 1.8 KB
/
Copy pathStringType.h
File metadata and controls
67 lines (45 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _STRINGTYPE_H
#define _STRINGTYPE_H
#include <exec/types.h>
typedef struct String {
char *_guts;
ULONG length;
} String;
/* Allocate and initialize a String instance. */
String *MakeString(char *str);
/* Free a String instance. */
VOID FreeString(String *str);
/* Convert a String to a char pointer. */
char *CString(String *str);
/* Returns YES if a String is empty, otherwise NO. */
BOOL StringIsEmpty(String *str);
/* Returns YES if a String is blank (has no or only whitespace
* characters), otherwise NO. */
BOOL StringIsBlank(String *str);
/* Returns YES if 2 strings are equal, else NO. */
BOOL StringsAreEqual(String *str1, String *str2);
/* Returns the length of the string. */
ULONG StringLength(String *str);
/* Returns a copy of a String. */
String *CopyString(String *str);
/* Returns YES if a String starts with the specified String, else NO. */
BOOL StringHasPrefix(String *str, String *prefix);
/* Returns YES if a String ends with the specified String, else NO. */
BOOL StringHasSuffix(String *str, String *suffix);
/* Removes leading whitespaces. */
VOID StringTrimLeading(String *str);
/* Removes trailing whitespaces. */
VOID StringTrimTrailing(String *str);
/* Removes leading and trailing whitespaces. */
VOID StringTrim(String *str);
/* Appends one String to another. */
VOID StringAppend(String *str, String *other);
/* Returns the character at a specified index. */
char StringCharAt(String *str, ULONG index);
/* Pads the String leader with 'n' number of whitespaces. */
VOID StringPadLeading(String *str, ULONG count);
/* Pads the String leader with 'n' number of characters. */
VOID StringPadLeadingChar(String *str, ULONG count, char chr);
VOID StringPadLeadingToLength(String *str, ULONG length);
VOID StringPadLeadingCharToLength(String *str, ULONG length, char chr);
#endif