From 44b079b794e7aaa938b0bc5e8c63e4be171633af Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Sun, 1 May 2016 15:57:40 -0700 Subject: [PATCH] Cosmetic refactoring - Update copyright header - Move private variables to .m file --- MP4Atom.h | 15 +++++---------- MP4Atom.m | 13 +++++++------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/MP4Atom.h b/MP4Atom.h index 2d07cb6..8713547 100644 --- a/MP4Atom.h +++ b/MP4Atom.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2009, Oleksandr Tymoshenko +// Copyright (c) 2009-2016 Oleksandr Tymoshenko // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -32,16 +32,11 @@ #define ITUNES_METADATA_IMAGE_CLASS 0x0e #define ITUNES_METADATA_UINT8_CLASS 0x15 -@interface MP4Atom : NSObject { - NSString *name; - UInt32 length; - NSArray *children; - UInt64 offset; -} +@interface MP4Atom : NSObject -@property(readwrite, copy) NSString *name; -@property(readwrite, assign) UInt32 length; -@property(readwrite, assign) UInt64 offset; +@property (copy) NSString *name; +@property (assign) UInt32 length; +@property (assign) UInt64 offset; -(id) initWithName:(NSString*)atom andLength:(UInt32)length; -(id) initWithHeaderData:(NSData*)data andOffset: (UInt64)offset; diff --git a/MP4Atom.m b/MP4Atom.m index ff764eb..e3b5d5f 100644 --- a/MP4Atom.m +++ b/MP4Atom.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2009, Oleksandr Tymoshenko +// Copyright (c) 2009-2016 Oleksandr Tymoshenko // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -27,12 +27,13 @@ #import "MP4Atom.h" +@interface MP4Atom() { + NSArray *children; +} -@implementation MP4Atom +@end -@synthesize length; -@synthesize offset; -@synthesize name; +@implementation MP4Atom -(id) initWithName: (NSString*)atom andLength:(UInt32)len; { @@ -76,7 +77,7 @@ -(NSData*)encode } hdr; hdr.beLength = htonl(self.length); - NSAssert([name getCString:hdr.name maxLength:5 encoding:NSMacOSRomanStringEncoding], + NSAssert([self.name getCString:hdr.name maxLength:5 encoding:NSMacOSRomanStringEncoding], @"Failed to convert tag name"); NSData *data = [NSData dataWithBytes:&hdr length:8]; return data;