65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
static OFString *
pathToURLPath(OFString *path)
{
# if defined(OF_WINDOWS) || defined(OF_MSDOS)
path = [path stringByReplacingOccurrencesOfString: @"\\"
withString: @"/"];
path = [path stringByPrependingString: @"/"];
# elif defined(OF_AMIGAOS)
OFArray OF_GENERIC(OFString *) *components = [path pathComponents];
OFMutableString *ret = [OFMutableString string];
for (OFString *component in components) {
if ([component length] == 0)
continue;
|
>
>
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
static OFString *
pathToURLPath(OFString *path)
{
# if defined(OF_WINDOWS) || defined(OF_MSDOS)
path = [path stringByReplacingOccurrencesOfString: @"\\"
withString: @"/"];
path = [path stringByPrependingString: @"/"];
return path;
# elif defined(OF_AMIGAOS)
OFArray OF_GENERIC(OFString *) *components = [path pathComponents];
OFMutableString *ret = [OFMutableString string];
for (OFString *component in components) {
if ([component length] == 0)
continue;
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
static OFString *
URLPathToPath(OFString *path)
{
# if defined(OF_WINDOWS) || defined(OF_MSDOS)
path = [path substringWithRange: of_range(1, [path length] - 1)];
path = [path stringByReplacingOccurrencesOfString: @"/"
withString: @"\\"];
# elif defined(OF_AMIGAOS)
OFMutableArray OF_GENERIC(OFString *) *components;
size_t count;
path = [path substringWithRange: of_range(1, [path length] - 1)];
components = [[[path
componentsSeparatedByString: @"/"] mutableCopy] autorelease];
|
>
>
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
static OFString *
URLPathToPath(OFString *path)
{
# if defined(OF_WINDOWS) || defined(OF_MSDOS)
path = [path substringWithRange: of_range(1, [path length] - 1)];
path = [path stringByReplacingOccurrencesOfString: @"/"
withString: @"\\"];
return path;
# elif defined(OF_AMIGAOS)
OFMutableArray OF_GENERIC(OFString *) *components;
size_t count;
path = [path substringWithRange: of_range(1, [path length] - 1)];
components = [[[path
componentsSeparatedByString: @"/"] mutableCopy] autorelease];
|