Overview
Comment: | Rename +[name] and -[name] to +[className] and -[className]. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ce8d36d5c4d4f8562b25f9154b242875 |
User & Date: | js on 2009-08-12 15:37:27 |
Other Links: | manifest | tags |
Context
2009-08-12
| ||
16:55 | New way for handling and storing XML attributes. check-in: 6f001b8016 user: js tags: trunk | |
15:37 | Rename +[name] and -[name] to +[className] and -[className]. check-in: ce8d36d5c4 user: js tags: trunk | |
2009-08-10
| ||
18:37 | More checking for malformed/invalid XML. check-in: a70d90b09e user: js tags: trunk | |
Changes
Modified src/OFExceptions.m from [77e5ffdd0d] to [b96cf194ca].
︙ | ︙ | |||
133 134 135 136 137 138 139 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Could not allocate %zu bytes in class %s!", req_size, | | | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Could not allocate %zu bytes in class %s!", req_size, [class className]]; return string; } - (size_t)requestedSize { return req_size; |
︙ | ︙ | |||
177 178 179 180 181 182 183 | if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Memory at %p was not allocated as part of object of class %s, " @"thus the memory allocation was not changed! It is also possible " @"that there was an attempt to free the same memory twice.", | | | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Memory at %p was not allocated as part of object of class %s, " @"thus the memory allocation was not changed! It is also possible " @"that there was an attempt to free the same memory twice.", pointer, [class className]]; return string; } - (void*)pointer { return pointer; |
︙ | ︙ | |||
219 220 221 222 223 224 225 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The method %s of class %s is not or not fully implemented!", | | | | 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 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The method %s of class %s is not or not fully implemented!", SEL_NAME(selector), [class className]]; return string; } @end @implementation OFOutOfRangeException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Value out of range in class %s!", [class className]]; return string; } @end @implementation OFInvalidArgumentException + newWithClass: (Class)class_ |
︙ | ︙ | |||
269 270 271 272 273 274 275 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The argument for method %s of class %s is invalid!", | | | | | | | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The argument for method %s of class %s is invalid!", SEL_NAME(selector), [class className]]; return string; } @end @implementation OFInvalidEncodingException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The encoding is invalid for class %s!", [class className]]; return string; } @end @implementation OFInvalidFormatException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The format is invalid for class %s!", [class className]]; return string; } @end @implementation OFMalformedXMLException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The parser in class %s encountered malformed or invalid XML!", [class className]]; return string; } @end @implementation OFInitializationFailedException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Initialization failed for class %s!", [class className]]; return string; } @end @implementation OFOpenFileFailedException + newWithClass: (Class)class_ |
︙ | ︙ | |||
372 373 374 375 376 377 378 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to open file %s with mode %s in class %s! " ERRFMT, | | | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to open file %s with mode %s in class %s! " ERRFMT, [path cString], [mode cString], [self className], ERRPARAM]; return string; } - (int)errNo { return err; |
︙ | ︙ | |||
481 482 483 484 485 486 487 | { if (string != nil) return string;; if (has_items) string = [[OFString alloc] initWithFormat: @"Failed to read %zu items of size %zu in class %s! " | | | | | | | > | | 481 482 483 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 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | { if (string != nil) return string;; if (has_items) string = [[OFString alloc] initWithFormat: @"Failed to read %zu items of size %zu in class %s! " ERRFMT, req_items, req_size, [class className], ERRPARAM]; else string = [[OFString alloc] initWithFormat: @"Failed to read %zu bytes in class %s! " ERRFMT, req_size, [class className], ERRPARAM]; return string; } @end @implementation OFWriteFailedException - (OFString*)string { if (string != nil) return string; if (has_items) string = [[OFString alloc] initWithFormat: @"Failed to write %zu items of size %zu in class %s! " ERRFMT, req_items, req_size, [class className], ERRPARAM]; else string = [[OFString alloc] initWithFormat: @"Failed to write %zu bytes in class %s! " ERRFMT, req_size, [class className], ERRPARAM]; return string; } @end @implementation OFSetOptionFailedException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Setting an option in class %s failed!", [class className]]; return string; } @end @implementation OFNotConnectedException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The socket of type %s is not connected or bound!", [class className]]; return string; } @end @implementation OFAlreadyConnectedException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The socket of type %s is already connected or bound and thus " @"can't be connected or bound again!", [class className]]; return string; } @end @implementation OFAddressTranslationFailedException + newWithClass: (Class)class_ |
︙ | ︙ | |||
598 599 600 601 602 603 604 | string = [[OFString alloc] initWithFormat: @"The service %s on %s could not be translated to an address in " @"class %s. This means that either the node was not found, there " @"is no such service on the node, there was a problem with the " @"name server, there was a problem with your network connection " @"or you specified an invalid node or service. " ERRFMT, | | | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | string = [[OFString alloc] initWithFormat: @"The service %s on %s could not be translated to an address in " @"class %s. This means that either the node was not found, there " @"is no such service on the node, there was a problem with the " @"name server, there was a problem with your network connection " @"or you specified an invalid node or service. " ERRFMT, [service cString], [node cString], [class className], AT_ERRPARAM]; return string; } - (int)errNo { return err; |
︙ | ︙ | |||
664 665 666 667 668 669 670 | { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"A connection to service %s on node %s could not be established " @"in class %s! " ERRFMT, [node cString], [service cString], | | | 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"A connection to service %s on node %s could not be established " @"in class %s! " ERRFMT, [node cString], [service cString], [class className], ERRPARAM]; return string; } - (int)errNo { return err; |
︙ | ︙ | |||
734 735 736 737 738 739 740 | { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Binding service %s on node %s using family %d failed in class " @"%s! " ERRFMT, [service cString], [node cString], family, | | | 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 | { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Binding service %s on node %s using family %d failed in class " @"%s! " ERRFMT, [service cString], [node cString], family, [class className], ERRPARAM]; return string; } - (int)errNo { return err; |
︙ | ︙ | |||
792 793 794 795 796 797 798 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to listen in socket of type %s with a back log of %d! " | | | 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to listen in socket of type %s with a back log of %d! " ERRFMT, [class className], backlog, ERRPARAM]; return string; } - (int)errNo { return err; |
︙ | ︙ | |||
825 826 827 828 829 830 831 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to accept connection in socket of type %s! " ERRFMT, | | | | | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to accept connection in socket of type %s! " ERRFMT, [class className], ERRPARAM]; return string; } - (int)errNo { return err; } @end @implementation OFThreadJoinFailedException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Joining a thread of class %s failed! Most likely, another thread " @"already waits for the thread to join.", [class className]]; return string; } @end @implementation OFThreadCanceledException - (OFString*)string { if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"The requested action cannot be performed because the thread of " @"class %s was canceled!", [class className]]; return string; } @end |
Modified src/OFObject.h from [7edb49c81c] to [494102f6f4].
︙ | ︙ | |||
47 48 49 50 51 52 53 | * \return The class pointer */ + (Class)class; /** * \return The name of the class as a C string */ | | | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | * \return The class pointer */ + (Class)class; /** * \return The name of the class as a C string */ + (const char*)className; /** * \param selector The selector which should be checked for respondance * * \return A boolean whether instances of the class respond to the specified * selector */ |
︙ | ︙ | |||
111 112 113 114 115 116 117 | * \return A pointer to the class of the instance */ - (Class)class; /** * \return The name of the instance's class as a C string */ | | | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | * \return A pointer to the class of the instance */ - (Class)class; /** * \return The name of the instance's class as a C string */ - (const char*)className; /** * \param class The class whose kind is checked * * \return A boolean whether the object is of the specified kind */ - (BOOL)isKindOfClass: (Class)class; |
︙ | ︙ |
Modified src/OFObject.m from [bc5794b890] to [344bd01fa3].
︙ | ︙ | |||
84 85 86 87 88 89 90 | } + (Class)class { return self; } | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | } + (Class)class { return self; } + (const char*)className { #ifdef __objc_INCLUDE_GNU return class_get_class_name(self); #else return class_getName(self); #endif } |
︙ | ︙ | |||
196 197 198 199 200 201 202 | } - (Class)class { return isa; } | | | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | } - (Class)class { return isa; } - (const char*)className { #ifdef __objc_INCLUDE_GNU return object_get_class_name(self); #else return class_getName(isa); #endif } |
︙ | ︙ |
Modified tests/OFAutoreleasePool/OFAutoreleasePool.m from [865fdcfcaa] to [33e54774eb].
︙ | ︙ | |||
39 40 41 42 43 44 45 | - init { id ret; inits++; ret = init(self, _cmd); | | | | > | 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 | - init { id ret; inits++; ret = init(self, _cmd); printf("New %s with retain cnt " ZD "\n", [self className], [ret retainCount]); return ret; } - retain { id ret; retains++; ret = retain(self, _cmd); printf("Retaining %s to " ZD "\n", [self className], [ret retainCount]); return ret; } - (void)release { releases++; printf("Releasing %s to " ZD "\n", [self className], [self retainCount] - 1); release(self, _cmd); } @end int main() { |
︙ | ︙ |