#include <OOEncodingConverter.h>
Definition at line 39 of file OOEncodingConverter.h.
◆ convertString:
- (NSData *) convertString: |
|
(NSString *) | string |
|
◆ dealloc
Definition at line 249 of file OOEncodingConverter.m.
103{
104 [_cache release];
105 [_substitutions release];
106
107#if PROFILE_ENCODING_CONVERTER
108 sProfiledConverter =
nil;
109 [sProfileTimer invalidate];
111 sCacheHits = 0;
112 sCacheMisses = 0;
113#endif
114
115 [super dealloc];
116}
◆ descriptionComponents
- (NSString *) descriptionComponents |
|
|
|
|
implementation |
Definition at line 249 of file OOEncodingConverter.m.
120{
121 return [NSString stringWithFormat:@"encoding: %lu", _encoding];
122}
◆ encoding
- (NSStringEncoding) encoding |
|
|
|
◆ initWithEncoding:substitutions:
- (id) initWithEncoding: |
|
(NSStringEncoding) | encoding |
substitutions: |
|
(NSDictionary *) | substitutions |
Definition at line 249 of file OOEncodingConverter.m.
72 :(NSStringEncoding)
encoding substitutions:(NSDictionary *)substitutions
73{
74 self = [super init];
76 {
78 [_cache setPruneThreshold:kCachePruneThreshold];
79 [_cache setName:@"Text encoding"];
82
83#if PROFILE_ENCODING_CONVERTER
84 if (sProfiledConverter ==
nil)
85 {
86 sProfiledConverter = self;
87 sProfileTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(profileFire:) userInfo:nil repeats:YES];
88 }
89#endif
90 }
91
92 return self;
93}
NSDictionary * _substitutions
NSStringEncoding encoding()
◆ initWithFontPList:
- (id) initWithFontPList: |
|
(NSDictionary *) | fontPList |
|
Definition at line 249 of file OOEncodingConverter.m.
96 :(NSDictionary *)fontPList
97{
98 return [self initWithEncoding:EncodingFromString([fontPList oo_stringForKey:@"encoding"]) substitutions:[fontPList oo_dictionaryForKey:@"substitutions"]];
99}
◆ performConversionForString:
- (NSData *) performConversionForString: |
|
(NSString *) | string |
|
|
implementation |
Provided by category OOEncodingConverter(Private).
Definition at line 249 of file OOEncodingConverter.m.
165 :(NSString *)string
166{
167 NSString *subst =
nil;
168 NSEnumerator *substEnum =
nil;
169 NSMutableString *
mutable =
nil;
170
171 mutable = [[string mutableCopy] autorelease];
172 if (
mutable ==
nil)
return nil;
173
174 for (substEnum = [_substitutions keyEnumerator]; (subst = [substEnum nextObject]); )
175 {
176 [mutable replaceOccurrencesOfString:subst
177 withString:[_substitutions objectForKey:subst]
178 options:0
179 range:NSMakeRange(0, [mutable length])];
180 }
181
182 return [mutable dataUsingEncoding:_encoding allowLossyConversion:YES];
183}
◆ _cache
◆ _encoding
- (NSStringEncoding) _encoding |
|
private |
◆ _substitutions
- (NSDictionary*) _substitutions |
|
private |
The documentation for this class was generated from the following files: