2 Copyright (C) 2005 Helge Hess
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include "NGVCardSimpleValue.h"
25 @implementation NGVCardSimpleValue
27 - (id)initWithValue:(NSString *)_value group:(NSString *)_group
28 types:(NSArray *)_types arguments:(NSDictionary *)_a
30 if ((self = [super initWithGroup:_group types:_types arguments:_a]) != nil) {
31 self->value = [_value copy];
36 - (id)initWithGroup:(NSString *)_group types:(NSArray *)_types
37 arguments:(NSDictionary *)_a
39 return [self initWithValue:nil group:_group types:_types arguments:_a];
42 return [self initWithValue:nil group:nil types:nil arguments:nil];
46 [self->value release];
52 - (NSString *)stringValue {
57 return [self stringValue];
60 /* fake being a string */
62 - (unichar)characterAtIndex:(unsigned)_idx {
63 return [self->value characterAtIndex:_idx];
66 return [self->value length];
71 - (void)encodeWithCoder:(NSCoder *)_coder {
72 [super encodeWithCoder:_coder];
73 [_coder encodeObject:self->value];
75 - (id)initWithCoder:(NSCoder *)_coder {
76 if ((self = [super initWithCoder:_coder]) != nil) {
77 self->value = [[_coder decodeObject] copy];
84 - (void)appendAttributesToDescription:(NSMutableString *)_ms {
85 if (self->value != nil) [_ms appendFormat:@" value='%@'", self->value];
86 [super appendAttributesToDescription:_ms];
89 @end /* NGVCardSimpleValue */