summaryrefslogtreecommitdiff
path: root/SmartDeviceLink-iOS/SmartDeviceLink/SDLTTSChunk.m
blob: 5fbb2dbcc3f481d01e6907f186ba8bd1e3ee78e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//  SDLTTSChunk.m
//
//  Copyright (c) 2014 Ford Motor Company. All rights reserved.

#import "SDLTTSChunk.h"

#import "SDLNames.h"

@implementation SDLTTSChunk

-(id) init {
    if (self = [super init]) {}
    return self;
}

-(id) initWithDictionary:(NSMutableDictionary*) dict {
    if (self = [super initWithDictionary:dict]) {}
    return self;
}

-(void) setText:(NSString*) text {
    if (text != nil) {
        [store setObject:text forKey:NAMES_text];
    } else {
        [store removeObjectForKey:NAMES_text];
    }
}

-(NSString*) text {
    return [store objectForKey:NAMES_text];
}

-(void) setType:(SDLSpeechCapabilities*) type {
    if (type != nil) {
        [store setObject:type forKey:NAMES_type];
    } else {
        [store removeObjectForKey:NAMES_type];
    }
}

-(SDLSpeechCapabilities*) type {
    NSObject* obj = [store objectForKey:NAMES_type];
    if ([obj isKindOfClass:SDLSpeechCapabilities.class]) {
        return (SDLSpeechCapabilities*)obj;
    } else {
        return [SDLSpeechCapabilities valueOf:(NSString*)obj];
    }
}

@end