15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#ifdef HAVE_MADVISE
#include <sys/mman.h>
#else
#define madvise(addr, len, advise)
#endif
#import "OFString.h"
#import "OFExceptions.h"
#import "macros.h"
#import "asprintf.h"
|
|
|
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#ifdef HAVE_MADVISE
# include <sys/mman.h>
#else
# define madvise(addr, len, advise)
#endif
#import "OFString.h"
#import "OFExceptions.h"
#import "macros.h"
#import "asprintf.h"
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
} @catch (OFOutOfMemoryException *e) {
/* We don't really care, as we only made it smaller */
[e dealloc];
}
return self;
}
- replaceOccurrencesOfString: (OFString*)str
withString: (OFString*)repl
{
const char *str_c = [str cString];
const char *repl_c = [repl cString];
size_t str_len = [str cStringLength];
|
>
>
>
>
>
>
|
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
|
} @catch (OFOutOfMemoryException *e) {
/* We don't really care, as we only made it smaller */
[e dealloc];
}
return self;
}
- removeCharactersInRange: (of_range_t)range
{
return [self removeCharactersFromIndex: range.start
toIndex: range.start + range.length];
}
- replaceOccurrencesOfString: (OFString*)str
withString: (OFString*)repl
{
const char *str_c = [str cString];
const char *repl_c = [repl cString];
size_t str_len = [str cStringLength];
|