Overview
Comment: | Style improvements. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
d968d32614fe2cea6219e5a90da03370 |
User & Date: | js on 2011-04-30 23:33:51 |
Other Links: | manifest | tags |
Context
2011-05-01
| ||
00:35 | Add +[OFString stringWithUnicodeString:]. check-in: e2bbfb45d0 user: js tags: trunk | |
2011-04-30
| ||
23:33 | Style improvements. check-in: d968d32614 user: js tags: trunk | |
23:01 | Copy exceptions/common.h into the resulting framework. check-in: a6e2eea3b5 user: js tags: trunk | |
Changes
Modified src/OFString.h from [bd128c526e] to [7edfd43e32].
︙ | |||
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | + + + + + + + + - - - - - - - - | * \param string A UTF-8 encoded C string to initialize the OFString with * \param length The length of the UTF-8 encoded C string * \return A new autoreleased OFString */ + stringWithCString: (const char*)string length: (size_t)length; /** * Creates a new OFString from another string. * * \param string A string to initialize the OFString with * \return A new autoreleased OFString */ + stringWithString: (OFString*)string; /** * Creates a new OFString from a format string. * See printf for the format syntax. * * \param format A string used as format to initialize the OFString * \return A new autoreleased OFString */ + stringWithFormat: (OFString*)format, ...; /** * Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ + stringWithPath: (OFString*)firstComponent, ...; |
︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | + + + + + + + + | * \param string A UTF-8 encoded C string to initialize the OFString with * \param length The length of the UTF-8 encoded C string * \return An initialized OFString */ - initWithCString: (const char*)string length: (size_t)length; /** * Initializes an already allocated OFString with another string. * * \param string A string to initialize the OFString with * \return An initialized OFString */ - initWithString: (OFString*)string; /** * Initializes an already allocated OFString with a format string. * See printf for the format syntax. * * \param format A string used as format to initialize the OFString * \return An initialized OFString */ |
︙ | |||
253 254 255 256 257 258 259 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | - - - - - - - - | * \param firstComponent The first component of the path * \param arguments A va_list with the other components of the path * \return A new autoreleased OFString */ - initWithPath: (OFString*)firstComponent arguments: (va_list)arguments; |
︙ |
Modified src/OFString.m from [02548d1e5f] to [e280f8208a].
︙ | |||
60 61 62 63 64 65 66 | 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 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 251 | - + - + - + - + - + - + - + - + - - + + - - + + + - + - - + + + - + - - + + + - - + + - + - + - + - - + + - - - + + + - - - - + + + + - - - - - + + + + + - + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - + - - - + + + - + - + - - - + + + - + | _OFString_Hashing_reference = 1; _OFString_URLEncoding_reference = 1; _OFString_XMLEscaping_reference = 1; _OFString_XMLUnescaping_reference = 1; } static inline int |
︙ | |||
270 271 272 273 274 275 276 277 278 279 280 281 282 283 | 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | + + + + + | + stringWithCString: (const char*)string length: (size_t)length { return [[[self alloc] initWithCString: string length: length] autorelease]; } + stringWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; } + stringWithFormat: (OFString*)format, ... { id ret; va_list arguments; va_start(arguments, format); |
︙ | |||
297 298 299 300 301 302 303 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - - - - - | ret = [[[self alloc] initWithPath: firstComponent arguments: arguments] autorelease]; va_end(arguments); return ret; } |
︙ | |||
481 482 483 484 485 486 487 488 489 490 491 492 493 494 | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | - initWithCString: (const char*)string_ length: (size_t)length_ { return [self initWithCString: string_ encoding: OF_STRING_ENCODING_UTF_8 length: length_]; } - initWithString: (OFString*)string_ { self = [super init]; @try { /* We have no -[dealloc], so this is ok */ string = (char*)[string_ cString]; length = [string_ cStringLength]; switch (of_string_check_utf8(string, length)) { case 1: isUTF8 = YES; break; case -1:; @throw [OFInvalidEncodingException newWithClass: isa]; } if ((string = strdup(string)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa requestedSize: length + 1]; @try { [self addMemoryToPool: string]; } @catch (id e) { free(string); @throw e; } } @catch (id e) { [self release]; @throw e; } return self; } - initWithFormat: (OFString*)format, ... { id ret; va_list arguments; va_start(arguments, format); |
︙ | |||
600 601 602 603 604 605 606 | 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | len = [component cStringLength]; string[i] = OF_PATH_DELIM; memcpy(string + i + 1, [component cString], len); i += len + 1; } string[i] = '\0'; |
︙ |