Skip to content

Commit 9a5922f

Browse files
Changed enum type SqliteValueType to OPTLYSqliteValueType (#271)
* changed enum type SqliteValueType to OPTLYSqliteValueType * Copyright headers updated
1 parent 5407ab3 commit 9a5922f

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

OptimizelySDKShared/OPTLYFMDB/src/optlyfmdb/OPTLYFMDBDatabase.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Modifications to FMDB by Optimizely, Inc. *
3-
* Copyright 2017, Optimizely, Inc. and contributors *
3+
* Copyright 2018, Optimizely, Inc. and contributors *
44
* *
55
* Licensed under the Apache License, Version 2.0 (the "License"); *
66
* you may not use this file except in compliance with the License. *
@@ -1039,12 +1039,12 @@ typedef int(^OPTLYFMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDicti
10391039
For example:
10401040
10411041
[db makeFunctionNamed:@"RemoveDiacritics" arguments:1 block:^(void *context, int argc, void **argv) {
1042-
SqliteValueType type = [self.db valueType:argv[0]];
1043-
if (type == SqliteValueTypeNull) {
1042+
OPTLYSqliteValueType type = [self.db valueType:argv[0]];
1043+
if (type == OPTLYSqliteValueTypeNull) {
10441044
[self.db resultNullInContext:context];
10451045
return;
10461046
}
1047-
if (type != SqliteValueTypeText) {
1047+
if (type != OPTLYSqliteValueTypeText) {
10481048
[self.db resultError:@"Expected text" context:context];
10491049
return;
10501050
}
@@ -1069,15 +1069,15 @@ typedef int(^OPTLYFMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDicti
10691069

10701070
- (void)makeFunctionNamed:(NSString *)name maximumArguments:(int)count withBlock:(void (^)(void *context, int argc, void * _Nonnull * _Nonnull argv))block __deprecated_msg("Use makeFunctionNamed:arguments:block:");
10711071

1072-
typedef NS_ENUM(int, SqliteValueType) {
1073-
SqliteValueTypeInteger = 1,
1074-
SqliteValueTypeFloat = 2,
1075-
SqliteValueTypeText = 3,
1076-
SqliteValueTypeBlob = 4,
1077-
SqliteValueTypeNull = 5
1072+
typedef NS_ENUM(int, OPTLYSqliteValueType) {
1073+
OPTLYSqliteValueTypeInteger = 1,
1074+
OPTLYSqliteValueTypeFloat = 2,
1075+
OPTLYSqliteValueTypeText = 3,
1076+
OPTLYSqliteValueTypeBlob = 4,
1077+
OPTLYSqliteValueTypeNull = 5
10781078
};
10791079

1080-
- (SqliteValueType)valueType:(void *)argv;
1080+
- (OPTLYSqliteValueType)valueType:(void *)argv;
10811081

10821082
/**
10831083
Get integer value of parameter in custom function.

OptimizelySDKShared/OPTLYFMDB/src/optlyfmdb/OPTLYFMDBDatabase.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************
22
* Modifications to FMDB by Optimizely, Inc. *
3-
* Copyright 2017, Optimizely, Inc. and contributors *
3+
* Copyright 2018, Optimizely, Inc. and contributors *
44
* *
55
* Licensed under the Apache License, Version 2.0 (the "License"); *
66
* you may not use this file except in compliance with the License. *
@@ -1502,7 +1502,7 @@ - (void)makeFunctionNamed:(NSString *)name arguments:(int)arguments block:(void
15021502
#endif
15031503
}
15041504

1505-
- (SqliteValueType)valueType:(void *)value {
1505+
- (OPTLYSqliteValueType)valueType:(void *)value {
15061506
return sqlite3_value_type(value);
15071507
}
15081508

OptimizelySDKShared/OPTLYFMDBTests/OPTLYFMDBDatabaseTests.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
/****************************************************************************
99
* Modifications to FMDB by Optimizely, Inc. *
10-
* Copyright 2017, Optimizely, Inc. and contributors *
10+
* Copyright 2018, Optimizely, Inc. and contributors *
1111
* *
1212
* Licensed under the Apache License, Version 2.0 (the "License"); *
1313
* you may not use this file except in compliance with the License. *
@@ -1098,12 +1098,12 @@ - (void)testCustomFunctionNoMemoryErrorResult {
10981098

10991099
- (void)createCustomFunctions {
11001100
[self.db makeFunctionNamed:@"RemoveDiacritics" arguments:1 block:^(void *context, int argc, void **argv) {
1101-
SqliteValueType type = [self.db valueType:argv[0]];
1102-
if (type == SqliteValueTypeNull) {
1101+
OPTLYSqliteValueType type = [self.db valueType:argv[0]];
1102+
if (type == OPTLYSqliteValueTypeNull) {
11031103
[self.db resultNullInContext:context];
11041104
return;
11051105
}
1106-
if (type != SqliteValueTypeText) {
1106+
if (type != OPTLYSqliteValueTypeText) {
11071107
[self.db resultError:@"Expected text" context:context];
11081108
return;
11091109
}
@@ -1113,9 +1113,9 @@ - (void)createCustomFunctions {
11131113
}];
11141114

11151115
[self.db makeFunctionNamed:@"Hypotenuse" arguments:2 block:^(void *context, int argc, void **argv) {
1116-
SqliteValueType type1 = [self.db valueType:argv[0]];
1117-
SqliteValueType type2 = [self.db valueType:argv[1]];
1118-
if (type1 != SqliteValueTypeFloat && type1 != SqliteValueTypeInteger && type2 != SqliteValueTypeFloat && type2 != SqliteValueTypeInteger) {
1116+
OPTLYSqliteValueType type1 = [self.db valueType:argv[0]];
1117+
OPTLYSqliteValueType type2 = [self.db valueType:argv[1]];
1118+
if (type1 != OPTLYSqliteValueTypeFloat && type1 != OPTLYSqliteValueTypeInteger && type2 != OPTLYSqliteValueTypeFloat && type2 != OPTLYSqliteValueTypeInteger) {
11191119
[self.db resultError:@"Expected numeric" context:context];
11201120
return;
11211121
}
@@ -1125,8 +1125,8 @@ - (void)createCustomFunctions {
11251125
}];
11261126

11271127
[self.db makeFunctionNamed:@"SetAlternatingByteToOne" arguments:1 block:^(void *context, int argc, void **argv) {
1128-
SqliteValueType type = [self.db valueType:argv[0]];
1129-
if (type != SqliteValueTypeBlob) {
1128+
OPTLYSqliteValueType type = [self.db valueType:argv[0]];
1129+
if (type != OPTLYSqliteValueTypeBlob) {
11301130
[self.db resultError:@"Expected blob" context:context];
11311131
return;
11321132
}

0 commit comments

Comments
 (0)