Skip to content

Commit e39d902

Browse files
authored
Merge pull request #12 from Dimentar/develop
Access Control
2 parents db445cf + 94d85aa commit e39d902

7 files changed

Lines changed: 164 additions & 103 deletions

File tree

ServiceStack.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@
11211121
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
11221122
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
11231123
ONLY_ACTIVE_ARCH = NO;
1124+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
11241125
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-iOS";
11251126
PRODUCT_NAME = ServiceStack;
11261127
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1148,6 +1149,7 @@
11481149
INFOPLIST_FILE = Configs/ServiceStack.plist;
11491150
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
11501151
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1152+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
11511153
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-iOS";
11521154
PRODUCT_NAME = ServiceStack;
11531155
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1211,6 +1213,7 @@
12111213
INFOPLIST_FILE = Configs/ServiceStack.plist;
12121214
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
12131215
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1216+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
12141217
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-watchOS";
12151218
PRODUCT_NAME = ServiceStack;
12161219
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1242,6 +1245,7 @@
12421245
INFOPLIST_FILE = Configs/ServiceStack.plist;
12431246
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
12441247
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1248+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
12451249
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-watchOS";
12461250
PRODUCT_NAME = ServiceStack;
12471251
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1273,6 +1277,7 @@
12731277
INFOPLIST_FILE = Configs/ServiceStack.plist;
12741278
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
12751279
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1280+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
12761281
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-tvOS";
12771282
PRODUCT_NAME = ServiceStack;
12781283
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1304,6 +1309,7 @@
13041309
INFOPLIST_FILE = Configs/ServiceStack.plist;
13051310
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
13061311
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1312+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
13071313
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-tvOS";
13081314
PRODUCT_NAME = ServiceStack;
13091315
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1338,6 +1344,7 @@
13381344
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
13391345
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
13401346
MACOSX_DEPLOYMENT_TARGET = 10.10;
1347+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
13411348
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-macOS";
13421349
PRODUCT_NAME = ServiceStack;
13431350
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1370,6 +1377,7 @@
13701377
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
13711378
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
13721379
MACOSX_DEPLOYMENT_TARGET = 10.10;
1380+
OTHER_SWIFT_FLAGS = "-Xfrontend -debug-time-function-bodies";
13731381
PRODUCT_BUNDLE_IDENTIFIER = "net.ServiceStack.ServiceStack-macOS";
13741382
PRODUCT_NAME = ServiceStack;
13751383
PROVISIONING_PROFILE_SPECIFIER = "";

Sources/DateExtensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ public extension Date {
8080
let dateFormatter = DateFormatter()
8181
dateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") as Locale?
8282
dateFormatter.timeZone = isUtc ? TimeZone(abbreviation: "UTC") : TimeZone.ReferenceType.default // TimeZone.ReferenceType.local
83-
dateFormatter.dateFormat = string.length == 19 || (isUtc && string.length == 20)
83+
dateFormatter.dateFormat = string.count == 19 || (isUtc && string.count == 20)
8484
? "yyyy-MM-dd'T'HH:mm:ss"
8585
: "yyyy-MM-dd'T'HH:mm:ss.SSSSSSS"
8686

8787
return isUtc
88-
? dateFormatter.date(from: string[0 ..< string.length - 1])
88+
? dateFormatter.date(from: string[0 ..< string.count - 1])
8989
: dateFormatter.date(from: string)
9090
}
9191
}

Sources/Json.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class JObject {
1616
}
1717

1818
func append(name: String, json: String?) {
19-
if sb.length > 0 {
19+
if sb.count > 0 {
2020
sb += ","
2121
}
2222
if let s = json {
@@ -278,7 +278,7 @@ extension Character: StringSerializable {
278278
}
279279

280280
public static func fromString(_ string: String) -> Character? {
281-
return string.length > 0 ? string[0] : nil
281+
return string.count > 0 ? string[0] : nil
282282
}
283283

284284
public static func fromObject(_ any: Any) -> Character? {
@@ -302,7 +302,7 @@ extension Date: StringSerializable {
302302

303303
public static func fromString(_ string: String) -> Date? {
304304
let str = string.hasPrefix("\\")
305-
? string[1 ..< string.length]
305+
? string[1 ..< string.count]
306306
: string
307307
let wcfJsonPrefix = "/Date("
308308
if str.hasPrefix(wcfJsonPrefix) {
@@ -389,7 +389,7 @@ extension TimeInterval {
389389
var secFmt = String(format: "%.7f", remainingSecs)
390390
secFmt = secFmt.trimEnd("0").trimEnd(".")
391391
sb += "\(secFmt)S"
392-
} else if sb.length == 2 { // PT
392+
} else if sb.count == 2 { // PT
393393
sb += "0S"
394394
}
395395
}
@@ -412,7 +412,7 @@ extension TimeInterval {
412412
var seconds = 0
413413
var ms = 0.0
414414

415-
let t = string[1 ..< string.length].splitOn(first: "T") // strip P
415+
let t = string[1 ..< string.count].splitOn(first: "T") // strip P
416416

417417
let hasTime = t.count == 2
418418

@@ -1385,7 +1385,7 @@ public class JArrayProperty<T: HasMetadata, P: StringSerializable>: PropertyBase
13851385
var sb = ""
13861386

13871387
for item in propValues {
1388-
if sb.length > 0 {
1388+
if sb.count > 0 {
13891389
sb += ","
13901390
}
13911391
var str: String = "null"
@@ -1435,7 +1435,7 @@ public class JOptionalArrayProperty<T: HasMetadata, P: StringSerializable>: Prop
14351435
var sb = ""
14361436
if let propValues = get(instance) {
14371437
for item in propValues {
1438-
if sb.length > 0 {
1438+
if sb.count > 0 {
14391439
sb += ","
14401440
}
14411441
var str: String = "null"
@@ -1490,7 +1490,7 @@ public class JArrayObjectProperty<T: HasMetadata, P: JsonSerializable>: Property
14901490
var sb = ""
14911491

14921492
for item in propValues {
1493-
if sb.length > 0 {
1493+
if sb.count > 0 {
14941494
sb += ","
14951495
}
14961496
var str: String = "null"
@@ -1541,7 +1541,7 @@ public class JOptionalArrayObjectProperty<T: HasMetadata, P: JsonSerializable>:
15411541

15421542
if let propValues = get(instance) {
15431543
for item in propValues {
1544-
if sb.length > 0 {
1544+
if sb.count > 0 {
15451545
sb += ","
15461546
}
15471547
var str: String = "null"
@@ -1610,7 +1610,7 @@ func jsonString(_ str: String?) -> String {
16101610
do {
16111611
let encodedData = try JSONSerialization.data(withJSONObject: [s], options: JSONSerialization.WritingOptions())
16121612
if let encodedJson = encodedData.toUtf8String() {
1613-
return encodedJson[1 ..< encodedJson.length - 1] // strip []
1613+
return encodedJson[1 ..< encodedJson.count - 1] // strip []
16141614
}
16151615
} catch {}
16161616
}

0 commit comments

Comments
 (0)