Overview
Comment: | OFINICategory: Allow values in global category |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | 1.1 |
Files: | files | file ages | folders |
SHA3-256: |
e2f6eea34e10f95f773c5eb1b6851f4f |
User & Date: | js on 2024-08-24 10:32:16 |
Other Links: | branch diff | manifest | tags |
Context
2024-08-24
| ||
10:40 | OFINIFile: Allow # for comments check-in: 55f5b88d26 user: js tags: 1.1 | |
10:32 | OFINICategory: Allow values in global category check-in: e2f6eea34e user: js tags: 1.1 | |
10:25 | OFINISection: Allow values in global section check-in: dab4c26020 user: js tags: trunk | |
09:22 | OFINIFile: Allow comments before first category check-in: b1eae58a7a user: js tags: 1.1 | |
Changes
Modified src/OFINICategory+Private.h from [f683fe929a] to [9fe10387de].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + - | OF_ASSUME_NONNULL_BEGIN @class OFStream; OF_DIRECT_MEMBERS @interface OFINICategory () |
Modified src/OFINICategory.m from [8affd22517] to [128a34b63f].
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - - - | - (void)of_parseLine: (OFString *)line { if (![line hasPrefix: @";"]) { OFINICategoryPair *pair; OFString *key, *value; size_t pos; |
︙ | |||
479 480 481 482 483 484 485 | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - + | - (bool)of_writeToStream: (OFStream *)stream encoding: (OFStringEncoding)encoding first: (bool)first { if (_lines.count == 0) return false; |
︙ |
Modified src/OFINIFile.h from [632da78d0f] to [65e9f4aad7].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - | * @class OFINIFile OFINIFile.h ObjFW/OFINIFile.h * * @brief A class for reading, creating and modifying INI files. */ OF_SUBCLASSING_RESTRICTED @interface OFINIFile: OFObject { |
︙ |
Modified src/OFINIFile.m from [e87f1f698c] to [ff94a45bd6].
︙ | |||
75 76 77 78 79 80 81 | 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 | - - + + - | } - (instancetype)initWithIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding { self = [super init]; @try { |
︙ | |||
116 117 118 119 120 121 122 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - + | return category; } - (void)of_parseIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding { void *pool = objc_autoreleasePoolPush(); OFStream *file; |
︙ | |||
144 145 146 147 148 149 150 151 152 153 | 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 | + + + - + + + + + - - - | OFString *categoryName; if (![line hasSuffix: @"]"]) @throw [OFInvalidFormatException exception]; categoryName = [line substringWithRange: OFMakeRange(1, line.length - 2)]; if (categoryName.length == 0) @throw [OFInvalidFormatException exception]; category = [[[OFINICategory alloc] of_initWithName: categoryName] autorelease]; [_categories addObject: category]; |
︙ |
Modified tests/OFINIFileTests.m from [6b63270541] to [eee41e5bc6].
︙ | |||
107 108 109 110 111 112 113 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - + + | OTAssertEqualObjects([types arrayValueForKey: @"array2"], array); OTAssertEqualObjects([types arrayValueForKey: @"array3"], [OFArray array]); } - (void)testWriteToIRIEncoding { |
︙ | |||
172 173 174 175 176 177 178 | 173 174 175 176 177 178 179 180 | - - - - - - - - - - - | } @finally { [[OFFileManager defaultManager] removeItemAtIRI: writeIRI]; } #else (void)expectedOutput; #endif } |
Modified tests/testfile.ini from [e974f469b7] to [4c2a651a5b].
| 1 2 3 4 5 6 7 8 9 | - + + |
|
︙ |