77+ results for 'nsstring' (0 ms)

Not the results you expected?

nsEditorCommands.cpp (https://github.com/diogogmt/mozilla-central.git) C++ · 954 lines

39

40 #include "nsCRT.h"

41 #include "nsString.h"

42

43 #include "nsIEditor.h"

nsIDocumentObserver.h (https://github.com/diogogmt/mozilla-central.git) C Header · 374 lines

46 class nsIStyleSheet;

47 class nsIStyleRule;

48 class nsString;

49 class nsIDocument;

50

SimpleCLexer.m (https://bitbucket.org/rlyspn/androidrr.git) Objective C · 1160 lines

35 }

36

37 + (NSString *) tokenNameForType:(NSInteger)aTokenType

38 {

39 return [[self getTokenNames] objectAtIndex:aTokenType];

XmlSchemaExporterTests.cs (https://github.com/iainlane/mono.git) C# · 1060 lines

184 public void ExportClass_StringCollection ()

185 {

186 XmlSchemas schemas = Export (typeof (StringCollection), "NSStringCollection");

187 Assert.AreEqual (1, schemas.Count, "#1");

188

192 Assert.AreEqual (Infoset (string.Format (CultureInfo.InvariantCulture,

193 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

194 "<xs:schema xmlns:tns=\"NSStringCollection\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollection\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

195 " <xs:element name=\"ArrayOfString\" nillable=\"true\" type=\"tns:ArrayOfString\" />{0}" +

196 " <xs:complexType name=\"ArrayOfString\">{0}" +

230 Assert.AreEqual (Infoset (string.Format (CultureInfo.InvariantCulture,

231 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

232 "<xs:schema xmlns:tns=\"NSStringCollectionContainer\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollectionContainer\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

233 " <xs:element name=\"StringCollectionContainer\" nillable=\"true\" type=\"tns:StringCollectionContainer\" />{0}" +

234 " <xs:complexType name=\"StringCollectionContainer\">{0}" +

SoapSchemaExporterTests.cs (https://github.com/iainlane/mono.git) C# · 1050 lines

138 public void ExportClass_StringCollection ()

139 {

140 XmlSchemas schemas = Export (typeof (StringCollection), "NSStringCollection");

141 Assert.AreEqual (1, schemas.Count, "#1");

142

147 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

148 #if NET_2_0

149 "<xs:schema xmlns:tns=\"NSStringCollection\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollection\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

150 #else

151 "<xs:schema xmlns:tns=\"NSStringCollection\" targetNamespace=\"NSStringCollection\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

176 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

177 #if NET_2_0

178 "<xs:schema xmlns:tns=\"NSStringCollectionContainer\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollectionContainer\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

179 #else

180 "<xs:schema xmlns:tns=\"NSStringCollectionContainer\" targetNamespace=\"NSStringCollectionContainer\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

hadoopfs.m (https://github.com/hyunjung/hadoop-common.git) Objective C · 2160 lines

196

197 @implementation FileStatus

198 - (id) initWithPath: (NSString *) path length: (int64_t) length isdir: (BOOL) isdir block_replication: (int16_t) block_replication blocksize: (int64_t) blocksize modification_time: (int64_t) modification_time permission: (NSString *) permission owner: (NSString *) owner group: (NSString *) group

199 {

200 self = [super init];

415 case 1:

416 if (fieldType == TType_STRING) {

417 NSString * fieldValue = [inProtocol readString];

418 [self setPath: fieldValue];

419 } else {

471 case 8:

472 if (fieldType == TType_STRING) {

473 NSString * fieldValue = [inProtocol readString];

474 [self setOwner: fieldValue];

475 } else {

ForAndroid.m (https://gitlab.com/praveenvelanati/ios-demo) Objective C · 1603 lines

27 return @"ForAndroid";

28 }

29 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix

30 {

31 NSString *nodeName = nil;

186 xmlNsPtr elementNamespace = xmlSearchNs(cur->doc, cur, [prefix xmlString]);

187

188 NSString *standardPrefix = [[USGlobals sharedInstance].wsdlStandardNamespaces objectForKey:[NSString stringWithCString:(char*)elementNamespace->href encoding:NSUTF8StringEncoding]];

189

190 elementClassString = [NSString stringWithFormat:@"%@_%@", standardPrefix, localName];

781 return @"ForAndroid";

782 }

783 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix

784 {

785 NSString *nodeName = nil;

ForAndroid.h (https://gitlab.com/praveenvelanati/ios-demo) C Header · 1232 lines

159 - (NSString *)nsPrefix;

160 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix;

161 - (void)addAttributesToNode:(xmlNodePtr)node;

162 - (void)addElementsToNode:(xmlNodePtr)node;

455 - (NSString *)nsPrefix;

456 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix;

457 - (void)addAttributesToNode:(xmlNodePtr)node;

458 - (void)addElementsToNode:(xmlNodePtr)node;

473 - (NSString *)nsPrefix;

474 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix;

475 - (void)addAttributesToNode:(xmlNodePtr)node;

476 - (void)addElementsToNode:(xmlNodePtr)node;

494 - (NSString *)nsPrefix;

495 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix;

496 - (void)addAttributesToNode:(xmlNodePtr)node;

497 - (void)addElementsToNode:(xmlNodePtr)node;

ImageNameTest.m (https://gitlab.com/boxnia/NFU_MOVIL) Objective C · 702 lines

35

36 // expose private interface

37 - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device;

38

39 @end

55 - (void) orientationHelper:(id<CDVScreenOrientationDelegate>)delegate expectedImageNameDictionary:(NSDictionary*)expectedImageNameDictionary device:(CDV_iOSDevice)device{

56

57 NSString* name = nil;

58 NSString* expectedImageName = nil;

59 UIInterfaceOrientation currentOrientation;

60 NSString* deviceName = device.iPad? @"iPad" : device.iPhone6Plus? @"iPhone6Plus": device.iPhone6? @"iPhone6": device.iPhone5? @"iPhone5" : @"iPhone";

61

62 // LandscapeLeft, should always return expectedImageName

GRMustacheNSFormatterTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 381 lines

41 // test filtering a number

42 id data = @{ @"number": number, @"percent": percentFormatter };

43 NSString *rendering = [GRMustacheTemplate renderObject:data

44 fromString:@"{{ percent(number) }}"

45 error:NULL];

54

55 // test that string is unprocessable

56 NSString *unprocessableValue = @"foo";

57 STAssertNil([percentFormatter stringForObjectValue:unprocessableValue], @"");

58

59 // test filtering a string

60 id data = @{ @"value": unprocessableValue, @"percent": percentFormatter };

61 NSString *rendering = [GRMustacheTemplate renderObject:data

62 fromString:@"{{ percent(value) }}"

63 error:NULL];

GRMustacheConfigurationTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 426 lines

72 [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeHTML;

73 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"{{subject}}" error:NULL];

74 NSString *rendering = [template renderObject:@{@"subject":@"&"} error:NULL];

75 STAssertEqualObjects(rendering, @"&amp;", @"");

76 }

80 [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeText;

81 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"{{subject}}" error:NULL];

82 NSString *rendering = [template renderObject:@{@"subject":@"&"} error:NULL];

83 STAssertEqualObjects(rendering, @"&", @"");

84 }

98 __block BOOL testedHTMLSafeDefined = NO;

99 __block BOOL testedHTMLSafe = NO;

100 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {

101 NSString *rendering = [testedTemplate renderContentWithContext:context HTMLSafe:HTMLSafe error:error];

124 __block BOOL testedHTMLSafeDefined = NO;

125 __block BOOL testedHTMLSafe = NO;

126 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {

127 NSString *rendering = [testedTemplate renderContentWithContext:context HTMLSafe:HTMLSafe error:error];

GRMustacheTemplateFromMethodsTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 400 lines

70 - (NSString *)templatePath { return [self.templateURL path]; }

71 - (NSString *)templateString { return [NSString stringWithContentsOfFile:self.templatePath encoding:NSUTF8StringEncoding error:NULL]; }

72

73 - (NSString *)parserErrorTemplateName { return @"GRMustacheTemplateFromMethodsTest_parserError"; }

91 - (NSString *)compilerErrorTemplateWrapperString { return [NSString stringWithContentsOfFile:self.compilerErrorTemplateWrapperPath encoding:NSUTF8StringEncoding error:NULL]; }

92

93 - (id)valueForKey:(NSString *)key inRendering:(NSString *)rendering

94 {

95 NSError *error;

101 }

102

103 - (NSString *)valueForStringPropertyInRendering:(NSString *)rendering

104 {

105 return [self valueForKey:@"stringProperty" inRendering:rendering];

106 }

107

108 - (NSString *)extensionOfTemplateFileInRendering:(NSString *)rendering

109 {

110 NSString *fileName = [self valueForKey:@"fileName" inRendering:rendering];

GRMustacheTagDelegateTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 830 lines

51

52 __block BOOL success = YES;

53 delegate.mustacheTagDidRenderBlock = ^(GRMustacheTag *tag, id object, NSString *rendering) {

54 success = NO;

55 };

75 return @"delegate";

76 };

77 delegate.mustacheTagDidRenderBlock = ^(GRMustacheTag *tag, id object, NSString *rendering) {

78 postRenderedObjet = object;

79 postRenderingTagType = tag.type;

82 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"---{{foo}}---" error:NULL];

83 template.baseContext = [template.baseContext contextByAddingTagDelegate:delegate];

84 NSString *rendering = [template renderObject:@{@"foo": @"value"} error:NULL];

85

86 STAssertEqualObjects(rendering, @"---delegate---", @"");

GRMustacheRenderingObjectTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 757 lines

28

29 @interface GRMustacheAttributedSectionTagHelper : NSObject<GRMustacheRendering> {

30 NSString *_attribute;

31 }

32 @property (nonatomic, copy) NSString *attribute;

40 [super dealloc];

41 }

42 - (NSString *)renderForMustacheTag:(GRMustacheTag *)tag context:(GRMustacheContext *)context HTMLSafe:(BOOL *)HTMLSafe error:(NSError **)error

43 {

44 GRMustacheTemplate *template = [tag.templateRepository templateFromString:@"attribute:{{attribute}}" error:NULL];

51 - (void)testRenderingObjectPerformsVariableRendering

52 {

53 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {

54 return @"---";

55 }];

GRBooleanTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 356 lines

80 - (BOOL)booleanInterpretationForKey:(NSString *)key inObject:(id)object

81 {

82 NSString *templateString = [NSString stringWithFormat:@"{{#%@}}YES{{/%@}}{{^%@}}NO{{/%@}}", key, key, key, key];

83 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:templateString error:NULL];

84 NSString *result = [template renderObject:object error:NULL];

103 {

104 NSDictionary *context = object ? [NSDictionary dictionaryWithObject:object forKey:@"bool"] : [NSDictionary dictionary];

105 NSString *result = [[GRMustacheTemplate templateFromString:@"<{{bool}}>" error:NULL] renderObject:context error:NULL];

106 if ([result isEqualToString:@"<>"]) {

107 return NO;

ArrayUtilTest.java (https://github.com/danielreuther/liferay-portal.git) Java · 1160 lines

259

260 @Test

261 public void testContainsStringArray() throws Exception {

262 String[] array = {"a", "b", null};

263

MNWSProvider.m (https://github.com/PPUA/PlayPhoneSDKDemoIOS.git) Objective C · 1136 lines

10

11 @interface MNWSRequestContent()

12 -(NSString*) addCurrUserSubscriptionStatusForSnId:(NSInteger) snId;

13 @end

14

20

21 @interface MNWSInfoRequestResult()

22 -(void) setError:(NSString*) errorMessage;

23 @end

24

65 }

66

67 -(void) setError:(NSString*) errorMessage {

68 _failed = YES;

69 [_errorMessage release];

GTMValidatingContainersTest.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 378 lines

68 }

69

70 - (NSString*)description {

71 return NSStringFromClass([self class]);

343 // Test bad container

344 [GTMUnitTestDevLog expectPattern:@"container does not respont to -objectEnumerator: .*"];

345 _GTMValidateContainerContainsKindOfClass([NSString string],

346 [GTMVCTestSubClass class]);

347

GTMRegexTest.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 1216 lines

31 @end

32

33 @interface NSString_GTMRegexAdditions : GTMTestCase

34 @end

35

139 - (void)testOptions {

140

141 NSString *testString = @"aaa AAA\nbbb BBB\n aaa aAa\n bbb BbB";

142

143 // default options

908 @end

909

910 @implementation NSString_GTMRegexAdditions

911 // Only partial tests to test that the call get through correctly since the

912 // above really tests them.

GTMBase64Test.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 437 lines

76

77 // Bytes to String and back

78 NSString *encodedString = [GTMBase64 stringByEncodingBytes:[data bytes]

79 length:[data length]];

80 STAssertEquals(([encodedString length] % 4), (NSUInteger)0,

122

123 // Bytes to String and back

124 NSString *encodedString = [GTMBase64 stringByEncodingBytes:[data bytes]

125 length:[data length]];

126 STAssertEquals(([encodedString length] % 4), (NSUInteger)0,

374 - (void)testErrors {

375 const int something = 0;

376 NSString *nonAscString = [NSString stringWithUTF8String:"This test ©™®๒०᠐٧"];

377

378 STAssertNil([GTMBase64 encodeData:nil], @"it worked?");

BaseControllerTest.php (https://github.com/joomla/joomla-cms.git) PHP · 993 lines

109 };

110

111 $this->assertStringContainsStringIgnoringCase('base', $controller->getName());

112 }

113

NSObject+KiwiStubAdditions.m (https://bitbucket.org/kumaranvram/ios-bootcamp.git) Objective C · 245 lines

13 #import "KWStub.h"

14

15 static NSString * const StubValueKey = @"StubValueKey";

16 static NSString * const StubSecondValueKey = @"StubSecondValueKey";

17 static NSString * const ChangeStubValueAfterTimesKey = @"ChangeStubValueAfterTimesKey";

18

19 @implementation NSObject(KiwiStubAdditions)

27 return signature;

28

29 NSString *encoding = KWEncodingForVoidMethod();

30 return [NSMethodSignature signatureWithObjCTypes:[encoding UTF8String]];

31 }

124 if ([self methodSignatureForSelector:aMessagePattern.selector] == nil) {

125 [NSException raise:@"KWStubException" format:@"cannot stub -%@ because no such method exists",

126 NSStringFromSelector(aMessagePattern.selector)];

127 }

128

AssertTest.php (https://gitlab.com/ealexis.t/trends) PHP · 1743 lines

81 * @covers PHPUnit_Framework_Assert::assertContains

82 */

83 public function testAssertArrayContainsString()

84 {

85 $this->assertContains('foo', array('foo'));

444 * @covers PHPUnit_Framework_Assert::assertContains

445 */

446 public function testAssertIteratorContainsString()

447 {

448 $this->assertContains('foo', new TestIterator(array('foo')));

460 * @covers PHPUnit_Framework_Assert::assertContains

461 */

462 public function testAssertStringContainsString()

463 {

464 $this->assertContains('foo', 'foobar');

Bundle.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 738 lines

66 }

67

68 public static String ClassesListControllerUI_ShowHideColumnsString() {

69 // TODO Auto-generated method stub

70 return null;

76 }

77

78 public static Object ClassesListControllerUI_ShowImplementationsString() {

79 // TODO Auto-generated method stub

80 return null;

201 }

202

203 public static String FieldsBrowserControllerUI_ShowHideColumnsString() {

204 // TODO Auto-generated method stub

205 return null;

SFSDataStoreFeatureReaderTest.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 441 lines

75 }

76

77 /* return geojson with linsString geometry*/

78 public String getFeatureWithLineStringGeometry() {

79 String json =

IMClient2ServGroup.pb.m (https://gitlab.com/lisit1003/TTiOSClient) Objective C · 1617 lines

108 return [C2MGroupListReq builderWithPrototype:self];

109 }

110 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {

111 if (self.hasCmdId) {

112 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];

337 return [C2MGroupListRsp builderWithPrototype:self];

338 }

339 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {

340 if (self.hasCmdId) {

341 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];

344 [output appendFormat:@"%@%@ {\n", indent, @"groupInfoList"];

345 [element writeDescriptionTo:output

346 withIndent:[NSString stringWithFormat:@"%@ ", indent]];

347 [output appendFormat:@"%@}\n", indent];

348 }];

IMClient2ServGroup.pb.h (https://gitlab.com/lisit1003/TTiOSClient) C Header · 1055 lines

199 BOOL hasGroupId_:1;

200 SInt32 cmdId;

201 NSString* groupId;

202 }

203 - (BOOL) hasCmdId;

204 - (BOOL) hasGroupId;

205 @property (readonly) SInt32 cmdId;

206 @property (readonly, strong) NSString* groupId;

207

208 + (C2MGroupUserListReq*) defaultInstance;

247

248 - (BOOL) hasGroupId;

249 - (NSString*) groupId;

250 - (C2MGroupUserListReqBuilder*) setGroupId:(NSString*) value;

262 BOOL hasGroupType_:1;

263 SInt32 cmdId;

264 NSString* groupId;

265 NSString* groupName;

IMClient2ServFile.pb.m (https://gitlab.com/lisit1003/TTiOSClient) Objective C · 1725 lines

108 return [C2FHeartBeatReq builderWithPrototype:self];

109 }

110 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {

111 if (self.hasCmdId) {

112 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];

313 return [C2FHeartBeatRsp builderWithPrototype:self];

314 }

315 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {

316 if (self.hasCmdId) {

317 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];

434 @interface C2FFileLoginReq ()

435 @property SInt32 cmdId;

436 @property (strong) NSString* userId;

437 @property (strong) NSString* token;

556 return [C2FFileLoginReq builderWithPrototype:self];

557 }

558 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {

559 if (self.hasCmdId) {

560 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];

IMClient2ServFile.pb.h (https://gitlab.com/lisit1003/TTiOSClient) C Header · 1352 lines

197 BOOL hasToken_:1;

198 SInt32 cmdId;

199 NSString* userId;

200 NSString* token;

204 - (BOOL) hasToken;

205 @property (readonly) SInt32 cmdId;

206 @property (readonly, strong) NSString* userId;

207 @property (readonly, strong) NSString* token;

248

249 - (BOOL) hasUserId;

250 - (NSString*) userId;

251 - (C2FFileLoginReqBuilder*) setUserId:(NSString*) value;

253

254 - (BOOL) hasToken;

255 - (NSString*) token;

256 - (C2FFileLoginReqBuilder*) setToken:(NSString*) value;

IMClient2ServBase.pb.h (https://gitlab.com/lisit1003/TTiOSClient) C Header · 1445 lines

358 BOOL hasOnlineStatus_:1;

359 SInt32 cmdId;

360 NSString* userId;

361 NSString* uuid;

362 NSString* clientVersion;

363 UInt32 onlineStatus;

364 }

369 - (BOOL) hasClientVersion;

370 @property (readonly) SInt32 cmdId;

371 @property (readonly, strong) NSString* userId;

372 @property (readonly, strong) NSString* uuid;

373 @property (readonly) UInt32 onlineStatus;

374 @property (readonly, strong) NSString* clientVersion;

375

376 + (C2MLoginReq*) defaultInstance;

IMBaseDefine.pb.h (https://gitlab.com/lisit1003/TTiOSClient) C Header · 1426 lines

116 BOOL hasIp_:1;

117 BOOL hasPort_:1;

118 NSString* ip;

119 UInt32 port;

120 }

121 - (BOOL) hasIp;

122 - (BOOL) hasPort;

123 @property (readonly, strong) NSString* ip;

124 @property (readonly) UInt32 port;

125

160

161 - (BOOL) hasIp;

162 - (NSString*) ip;

163 - (IpAddrBuilder*) setIp:(NSString*) value;

179 BOOL hasUserUpdated_:1;

180 BOOL hasUserType_:1;

181 NSString* userId;

182 NSString* name;

EaseActionsTest.m (https://github.com/mefistody/FlashToCocos2D.git) Objective C · 888 lines

10

11 static int sceneIdx=-1;

12 static NSString *transitions[] = {

13 @"SpriteEase",

14 @"SpriteEaseInOut",

43 sceneIdx++;

44 sceneIdx = sceneIdx % ( sizeof(transitions) / sizeof(transitions[0]) );

45 NSString *r = transitions[sceneIdx];

46 Class c = NSClassFromString(r);

47 return c;

53 if( sceneIdx < 0 )

54 sceneIdx = sizeof(transitions) / sizeof(transitions[0]) -1;

55 NSString *r = transitions[sceneIdx];

56 Class c = NSClassFromString(r);

57 return c;

GPUImageGaussianBlurFilter.m (https://gitlab.com/Mr.Tomato/VideoEffects) Objective C · 488 lines

12 #pragma mark Initialization and teardown

13

14 - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString

15 {

16 if (!(self = [super initWithFirstStageVertexShaderFromString:firstStageVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString secondStageVertexShaderFromString:secondStageVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString]))

372 }

373

374 - (void)switchToVertexShader:(NSString *)newVertexShader fragmentShader:(NSString *)newFragmentShader;

375 {

376 runSynchronouslyOnVideoProcessingQueue(^{

385 if (![filterProgram link])

386 {

387 NSString *progLog = [filterProgram programLog];

388 NSLog(@"Program link log: %@", progLog);

389 NSString *fragLog = [filterProgram fragmentShaderLog];

GPUImageDilationFilter.m (https://gitlab.com/Mr.Tomato/VideoEffects) Objective C · 431 lines

3 @implementation GPUImageDilationFilter

4

5 NSString *const kGPUImageDilationRadiusOneVertexShaderString = SHADER_STRING

6 (

7 attribute vec4 position;

27 );

28

29 NSString *const kGPUImageDilationRadiusTwoVertexShaderString = SHADER_STRING

30 (

31 attribute vec4 position;

55 );

56

57 NSString *const kGPUImageDilationRadiusThreeVertexShaderString = SHADER_STRING

58 (

59 attribute vec4 position;

YapDatabaseHooksTransaction.m (https://gitlab.com/Mr.Tomato/MeituanDemo) Objective C · 442 lines

251 * and then loop over them in "chunks" which are readily processable for extensions.

252 **/

253 - (void)handleRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids

254 {

255 if (parentConnection->parent->didRemoveObjects)

411 * and then loop over them in "chunks" which are readily processable for extensions.

412 **/

413 - (void)handleWillRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids

414 {

415 if (parentConnection->parent->willRemoveObjects)

YapDatabaseRelationshipTransaction.h (https://gitlab.com/Mr.Tomato/MeituanDemo) C Header · 437 lines

49 * The name of the edge (case sensitive).

50 **/

51 - (void)enumerateEdgesWithName:(NSString *)name

52 usingBlock:(void (^)(YapDatabaseRelationshipEdge *edge, BOOL *stop))block;

53

72 * then the sourceCollection is treated as the empty string, just like the rest of the YapDatabase framework.

73 **/

74 - (void)enumerateEdgesWithName:(NSString *)name

75 sourceKey:(NSString *)sourceKey

76 collection:(NSString *)sourceCollection

77 usingBlock:(void (^)(YapDatabaseRelationshipEdge *edge, BOOL *stop))block;

78

97 * then the destinationCollection is treated as the empty string, just like the rest of the YapDatabase framework.

98 **/

99 - (void)enumerateEdgesWithName:(NSString *)name

100 destinationKey:(NSString *)destinationKey

PFPush.h (https://gitlab.com/Raemond/Confidence) C Header · 396 lines

36 with a letter and contain only letters, numbers, dashes, and underscores.

37 */

38 - (void)setChannel:(NSString *)channel;

39

40 /*!

59 @param message The message to send in this push.

60 */

61 - (void)setMessage:(NSString *)message;

62

63 /*!

116 @result Returns whether the send succeeded.

117 */

118 + (BOOL)sendPushMessageToChannel:(NSString *)channel

119 withMessage:(NSString *)message

126 @param message The message to send.

127 */

128 + (void)sendPushMessageToChannelInBackground:(NSString *)channel

129 withMessage:(NSString *)message;

CDXMacOSXSupport.mm (https://bitbucket.org/Tsiannian/cocos2d-x.git) Objective C++ · 176 lines

31 #import "CocosDenshion.h"

32

33 NSString * const AVAudioSessionCategoryAmbient = @"AVAudioSessionCategoryAmbient";

34 NSString *const AVAudioSessionCategorySoloAmbient = @"AVAudioSessionCategorySoloAmbient";

35 NSString *const AVAudioSessionCategoryPlayback = @"AVAudioSessionCategoryPlayback";

36 NSString *const AVAudioSessionCategoryRecord = @"AVAudioSessionCategoryRecord";

37 NSString *const AVAudioSessionCategoryPlayAndRecord = @"AVAudioSessionCategoryPlayAndRecord";

38 NSString *const AVAudioSessionCategoryAudioProcessing = @"AVAudioSessionCategoryAudioProcessing";

169 - (BOOL)setActive:(BOOL)beActive error:(NSError**)outError {return YES;}

170 - (BOOL)setActive:(BOOL)beActive withFlags:(NSInteger)flags error:(NSError**)outError {return YES;}

171 - (BOOL)setCategory:(NSString*)theCategory error:(NSError**)outError {return YES;}

172 - (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError**)outError {return YES;}

173 - (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError**)outError {return YES;}

CocosDenshion.m (https://bitbucket.org/Tsiannian/cocos2d-x.git) Objective C · 1641 lines

59 }

60

61 NSString * const kCDN_BadAlContext = @"kCDN_BadAlContext";

62 NSString * const kCDN_AsynchLoadComplete = @"kCDN_AsynchLoadComplete";

83 @implementation CDUtilities

84

85 +(NSString*) fullPathFromRelativePath:(NSString*) relPath

86 {

87 // do not convert an absolute path (starting with '/')

92

93 NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]];

94 NSString *file = [imagePathComponents lastObject];

95

96 [imagePathComponents removeLastObject];

97 NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents];

98

99 NSString *fullpath = [[NSBundle mainBundle] pathForResource:file ofType:nil inDirectory:imageDirectory];

MSRestV1.m (https://github.com/heatxsink/myspace-iphone-sdk.git) Objective C · 520 lines

165 friendsList = [friendsList substringToIndex:[friendsList length] - 1];

166

167 NSString *urlString = [NSString stringWithFormat:MS_V1_FRIENDSHIP, [NSString stringWithFormat: @"%d", userId],

168 friendsList];

169 return [self makeRawV1Request:urlString queryParameters:nil requestMethod:@"GET" requestBody:nil contentType:nil];

380 }

381

382 - (void) sendNotification: (NSInteger) appId recipients: (NSArray*) recipients content: (NSString*) content button0Surface:(NSString*) button0Surface button0Label:(NSString*) button0Label button1Surface:(NSString*) button1Surface button1Label:(NSString*) button1Label mediaItem: (NSString*) mediaItem

383 {

384

387 #pragma mark --Activities--

388

389 - (NSString*) getActivities:(NSString*) userId activityTypes:(NSString*)activityTypes extensions:(NSString*)extensions

390 composite:(NSString*)composite culture:(NSString*)culture datetime:(NSString*)dateTime pageSize:(NSString*)pageSize{

396 - (NSString*) getFriendActivities:(NSString*) userId activityTypes:(NSString*)activityTypes extensions:(NSString*)extensions

397 composite:(NSString*)composite culture:(NSString*)culture datetime:(NSString*)dateTime pageSize:(NSString*)pageSize{

398 NSString *urlString = [NSString stringWithFormat:MS_V1_FRIEND_ACTIVITIES, userId];

NSManagedObject+MagicalRecord.m (https://github.com/zipmark/MagicalRecord.git) Objective C · 675 lines

78 else

79 {

80 NSString *entityName = NSStringFromClass([self class]);

81 return [NSEntityDescription entityForName:entityName inManagedObjectContext:context];

82 }

576 }

577

578 + (NSArray *)findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending

579 {

580 return [self findByAttribute:attribute

594 else

595 {

596 NSString *entityName = NSStringFromClass([self class]);

597 return [NSEntityDescription insertNewObjectForEntityForName:entityName inManagedObjectContext:context];

598 }

NSManagedObject+MagicalFinders.m (https://bitbucket.org/sensicalapps/trybe.git) Objective C · 346 lines

194 }

195

196 + (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context

197 {

198 NSPredicate *searchTerm = [NSPredicate predicateWithFormat:@"%K = %@", attribute, searchValue];

220 + (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request delegate:(id<NSFetchedResultsControllerDelegate>)delegate useFileCache:(BOOL)useFileCache groupedBy:(NSString *)groupKeyPath inContext:(NSManagedObjectContext *)context

221 {

222 NSString *cacheName = useFileCache ? [NSString stringWithFormat:@"MagicalRecord-Cache-%@", NSStringFromClass([self class])] : nil;

223

224 NSFetchedResultsController *controller =

332 }

333

334 + (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id<NSFetchedResultsControllerDelegate>)delegate

335 {

336 return [self MR_fetchAllSortedBy:sortTerm

CaptainHook.h (https://bitbucket.org/iamchadcary/iosopendev.git) C Header · 550 lines

29 #define CHNothing() do { } while(0)

30

31 #define CHLocationInSource [NSString stringWithFormat:@CHStringify(__LINE__) " in %s", __FUNCTION__]

32

33 #define CHLog(args...) NSLog(@CHAppName ": %@", [NSString stringWithFormat:args])

34 #define CHLogSource(args...) NSLog(@CHAppName " @ " CHStringify(__LINE__) " in %s: %@", __FUNCTION__, [NSString stringWithFormat:args])

35

36 #ifdef CHDebug

GBObjectiveCParser-MethodsParsingTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 580 lines

38 GBStore *store = [[GBStore alloc] init];

39 // execute

40 [parser parseObjectsFromString:@"@interface MyClass -(id)method:(NSString*)var; @end" sourceFile:@"filename.h" toStore:store];

41 // verify

42 GBClassData *class = [[store classes] anyObject];

43 NSArray *methods = [[class methods] methods];

44 assertThatInteger([methods count], equalToInteger(1));

45 [self assertMethod:[methods objectAtIndex:0] matchesInstanceComponents:@"id", @"method", @"NSString", @"*", @"var", nil];

46 }

47

132 GBStore *store = [[GBStore alloc] init];

133 // execute

134 [parser parseObjectsFromString:@"@implementation MyClass -(id)method:(NSString*)var { } @end" sourceFile:@"filename.h" toStore:store];

135 // verify

136 GBClassData *class = [[store classes] anyObject];

GBCommentsProcessor-RegistrationsTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 510 lines

21

22 - (OCMockObject *)settingsProviderRepeatFirst:(BOOL)repeat;

23 - (void)assertFindCommentWithString:(NSString *)string matchesBlockRange:(NSRange)b shortRange:(NSRange)s;

24

25 @end

494 }

495

496 - (void)assertFindCommentWithString:(NSString *)string matchesBlockRange:(NSRange)b shortRange:(NSRange)s {

497 // setup

498 GBCommentsProcessor *processor = [GBCommentsProcessor processorWithSettingsProvider:[GBTestObjectsRegistry realSettingsProvider]];

GBCommentsProcessor-PreprocessingTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 631 lines

13

14 @interface GBCommentsProcessor (PrivateAPI)

15 - (NSString *)stringByPreprocessingString:(NSString *)string withFlags:(NSUInteger)flags;

16 - (NSString *)stringByConvertingCrossReferencesInString:(NSString *)string withFlags:(NSUInteger)flags;

37 GBCommentsProcessor *processor = [self defaultProcessor];

38 // execute

39 NSString *result1 = [processor stringByPreprocessingString:@"*bold1* *bold text* * bolder text *" withFlags:0];

40 NSString *result2 = [processor stringByPreprocessingString:@"*bold1* Middle *bold text*" withFlags:0];

48 GBCommentsProcessor *processor = [self defaultProcessor];

49 // execute

50 NSString *result1 = [processor stringByPreprocessingString:@"_bold1_ _bold text_ _ bolder text _" withFlags:0];

51 NSString *result2 = [processor stringByPreprocessingString:@"_bold1_ Middle _bold text_" withFlags:0];

59 GBCommentsProcessor *processor = [self defaultProcessor];

60 // execute

61 NSString *result = [processor stringByPreprocessingString:@"_*text1*_ *_marked text_* _* text2 *_" withFlags:0];

62 // verify

63 assertThat(result, is(@"_*text1*_ *_marked text_* _* text2 *_"));

DDXMLTesting.m (https://github.com/GunioRobot/iphone-dev-libraries.git) Objective C · 838 lines

59 + (void)testLocalName

60 {

61 NSLog(@"Starting %@...", NSStringFromSelector(_cmd));

62

63 NSString *nsTest1 = [NSXMLNode localNameForName:@"a:quack"];

64 NSString *ddTest1 = [DDXMLNode localNameForName:@"a:quack"];

65

66 NSAssert([nsTest1 isEqualToString:ddTest1], @"Failed test 1");

67

68 NSString *nsTest2 = [NSXMLNode localNameForName:@"a:a:quack"];

69 NSString *ddTest2 = [DDXMLNode localNameForName:@"a:a:quack"];

71 NSAssert([nsTest2 isEqualToString:ddTest2], @"Failed test 2");

72

73 NSString *nsTest3 = [NSXMLNode localNameForName:@"quack"];

74 NSString *ddTest3 = [DDXMLNode localNameForName:@"quack"];

TDPredicateEvaluator.m (https://github.com/livedo/fluidium.git) Objective C · 656 lines

8

9 #import "TDPredicateEvaluator.h"

10 #import "NSString+ParseKitAdditions.h"

11

12 // expr = term orTerm*

80

81

82 - (BOOL)evaluate:(NSString *)s {

83 PKAssembly *a = [PKTokenAssembly assemblyWithString:s];

84 return [[[self.exprParser completeMatchFor:a] pop] boolValue];

473

474 - (void)didMatchEqStringPredicate:(PKAssembly *)a {

475 NSString *value = [a pop];

476 NSString *attrKey = [a pop];

482 - (void)didMatchEqNumberPredicate:(PKAssembly *)a {

483 NSNumber *value = [a pop];

484 NSString *attrKey = [a pop];

485 BOOL yn = [value isEqualToNumber:[delegate valueForAttributeKey:attrKey]];

486 [a push:[NSNumber numberWithBool:yn]];

SearchResults.ascx.cs (https://bitbucket.org/kudutest2/kenticogit.git) C# · 698 lines

121 get

122 {

123 return CMS.SiteProvider.SearchHelper.GetSearchOptionsEnum(ValidationHelper.GetString(GetValue("SearchOptions"), CMS.SiteProvider.SearchHelper.GetSearchOptionsString(srchResults.SearchOptions)));

124 }

125 set

126 {

127 SetValue("SearchOptions", CMS.SiteProvider.SearchHelper.GetSearchOptionsString(value));

128 srchResults.SearchOptions = value;

129 }

SearchDialogWithResults.ascx.cs (https://bitbucket.org/kudutest2/kenticogit.git) C# · 791 lines

221 get

222 {

223 return CMS.SiteProvider.SearchHelper.GetSearchOptionsEnum(ValidationHelper.GetString(this.GetValue("SearchOptions"), CMS.SiteProvider.SearchHelper.GetSearchOptionsString(srchResults.SearchOptions)));

224 }

225 set

226 {

227 this.SetValue("SearchOptions", CMS.SiteProvider.SearchHelper.GetSearchOptionsString(value));

228 srchResults.SearchOptions = value;

229 }

IQUIView+IQKeyboardToolbar.h (https://gitlab.com/RainGu/mercymap) C Header · 357 lines

215 @param rightButtonAction Right button action name. Usually 'doneAction:(IQBarButtonItem*)item'.

216 */

217 - (void)addLeftRightOnKeyboardWithTarget:(nullable id)target leftButtonTitle:(nullable NSString*)leftButtonTitle rightButtonTitle:(nullable NSString*)rightButtonTitle leftButtonAction:(nullable SEL)leftButtonAction rightButtonAction:(nullable SEL)rightButtonAction;

218

219 /**

227 @param titleText text to show as title in IQToolbar'.

228 */

229 - (void)addLeftRightOnKeyboardWithTarget:(nullable id)target leftButtonTitle:(nullable NSString*)leftButtonTitle rightButtonTitle:(nullable NSString*)rightButtonTitle leftButtonAction:(nullable SEL)leftButtonAction rightButtonAction:(nullable SEL)rightButtonAction titleText:(nullable NSString*)titleText;

230

231 /**

302 @param titleText text to show as title in IQToolbar'.

303 */

304 - (void)addPreviousNextRightOnKeyboardWithTarget:(nullable id)target rightButtonTitle:(nullable NSString*)rightButtonTitle previousAction:(nullable SEL)previousAction nextAction:(nullable SEL)nextAction rightButtonAction:(nullable SEL)rightButtonAction titleText:(nullable NSString*)titleText;

305

306 /**

access-builder.cc (https://gitlab.com/AnneSmile/v8) C++ · 714 lines

439

440 // static

441 FieldAccess AccessBuilder::ForConsStringFirst() {

442 FieldAccess access = {

443 kTaggedBase, ConsString::kFirstOffset, Handle<Name>(),

447

448 // static

449 FieldAccess AccessBuilder::ForConsStringSecond() {

450 FieldAccess access = {

451 kTaggedBase, ConsString::kSecondOffset, Handle<Name>(),

KSJSONTests.m (https://github.com/kstenerud/KSJSON.git) Objective C · 1112 lines

36 {

37 NSError* error = (NSError*)self;

38 NSString* expected = @"[]";

39 id original = [NSArray array];

40 NSString* jsonString = [KSJSON serializeObject:original error:&error];

797 }

798

799 NSString* expected = [NSString stringWithFormat:@"[\"%@\"]", string];

800 id original = [NSArray arrayWithObjects:

801 string,

817 memset(buff, '2', sizeof(buff));

818 buff[sizeof(buff)-1] = 0;

819 NSString* string = [NSString stringWithCString:buff encoding:NSUTF8StringEncoding];

820

821 id original = [NSArray arrayWithObjects:

SoapSchemaExporterTests.cs (https://github.com/t-ashula/mono.git) C# · 950 lines

119 public void ExportClass_StringCollection ()

120 {

121 XmlSchemas schemas = Export (typeof (StringCollection), "NSStringCollection");

122 Assert.AreEqual (1, schemas.Count, "#1");

123

127 Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,

128 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

129 "<xs:schema xmlns:tns=\"NSStringCollection\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollection\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

130 " <xs:import namespace=\"http://schemas.xmlsoap.org/soap/encoding/\" />{0}" +

131 " <xs:import namespace=\"http://schemas.xmlsoap.org/wsdl/\" />{0}" +

152 Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,

153 "<?xml version=\"1.0\" encoding=\"utf-16\"?>{0}" +

154 "<xs:schema xmlns:tns=\"NSStringCollectionContainer\" elementFormDefault=\"qualified\" targetNamespace=\"NSStringCollectionContainer\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">{0}" +

155 " <xs:import namespace=\"http://schemas.xmlsoap.org/soap/encoding/\" />{0}" +

156 " <xs:import namespace=\"http://schemas.xmlsoap.org/wsdl/\" />{0}" +

AssertTest.php (https://github.com/grjones/qframe.git) PHP · 2141 lines

98 }

99

100 public function testAssertArrayContainsString()

101 {

102 $this->assertContains('foo', array('foo'));

190 }

191

192 public function testAssertIteratorContainsString()

193 {

194 $this->assertContains('foo', new TestIterator(array('foo')));

205 }

206

207 public function testAssertStringContainsString()

208 {

209 $this->assertContains('foo', 'foobar');

HBAudio.m (https://github.com/shkolnik/HandBrake.git) Objective C · 708 lines

10 #import "hb.h"

11

12 NSString *keyAudioCodecName = @"keyAudioCodecName";

13 NSString *keyAudioMP4 = @"keyAudioMP4";

14 NSString *keyAudioMKV = @"keyAudioMKV";

15 NSString *keyAudioSampleRateName = @"keyAudioSampleRateName";

16 NSString *keyAudioBitrateName = @"keyAudioBitrateName";

17 NSString *keyAudioMustMatchTrack = @"keyAudioMustMatchTrack";

18 NSString *keyAudioMixdownName = @"keyAudioMixdownName";

19

20 NSString *keyAudioCodec = @"codec";

21 NSString *keyAudioMixdown = @"mixdown";

22 NSString *keyAudioSamplerate = @"samplerate";

BlackJackViewController.m (https://github.com/chao87/BlackJack.git) Objective C · 584 lines

210 //score.text = [score.text stringByAppendingString: [NSString stringWithFormat: @"%i", [guest handTotal]]];

211 NSString* guestTotal = [NSString stringWithFormat: @"%i", [guest handTotal]];

212 NSString* dealerTotal = [NSString stringWithFormat: @"%i", [dealer handTotal]];

213

214 NSString* result = [[NSString alloc] initWithString:@" Guest Total is: "];

215 result = [result stringByAppendingString:guestTotal];

216 result = [result stringByAppendingString:@" - Dealer total is: "];

BXThemes.m (https://github.com/alunbestor/Boxer.git) Objective C · 813 lines

15 @implementation NSObject (BXThemableExtensions)

16

17 + (NSString *) defaultThemeKey

18 {

19 return nil;

32 @implementation NSControl (BXThemedControls)

33

34 + (NSString *) defaultThemeKey

35 {

36 if ([[self cellClass] respondsToSelector: _cmd])

40 }

41

42 - (void) setThemeKey: (NSString *)key

43 {

44 if ([self.cell respondsToSelector: _cmd])

libcdio-0.81-add-cdtextinfo.patch (https://github.com/SIFTeam/openembedded.git) Patch · 337 lines

98 + " [-?|--help] [--usage]\n";

99 +

100 + const char* optionsString = "alTDP:x?";

101 + struct option optionsTable[] = {

102 + {"album", no_argument, NULL, 'a' },

115 + };

116 +

117 + while ((opt = getopt_long(argc, argv, optionsString, optionsTable, NULL)) >= 0) {

118 + switch (opt) {

119 + case 'a': options.album = true; break;

PolyfillTestCase.php (https://github.com/fabpot/composer.git) PHP · 762 lines

19 use PHPUnit\Framework\Constraint\TraversableContains;

20

21 if (method_exists('PHPUnit\Framework\TestCase', 'assertStringContainsString')) {

22 abstract class PolyfillTestCase extends TestCase {}

23 } else {

113 * @return void

114 */

115 public static function assertStringContainsString($needle, $haystack, $message = '')

116 {

117 $constraint = new StringContains($needle, false);

126 * @return void

127 */

128 public static function assertStringContainsStringIgnoringCase($needle, $haystack, $message = '')

129 {

130 $constraint = new StringContains($needle, true);

WeiboClient.m (https://github.com/tianyawy/WeiboSDK.git) Objective C · 664 lines

55 {

56 needAuth = YES;

57 NSString *path = [NSString stringWithFormat:@"statuses/friends_timeline.%@", API_FORMAT];

58

59 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];

297 {

298 needAuth = YES;

299 NSString *path = [NSString stringWithFormat:@"trends/statuses.%@", API_FORMAT];

300

301 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];

597 {

598 needAuth = YES;

599 NSString *path = [NSString stringWithFormat:@"statuses/upload.%@", API_FORMAT];

600 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:

601 status, @"status",

EmojiDataSource.m (https://github.com/tianyawy/WeiboSDK.git) Objective C · 544 lines

14 @implementation EmojiDataSource

15

16 + (void)insertEmoji:(NSString *)_emoji phrase:(NSString *)_phrase forType:(NSString *)_type {

17 NSMutableArray *emojiList = [gEmojies objectForKey:_type];

18 if (emojiList == nil) {

37 }

38

39 + (NSMutableArray *)getEmojiNodes:(NSString *)_type {

40 NSMutableDictionary *_emojies = [EmojiDataSource emojies];

41 return [_emojies objectForKey:_type];

46 return gRecentEmojies;

47 }

48 NSString *filePath = [WeiboEngine getCurrentUserStoreagePath:@"recentEmojiNodes.db"];

49 NSMutableArray *_recentEmojies = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];

50 gRecentEmojies = [_recentEmojies retain];

DSAdmin.m (https://bitbucket.org/danielsantb/aula-datasnap-e-aurelius.git) Objective C · 719 lines

515 * @return result - Type on server: TJSONValue

516 */

517 -(TJSONValue *) ConsumeClientChannel: (NSString *) channelname withClientManagerId: (NSString *) clientmanagerid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken withResponseData: (TJSONValue *) responsedata{

518

519 DSRESTCommand * cmd = [[self Connection ] CreateCommand];

544 * @return result - Type on server: TJSONValue

545 */

546 -(TJSONValue *) ConsumeClientChannelTimeout: (NSString *) channelname withClientManagerId: (NSString *) clientmanagerid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken withTimeout: (long) timeout withResponseData: (TJSONValue *) responsedata{

547

548 DSRESTCommand * cmd = [[self Connection ] CreateCommand];

591 * @return result - Type on server: Boolean

592 */

593 -(bool) RegisterClientCallbackServer: (NSString *) channelid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken{

594

595 DSRESTCommand * cmd = [[self Connection ] CreateCommand];

CCScale9Sprite.m (https://bitbucket.org/mfavis/fixierush.git) Objective C · 685 lines

84 }

85

86 - (id)initWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets

87 {

88 NSAssert(file != nil, @"Invalid file for sprite");

93 }

94

95 + (id)spriteWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets

96 {

97 return SAFE_ARC_AUTORELEASE([[self alloc] initWithFile:file rect:rect capInsets:capInsets]);

98 }

99

100 - (id)initWithFile:(NSString *)file rect:(CGRect)rect

101 {

102 NSAssert(file != nil, @"Invalid file for sprite");

bag.c (https://gitlab.com/steinret/CodeVault) C · 736 lines

421 if (nitem->dtype == PETSC_CHAR) {

422 char *value = (char*)(((char*)bag) + nitem->offset);

423 ierr = PetscOptionsString(name,nitem->help,"",value,value,nitem->msize,PETSC_NULL);CHKERRQ(ierr);

424 } else if (nitem->dtype == PETSC_REAL) {

425 PetscReal *value = (PetscReal*)(((char*)bag) + nitem->offset);

TGToolbarButton.m (https://gitlab.com/iranjith4/Telegram) Objective C · 648 lines

207 @interface TGToolbarButton ()

208 {

209 NSString *_text;

210 UIImage *_image;

211 UIImage *_imageLandscape;

400 }

401

402 - (NSString *)text

403 {

404 return _text;

405 }

406

407 - (void)setText:(NSString *)text

408 {

409 _text = text;

TGConversation.m (https://gitlab.com/iranjith4/Telegram) Objective C · 791 lines

354 ptr += length;

355

356 participantsData.exportedChatInviteString = [[NSString alloc] initWithData:linkData encoding:NSUTF8StringEncoding];

357 }

358

673 for (int i = 0; i < 3; i++)

674 {

675 NSString *value = nil;

676 if (i == 0)

677 value = _chatPhotoSmall;

707 [data getBytes:valueBytes range:NSMakeRange(ptr, length)];

708 ptr += length;

709 NSString *value = [[NSString alloc] initWithBytesNoCopy:valueBytes length:length encoding:NSUTF8StringEncoding freeWhenDone:true];

710

711 if (i == 0)

TLMetaConstructor.mm (https://gitlab.com/iranjith4/Telegram) Objective C++ · 1040 lines

55 {

56 NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];

57 [userInfo setValue:[NSString stringWithFormat:@"Object with name %.8x not found", name] forKey:NSLocalizedDescriptionKey];

58 *error = [[NSError alloc] initWithDomain:@"TL" code:-1 userInfo:userInfo];

59 }

664 if (type.boxed)

665 [os writeInt32:TL_STRING_CONSTRUCTOR];

666 NSString *string = value.nativeObject;

667 [os writeString:string];

668 break;

672 if (type.boxed)

673 [os writeInt32:TL_BYTES_CONSTRUCTOR];

674 NSString *string = value.nativeObject;

675 [os writeBytes:[string dataUsingEncoding:NSUTF8StringEncoding]];

676 break;

SecretLayer23.h (https://gitlab.com/iranjith4/Telegram) C Header · 491 lines

318 @property (nonatomic, strong, readonly) NSNumber * randomId;

319

320 + (Secret23_DecryptedMessage_decryptedMessage *)decryptedMessageWithRandomId:(NSNumber *)randomId ttl:(NSNumber *)ttl message:(NSString *)message media:(Secret23_DecryptedMessageMedia *)media;

321 + (Secret23_DecryptedMessage_decryptedMessageService *)decryptedMessageServiceWithRandomId:(NSNumber *)randomId action:(Secret23_DecryptedMessageAction *)action;

322

326

327 @property (nonatomic, strong, readonly) NSNumber * ttl;

328 @property (nonatomic, strong, readonly) NSString * message;

329 @property (nonatomic, strong, readonly) Secret23_DecryptedMessageMedia * media;

330

390 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaPhoto *)decryptedMessageMediaPhotoWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH w:(NSNumber *)w h:(NSNumber *)h size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

391 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaGeoPoint *)decryptedMessageMediaGeoPointWithLat:(NSNumber *)lat plong:(NSNumber *)plong;

392 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaContact *)decryptedMessageMediaContactWithPhoneNumber:(NSString *)phoneNumber firstName:(NSString *)firstName lastName:(NSString *)lastName userId:(NSNumber *)userId;

393 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaDocument *)decryptedMessageMediaDocumentWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH fileName:(NSString *)fileName mimeType:(NSString *)mimeType size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

394 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaVideo *)decryptedMessageMediaVideoWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH duration:(NSNumber *)duration mimeType:(NSString *)mimeType w:(NSNumber *)w h:(NSNumber *)h size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

395 + (Secret23_DecryptedMessageMedia_decryptedMessageMediaAudio *)decryptedMessageMediaAudioWithDuration:(NSNumber *)duration mimeType:(NSString *)mimeType size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

SecretLayer20.h (https://gitlab.com/iranjith4/Telegram) C Header · 357 lines

253

254 @property (nonatomic, strong, readonly) NSNumber * ttl;

255 @property (nonatomic, strong, readonly) NSString * message;

256 @property (nonatomic, strong, readonly) Secret20_DecryptedMessageMedia * media;

257

270 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaPhoto *)decryptedMessageMediaPhotoWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH w:(NSNumber *)w h:(NSNumber *)h size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

271 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaGeoPoint *)decryptedMessageMediaGeoPointWithLat:(NSNumber *)lat plong:(NSNumber *)plong;

272 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaContact *)decryptedMessageMediaContactWithPhoneNumber:(NSString *)phoneNumber firstName:(NSString *)firstName lastName:(NSString *)lastName userId:(NSNumber *)userId;

273 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaDocument *)decryptedMessageMediaDocumentWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH fileName:(NSString *)fileName mimeType:(NSString *)mimeType size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

274 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaVideo *)decryptedMessageMediaVideoWithThumb:(NSData *)thumb thumbW:(NSNumber *)thumbW thumbH:(NSNumber *)thumbH duration:(NSNumber *)duration mimeType:(NSString *)mimeType w:(NSNumber *)w h:(NSNumber *)h size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

275 + (Secret20_DecryptedMessageMedia_decryptedMessageMediaAudio *)decryptedMessageMediaAudioWithDuration:(NSNumber *)duration mimeType:(NSString *)mimeType size:(NSNumber *)size key:(NSData *)key iv:(NSData *)iv;

303 @interface Secret20_DecryptedMessageMedia_decryptedMessageMediaContact : Secret20_DecryptedMessageMedia

304

305 @property (nonatomic, strong, readonly) NSString * phoneNumber;

306 @property (nonatomic, strong, readonly) NSString * firstName;

PSKeyValueDecoder.m (https://gitlab.com/iranjith4/Telegram) Objective C · 599 lines

56 uint32_t stringLength = readLength(currentPtr);

57

58 NSString *string = [[NSString alloc] initWithBytes:*currentPtr length:stringLength encoding:NSUTF8StringEncoding];

59 (*currentPtr) += stringLength;

60 return string;

334 }

335

336 - (NSString *)decodeStringForKey:(NSString *)key

337 {

338 NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding];

545 {

546 uint32_t keyLength = readLength(&self->_currentPtr);

547 NSString *key = [[NSString alloc] initWithBytes:self->_currentPtr length:keyLength encoding:NSUTF8StringEncoding];

548 self->_currentPtr += keyLength;

549

PFPush.h (https://gitlab.com/iranjith4/perksAppsaholic) C Header · 523 lines

40 The channel name must start with a letter and contain only letters, numbers, dashes, and underscores.

41 */

42 - (void)setChannel:(NSString *)channel;

43

44 /*!

66 @param message The message to send in this push.

67 */

68 - (void)setMessage:(NSString *)message;

69

70 /*!

143 @returns Returns whether the send succeeded.

144 */

145 + (BOOL)sendPushMessageToChannel:(NSString *)channel

146 withMessage:(NSString *)message

156 @returns The task, that encapsulates the work being done.

157 */

158 + (BFTask *)sendPushMessageToChannelInBackground:(NSString *)channel

159 withMessage:(NSString *)message;

SQLiteDatabaseTest.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 600 lines

28 ///--------------------------------------

29

30 - (NSString *)databasePath {

31 return [NSTemporaryDirectory() stringByAppendingPathComponent:@"test.db"];

32 }

ObjectSubclassingControllerTests.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 422 lines

47 @implementation TestSubclass

48

49 + (NSString *)parseClassName {

50 return @"TestSubclass";

51 }

55 @implementation NotSubclass

56

57 + (NSString *)parseClassName {

58 return @"TestSubclass";

59 }

65 @dynamic primitiveProperty, objectProperty, relationProperty, ivarProperty, aCopyProperty, badProperty, badRelation;

66

67 + (NSString *)parseClassName {

68 return @"PropertySubclass";

69 }

ObjectPinTests.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 540 lines

26 ///--------------------------------------

27

28 - (id)mockPinObjects:(NSArray *)objects withPinName:(NSString *)pinName error:(NSError *)error {

29 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);

30 [Parse _currentManager].coreManager.pinningObjectStore = store;

38 }

39

40 - (id)mockUnpinObjects:(NSArray *)objects withPinName:(NSString *)pinName error:(NSError *)error {

41 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);

42 [Parse _currentManager].coreManager.pinningObjectStore = store;

48 }

49

50 - (id)mockUnpinAllObjectsWithPinName:(NSString *)pinName error:(NSError *)error {

51 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);

52 [Parse _currentManager].coreManager.pinningObjectStore = store;

PFQueryUtilities.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 536 lines

521 Begin another literal block.

522 */

523 + (NSString *)regexStringForString:(NSString *)string {

524 return [NSString stringWithFormat:@"\\Q%@\\E", [string stringByReplacingOccurrencesOfString:@"\\E"

MNStepperTableViewCell.m (https://bitbucket.org/aquarius/mnkit/) Objective C · 68 lines ✨ Summary

This Objective-C code defines a custom table view cell class MNStepperTableViewCell. It creates a cell with a stepper control and adjusts its layout to fit within the cell’s bounds, positioning the text label and stepper control side by side. The cell is designed for use in a table view, allowing users to interact with the stepper control to adjust values.

27 }

28

29 - (id)initWithCellIdentifier:(NSString *)cellID

30 {

31 self = [super initWithCellIdentifier:cellID];