objc

NXString.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 // CLASS DEFINITIONS
10 
21 @private
22  const char *_value;
23  unsigned int
24  _length;
25  char *_data;
26  size_t _cap;
27 }
28 
32 + (NXString *)new;
33 
53 + (NXString *)stringWithCapacity:(size_t)capacity;
54 
58 + (NXString *)stringWithString:
60 
64 + (NXString *)stringWithCString:(const char *)cStr;
65 
69 + (NXString *)stringWithFormat:(NXConstantString *)format, ...;
70 
81 - (id)initWithString:(id<NXConstantStringProtocol, ObjectProtocol>)other;
82 
99 - (id)initWithCapacity:(size_t)capacity;
100 
106 - (id)initWithCString:(const char *)cStr;
107 
114 - (id)initWithFormat:(NXConstantString *)format, ...;
115 
125 - (id)initWithFormat:(NXConstantString *)format arguments:(va_list)args;
126 
135 - (const char *)cStr;
136 
144 - (unsigned int)length;
145 
155 - (void *)bytes;
156 
168 - (size_t)capacity;
169 
176 - (BOOL)append:(id<NXConstantStringProtocol>)other;
177 
184 - (BOOL)appendCString:(const char *)other;
185 
193 - (BOOL)appendStringWithFormat:(NXConstantString *)format, ...;
194 
200 
209 - (BOOL)trimPrefix:(id<NXConstantStringProtocol>)prefix
210  suffix:(id<NXConstantStringProtocol>)suffix;
211 
218 - (BOOL)hasPrefix:(id<NXConstantStringProtocol>)prefix;
219 
226 - (BOOL)hasSuffix:(id<NXConstantStringProtocol>)suffix;
227 
233 - (unsigned int)countOccurrencesOfByte:(uint8_t)ch;
234 
244 - (NXString *)JSONString;
245 
252 - (BOOL)containsString:(id<NXConstantStringProtocol>)other;
253 
262 
271 - (BOOL)toUppercase;
272 
281 - (BOOL)toLowercase;
282 
283 @end
void * bytes()
Returns the mutable C-string representation of the string.
A constant string class.
size_t capacity()
Returns the capacity of the string.
BOOL toLowercase()
Converts the string to lowercase.
BOOL trimWhitespace()
Trims leading and trailing whitespace from the string.
NXComparisonResult
Enumeration representing the result of a comparison operation.
Protocol for constant string objects.
bool BOOL
A Boolean value.
Definition: runtime.h:60
NXString * JSONString()
Returns a quoted version of the string.
BOOL toUppercase()
Converts the string to uppercase.
unsigned int length()
Returns the length of the string.
A class for managing and manipulating string objects.
Definition: NXString.h:20
The base class for objects in the Foundation framework.
Definition: NXObject.h:21
struct objc_object * id
A pointer to an instance of a class.
Definition: runtime.h:18
A protocol that defines JSON methods for an Object.
Definition: JSON+Protocol.h:14
const char * cStr()
Returns the C-string representation of the string.