2 Copyright (C) 2000-2005 SKYRIX Software AG
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 "XmlRpcValue.h"
25 @implementation XmlRpcValue
27 The XmlRpcValue class is used internally by the XML-RPC decoder to
28 represent any valid XML-RPC value. You should never need to use this class.
31 - (id)initWithValue:(id)_value className:(NSString *)_className {
32 if ((self = [super init])) {
35 ASSIGN(self->value, _value);
36 cName = (_className != nil)
38 : NSStringFromClass([_value class]);
40 ASSIGN(self->className, cName);
46 [self->className release];
47 [self->value release];
55 - (void)setClassName:(NSString *)_className {
56 if (_className != self->className) {
57 [self->className autorelease];
58 self->className = [_className copy];
61 - (NSString *)className {
62 return self->className;
66 return NSClassFromString([self className]);
70 return [(id<NSObject>)[self value] isKindOfClass:[NSException class]];
72 - (BOOL)isDictionary {
73 return [(id<NSObject>)[self value] isKindOfClass:[NSDictionary class]];
78 - (NSString *)description {
79 return [NSString stringWithFormat:@"XmlRpcValue: %@->%@",
86 - (id)copyWithZone:(NSZone *)zone {
87 return [[[self class] alloc]
88 initWithValue:self->value className:self->className];
91 @end /* XmlRpcValue */