diff options
Diffstat (limited to 'media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework')
6 files changed, 137 insertions, 0 deletions
diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings new file mode 100644 index 000000000..88f65cf6e --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/Info.plist b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/Info.plist new file mode 100644 index 000000000..a791b3ee4 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/Info.plist @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME:identifier}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>NSPrincipalClass</key> + <string></string> +</dict> +</plist> diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.h b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.h new file mode 100644 index 000000000..c2450960c --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.h @@ -0,0 +1,28 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <Cocoa/Cocoa.h> + +#ifdef __cplusplus +struct ObjCVectorImp; +#else +typedef struct _ObjCVectorImpT ObjCVectorImp; +#endif + +@interface ObjCVector : NSObject { + @private + ObjCVectorImp* imp_; +} + +- (id)init; + +- (void)addObject:(id)obj; +- (void)addObject:(id)obj atIndex:(NSUInteger)index; + +- (void)removeObject:(id)obj; +- (void)removeObjectAtIndex:(NSUInteger)index; + +- (id)objectAtIndex:(NSUInteger)index; + +@end diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.mm b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.mm new file mode 100644 index 000000000..cbf431f28 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVector.mm @@ -0,0 +1,63 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ObjCVectorInternal.h" +#import "ObjCVector.h" + +#include <vector> + +@interface ObjCVector (Private) +- (std::vector<id>::iterator)makeIterator:(NSUInteger)index; +@end + +@implementation ObjCVector + +- (id)init { + if ((self = [super init])) { + imp_ = new ObjCVectorImp(); + } + return self; +} + +- (void)dealloc { + delete imp_; + [super dealloc]; +} + +- (void)addObject:(id)obj { + imp_->v.push_back([obj retain]); +} + +- (void)addObject:(id)obj atIndex:(NSUInteger)index { + imp_->v.insert([self makeIterator:index], [obj retain]); +} + +- (void)removeObject:(id)obj { + for (std::vector<id>::iterator it = imp_->v.begin(); + it != imp_->v.end(); + ++it) { + if ([*it isEqual:obj]) { + [*it autorelease]; + imp_->v.erase(it); + return; + } + } +} + +- (void)removeObjectAtIndex:(NSUInteger)index { + [imp_->v[index] autorelease]; + imp_->v.erase([self makeIterator:index]); +} + +- (id)objectAtIndex:(NSUInteger)index { + return imp_->v[index]; +} + +- (std::vector<id>::iterator)makeIterator:(NSUInteger)index { + std::vector<id>::iterator it = imp_->v.begin(); + it += index; + return it; +} + +@end diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h new file mode 100644 index 000000000..fb6c98258 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h @@ -0,0 +1,9 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <vector> + +struct ObjCVectorImp { + std::vector<id> v; +}; diff --git a/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch new file mode 100644 index 000000000..394f41d95 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'TestFramework' target in the 'TestFramework' project. +// + +#ifdef __OBJC__ + #import <Cocoa/Cocoa.h> +#endif |