51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/*
* It seems strtod is buggy on Win32.
* However, the MinGW version __strtod seems to be ok.
*/
#ifdef _WIN32
# define strtod __strtod
#endif
/* References for static linking */
void _references_to_categories_of_OFString(void)
{
_OFString_Hashing_reference = 1;
_OFString_JSONValue_reference = 1;
_OFString_Serialization_reference = 1;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
/*
* It seems strtod is buggy on Win32.
* However, the MinGW version __strtod seems to be ok.
*/
#ifdef _WIN32
# define strtod __strtod
#endif
static OFString*
standardize_path(OFArray *components, OFString *currentDirectory,
OFString *parentDirectory, OFString *joinString)
{
void *pool = objc_autoreleasePoolPush();
OFMutableArray *array;
OFString *ret;
BOOL done = NO;
array = [[components mutableCopy] autorelease];
while (!done) {
size_t i, length = [array count];
done = YES;
for (i = 0; i < length; i++) {
id object = [array objectAtIndex: i];
if ([object isEqual: currentDirectory]) {
[array removeObjectAtIndex: i];
done = NO;
break;
}
if ([object isEqual: parentDirectory]) {
[array removeObjectAtIndex: i];
if (i > 0)
[array removeObjectAtIndex: i - 1];
done = NO;
break;
}
}
}
ret = [[array componentsJoinedByString: joinString] retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
/* References for static linking */
void _references_to_categories_of_OFString(void)
{
_OFString_Hashing_reference = 1;
_OFString_JSONValue_reference = 1;
_OFString_Serialization_reference = 1;
|
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
|
return [self substringWithRange: of_range(0, 1)];
}
objc_autoreleasePoolPop(pool);
return @".";
}
- (intmax_t)decimalValue
{
void *pool = objc_autoreleasePoolPush();
const of_unichar_t *string = [self unicodeString];
size_t length = [self length];
int i = 0;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
|
return [self substringWithRange: of_range(0, 1)];
}
objc_autoreleasePoolPop(pool);
return @".";
}
- (OFString*)stringByStandardizingPath
{
return standardize_path([self pathComponents],
OF_PATH_CURRENT_DIRECTORY, OF_PATH_PARENT_DIRECTORY,
OF_PATH_DELIMITER_STRING);
}
- (OFString*)stringByStandardizingURLPath
{
return standardize_path( [self componentsSeparatedByString: @"/"],
@".", @"..", @"/");
}
- (intmax_t)decimalValue
{
void *pool = objc_autoreleasePoolPush();
const of_unichar_t *string = [self unicodeString];
size_t length = [self length];
int i = 0;
|