Overview
Comment: | Add a new convenience method to OFString. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
88163bd1722606a1053222b6585933b6 |
User & Date: | js on 2009-05-23 22:07:22 |
Other Links: | manifest | tags |
Context
2009-05-24
| ||
00:18 | Get rid of dependency on getpagesize(). check-in: 127d635848 user: js tags: trunk | |
2009-05-23
| ||
22:07 | Add a new convenience method to OFString. check-in: 88163bd172 user: js tags: trunk | |
21:53 | A few renames. check-in: 526d04018d user: js tags: trunk | |
Changes
Modified src/OFMutableString.m from [da1cf273ef] to [d29d560858].
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + | #ifndef HAVE_ASPRINTF #import "asprintf.h" #endif @implementation OFMutableString - (id)copy { |
︙ |
Modified src/OFString.h from [54ab126f71] to [0f37fc8589].
︙ | |||
31 32 33 34 35 36 37 | 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + - - + + - + - - + + + + + + + + + + - + - - + + - + - - + + - + - + - + + + + + + + + + | int _unused; #endif #endif BOOL is_utf8; } /** |
︙ |
Modified src/OFString.m from [7338b9f854] to [40c6a50185].
︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | + + + + + | va_start(args, fmt); ret = [[[self alloc] initWithFormat: fmt andArguments: args] autorelease]; va_end(args); return ret; } + stringWithString: (OFString*)str { return [[[self alloc] initWithString: str] autorelease]; } - init { [super init]; string = NULL; |
︙ | |||
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | + + + + + + + + + + + + + + + + + + + + + + + - + | } @catch (OFException *e) { free(string); @throw e; } return self; } - initWithString: (OFString*)str { self = [super init]; string = strdup([str cString]); length = [str length]; @try { [self addItemToMemoryPool: string]; } @catch (OFException *e) { /* * We can't use [super dealloc] on OS X here. * Compiler bug? Anyway, [self dealloc] will do here as we * don't reimplement dealloc. */ free(string); [self dealloc]; @throw e; } return self; } - (const char*)cString { return string; } - (size_t)length { return length; } - (id)copy { return [self retain]; } - (id)mutableCopy { |
︙ |