ObjFW  Check-in [16ebc2d82a]

Overview
Comment:OFINIFile: Allow # for comments
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 16ebc2d82a5e78d31f726387c2c35c5b2bd06e49d659f3486200d3cca05e9f1a
User & Date: js on 2024-08-24 10:39:25
Other Links: manifest | tags
Context
2024-08-24
20:02
Minor style fix check-in: 0ab4647723 user: js tags: trunk
10:40
OFINIFile: Allow # for comments check-in: 55f5b88d26 user: js tags: 1.1
10:39
OFINIFile: Allow # for comments check-in: 16ebc2d82a user: js tags: trunk
10:25
OFINISection: Allow values in global section check-in: dab4c26020 user: js tags: trunk
Changes

Modified src/OFINISection.m from [8aabd85aa9] to [2059e2c42f].

150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
	[_lines release];

	[super dealloc];
}

- (void)of_parseLine: (OFString *)line
{
	if (![line hasPrefix: @";"]) {
		OFINISectionPair *pair;
		OFString *key, *value;
		size_t pos;

		pair = [[[OFINISectionPair alloc] init] autorelease];

		if ((pos = [line rangeOfString: @"="].location) == OFNotFound)







|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
	[_lines release];

	[super dealloc];
}

- (void)of_parseLine: (OFString *)line
{
	if (![line hasPrefix: @";"] && ![line hasPrefix: @"#"]) {
		OFINISectionPair *pair;
		OFString *key, *value;
		size_t pos;

		pair = [[[OFINISectionPair alloc] init] autorelease];

		if ((pos = [line rangeOfString: @"="].location) == OFNotFound)

Modified tests/OFINIFileTests.m from [08c72cb447] to [ce3bbf2039].

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
	    @"[tests]\r\n"
	    @"foo=baz\r\n"
	    @"foobar=baz\r\n"
	    @";comment\r\n"
	    @"new=new\r\n"
	    @"\r\n"
	    @"[foobar]\r\n"
	    @";foobarcomment\r\n"
	    @"qux=\" asd\"\r\n"
	    @"quxquxqux=\"hello\\\"wörld\"\r\n"
	    @"qux2=\"a\\f\"\r\n"
	    @"qux3=a\fb\r\n"
	    @"\r\n"
	    @"[types]\r\n"
	    @"integer=16\r\n"







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
	    @"[tests]\r\n"
	    @"foo=baz\r\n"
	    @"foobar=baz\r\n"
	    @";comment\r\n"
	    @"new=new\r\n"
	    @"\r\n"
	    @"[foobar]\r\n"
	    @"#foobarcomment\r\n"
	    @"qux=\" asd\"\r\n"
	    @"quxquxqux=\"hello\\\"wörld\"\r\n"
	    @"qux2=\"a\\f\"\r\n"
	    @"qux3=a\fb\r\n"
	    @"\r\n"
	    @"[types]\r\n"
	    @"integer=16\r\n"

Modified tests/testfile.ini from [f46e5f3bc4] to [38129d6503].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; Comment in global section
global=yes

[tests]
foo = bar
foobar=baz
;comment

[foobar]
;foobarcomment
qux=" asd"
"quxqux " = asd
quxquxqux="hello\"wörld"
qux2="a\f"

[types]
integer = 0x20









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; Comment in global section
global=yes

[tests]
foo = bar
foobar=baz
;comment

[foobar]
#foobarcomment
qux=" asd"
"quxqux " = asd
quxquxqux="hello\"wörld"
qux2="a\f"

[types]
integer = 0x20