]> err.no Git - sope/blobdiff - sope-ical/NGiCal/NGVCardAddress.m
more work on vCard parsing
[sope] / sope-ical / NGiCal / NGVCardAddress.m
index 227c07d3e619cd4a577a128c25886c3f61cba712..3cfc7b22b1fbde8c63c54da4efebc9c0140fb946 100644 (file)
 
 @implementation NGVCardAddress
 
+- (id)initWithDictionary:(NSDictionary *)_plist group:(NSString *)_group 
+  types:(NSArray *)_types arguments:(NSDictionary *)_a
+{
+  if ((self = [super initWithGroup:_group types:_types arguments:_a]) != nil) {
+    self->pobox    = [[_plist objectForKey:@"pobox"]    copy];
+    self->extadd   = [[_plist objectForKey:@"extadd"]   copy];
+    self->street   = [[_plist objectForKey:@"street"]   copy];
+    self->locality = [[_plist objectForKey:@"locality"] copy];
+    self->region   = [[_plist objectForKey:@"region"]   copy];
+    self->pcode    = [[_plist objectForKey:@"pcode"]    copy];
+    self->country  = [[_plist objectForKey:@"country"]  copy];
+  }
+  return self;
+}
+- (id)initWithPropertyList:(id)_plist group:(NSString *)_group 
+  types:(NSArray *)_types arguments:(NSDictionary *)_a
+{
+  return [self initWithDictionary:_plist
+              group:_group types:_types arguments:_a];
+}
+
+- (id)initWithGroup:(NSString *)_group types:(NSArray *)_types
+  arguments:(NSDictionary *)_a
+{
+  return [self initWithPropertyList:nil 
+              group:_group types:_types arguments:_a];
+}
+- (id)init {
+  return [self initWithPropertyList:nil group:nil types:nil arguments:nil];
+}
+
 - (void)dealloc {
   [self->pobox    release];
   [self->extadd   release];
   return self;
 }
 
+/* description */
+
+- (void)appendAttributesToDescription:(NSMutableString *)_ms {
+  [super appendAttributesToDescription:_ms];
+  [_ms appendFormat:@" vcard=%@", [self vCardString]];
+}
+
 @end /* NGVCardAddress */