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 <EOControl/EOFetchSpecification.h>
23 #include <EOControl/EOSortOrdering.h>
25 #include <XmlRpc/XmlRpcCoder.h>
26 #include <EOControl/EOQualifier.h>
28 @implementation EOFetchSpecification(XmlRpcCoding)
30 - (id)initWithXmlRpcCoder:(XmlRpcDecoder *)_coder {
31 if ((self = [super init])) {
34 [self setUsesDistinct:[_coder decodeBooleanForKey:@"usesDistinct"]];
35 [self setLocksObjects:[_coder decodeBooleanForKey:@"locksObjects"]];
36 [self setEntityName: [_coder decodeStringForKey:@"entityName"]];
37 [self setFetchLimit: [_coder decodeIntForKey:@"fetchLimit"]];
38 [self setHints: [_coder decodeStructForKey:@"hints"]];
40 if ((q = [_coder decodeObjectForKey:@"qualifier"])) {
41 if ([q isKindOfClass:[EOQualifier class]])
42 /* already a qualifier :-) [ObjC on the other side ..] */
45 q = [[EOQualifier alloc] initWithPropertyList:q owner:nil];
49 [self setQualifier:q];
50 [self setSortOrderings:[_coder decodeObjectForKey:@"sortOrderings"]];
57 - (void)encodeWithXmlRpcCoder:(XmlRpcEncoder *)_coder {
58 [_coder encodeBoolean:[self usesDistinct] forKey:@"usesDistinct"];
59 [_coder encodeBoolean:[self locksObjects] forKey:@"locksObjects"];
60 [_coder encodeString:[self entityName] forKey:@"entityName"];
61 [_coder encodeInt:[self fetchLimit] forKey:@"fetchLimit"];
62 [_coder encodeStruct:[self hints] forKey:@"hints"];
63 [_coder encodeObject:[self qualifier] forKey:@"qualifier"];
64 [_coder encodeObject:[self sortOrderings] forKey:@"sortOrderings"];
67 @end /* EOFetchSpecification(XmlRpcCoding) */