Skip to content

Commit

Permalink
Merge branch 'release-1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsolomko committed Apr 22, 2018
2 parents f522732 + 199b77c commit 5ba2e08
Show file tree
Hide file tree
Showing 20 changed files with 905 additions and 105 deletions.
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ sourcekitten_sourcefile: docs.json
clean: true
author: Timofey Solomko
module: BitByteData
module_version: 1.1.1
module_version: 1.2.0
copyright: '© 2018 Timofey Solomko'
readme: README.md
github_url: https://github.com/tsolomko/BitByteData
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/1.1.1
github_file_prefix: https://github.com/tsolomko/BitByteData/tree/1.2.0
theme: fullwidth

custom_categories:
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.1
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
- stage: test
language: objective-c
os: osx
osx_image: xcode9.2
osx_image: xcode9.3
script:
- swift build
- swift test
Expand All @@ -21,7 +21,7 @@ jobs:
if: tag IS present
language: objective-c
os: osx
osx_image: xcode9.2
osx_image: xcode9.3
env:
secure: fmKQgrPRx2iisNPzxDhOTfXPsnQMJxDgIMItVNjl1AKByraOpiDAGVESySvy+vwQqITCB/BfvdkW7smAPcvFJxIPRx1v4J0VY9kGHdnafMw35XY0Vj9soYkzNS4zrUebxY2gWkGM6Q6dgLOGT/9MSEyWqXBTtVz9sLwA7yr3ZI72yZDbcSz3XGa1fFZRVfwv3I+bmuozG7dq7tyqcSKgRZnHg1VvaRdxcaGqSGSUsNu0YLzmNedujNcU+gTXcxMdrXA1eaheHc2pwNA0TDf3KkefJpaVMXrA/Un8e9MaJ1lMnPlIiEI3dPTuogtQY7p59vgulBNBPEJovTHI0jCaNyLUkTkHgGcUuOwHqwUIKZCEiiqM1j12sdLo4O2tAdNaNHDtd8D3bCakrdJxXlUWVfjrCwvBB555gd0drRirQgYX+5gGFwnTQE8tOcjK4qUvJaOAouHsnm/DmW+fLJPX76KoU6QOtGJt6PQ92yBgKRhaSg/sQ28WPuCmF2p7BuUSuULxcM2LU5eA5aFxayoZvR2E9uvfFxnFh01iV6clcZo25U03AuxJmuI7Mhl83amj8bm5CRBbuRw5sIljXfBujFUel+kz/HXalS7lStqH9iPyiQvh24WkPzHKNQdjRI7v3kyrVSXJ3Xl6+fopXqr/25MwqD4bt57QgglJ2IQtnLM=
before_install:
Expand Down
8 changes: 4 additions & 4 deletions BitByteData.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "BitByteData"
s.version = "1.1.1"
s.version = "1.2.0"
s.summary = "Read and write bits and bytes in Swift."

s.description = "A Swift framework with classes for reading and writing bits and bytes."
Expand All @@ -20,12 +20,12 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"

s.swift_version = '4.0'
s.swift_version = "4.1"

s.source_files = "Sources/*.swift"

s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'Tests/BitByteDataTests/*.swift'
s.test_spec "Tests" do |test_spec|
test_spec.source_files = "Tests/BitByteDataTests/*.swift"
end

end
4 changes: 2 additions & 2 deletions BitByteData.xcodeproj/BitByteData.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>13</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2018 Timofey Solomko. All rights reserved.</string>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions BitByteData.xcodeproj/TestBitByteData.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>13</string>
</dict>
</plist>
58 changes: 44 additions & 14 deletions BitByteData.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -160,7 +160,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0920;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Timofey Solomko";
TargetAttributes = {
06F0656B1FFAEA4B00312A82 = {
Expand All @@ -174,7 +174,7 @@
};
};
buildConfigurationList = 06F065531FFAE9EC00312A82 /* Build configuration list for PBXProject "BitByteData" */;
compatibilityVersion = "Xcode 8.0";
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -233,22 +233,26 @@
06F065541FFAE9EC00312A82 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 13;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand All @@ -264,7 +268,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
SUPPORTED_PLATFORMS = "macosx watchsimulator iphonesimulator appletvsimulator watchos appletvos iphoneos";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TVOS_DEPLOYMENT_TARGET = 9.0;
Expand All @@ -276,22 +279,26 @@
06F065551FFAE9EC00312A82 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 13;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
Expand All @@ -305,9 +312,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = NO;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
SUPPORTED_PLATFORMS = "macosx watchsimulator iphonesimulator appletvsimulator watchos appletvos iphoneos";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
Expand All @@ -320,11 +326,17 @@
APPLICATION_EXTENSION_API_ONLY = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 9;
DYLIB_CURRENT_VERSION = 13;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@loader_path/Frameworks",
"@executable_path/Frameworks",
"@loader_path/../Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.BitByteData;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -339,11 +351,17 @@
APPLICATION_EXTENSION_API_ONLY = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 9;
DYLIB_CURRENT_VERSION = 13;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteData.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@loader_path/Frameworks",
"@executable_path/Frameworks",
"@loader_path/../Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.BitByteData;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand All @@ -357,7 +375,13 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = BitByteData.xcodeproj/TestBitByteData.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@loader_path/Frameworks",
"@executable_path/Frameworks",
"@loader_path/../Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.TestBitByteData;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
Expand All @@ -369,7 +393,13 @@
buildSettings = {
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = BitByteData.xcodeproj/TestBitByteData.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@loader_path/Frameworks",
"@executable_path/Frameworks",
"@loader_path/../Frameworks",
"@executable_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.TestBitByteData;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>BuildSystemType</key>
<string>Latest</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.2.0

- Updated to support Swift 4.1.
- Added `bytesLeft` and `bytesRead` computed properties to `ByteReader`.
- Added `int(fromBytes:)`, `uint16(fromBytes:)`, `uint32(fromBytes:)`, and `uint64(fromBytes:)` functions to all readers.
- Added `byte(fromBits:)`, `uint16(fromBits:)`, `uint32(fromBits:)`, and `uint64(fromBits:)` functions to `LsbBitReader`
and `MsbBitReader`, as well as `BitReader` protocol.
- `int(fromBits:)` function now has a precondition that its argument doesn't exceed `Int` bit width.
- Reverted "disable symbol stripping" change from 1.1.1 update, since underlying problem in Carthage was fixed.
- Minor updates to documentation.

## 1.1.1

- Added missing documentation for `bitsLeft` and `bitsRead` computed properties.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BitByteData

[![Swift 4](https://img.shields.io/badge/Swift-4.0-blue.svg)](https://developer.apple.com/swift/)
[![Swift 4.1](https://img.shields.io/badge/Swift-4.1-blue.svg)](https://developer.apple.com/swift/)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/tsolomko/BitByteData/master/LICENSE)
[![Build Status](https://travis-ci.org/tsolomko/BitByteData.svg?branch=develop)](https://travis-ci.org/tsolomko/BitByteData)

Expand All @@ -22,7 +22,7 @@ let package = Package(
name: "PackageName",
dependencies: [
.package(url: "https://github.com/tsolomko/BitByteData.git",
from: "1.1.0")
from: "1.2.0")
],
targets: [
.target(
Expand All @@ -37,13 +37,13 @@ More details you can find in [Swift Package Manager's Documentation](https://git

### CocoaPods

Add `pod 'BitByteData', '~> 1.1'` and `use_frameworks!` to your Podfile.
Add `pod 'BitByteData', '~> 1.2'` and `use_frameworks!` to your Podfile.

To complete installation, run `pod install`.

### Carthage

Add to your Cartfile `github "tsolomko/BitByteData" ~> 1.1`.
Add to your Cartfile `github "tsolomko/BitByteData" ~> 1.2`.

Then run `carthage update`.

Expand Down
26 changes: 25 additions & 1 deletion Sources/BitReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,21 @@ public protocol BitReader: class {
/// Reads `count` bits and returns them as an array of `UInt8`, advancing by `count` BIT positions.
func bits(count: Int) -> [UInt8]

/// Reads `count` bits and returns them as a `Int` number, advancing by `count` BIT positions.
/// Reads `fromBits` bits and returns them as an `Int` number, advancing by `fromBits` BIT positions.
func int(fromBits count: Int) -> Int

/// Reads `fromBits` bits and returns them as an `UInt8` number, advancing by `fromBits` BIT positions.
func byte(fromBits count: Int) -> UInt8

/// Reads `fromBits` bits and returns them as an `UInt16` number, advancing by `fromBits` BIT positions.
func uint16(fromBits count: Int) -> UInt16

/// Reads `fromBits` bits and returns them as an `UInt32` number, advancing by `fromBits` BIT positions.
func uint32(fromBits count: Int) -> UInt32

/// Reads `fromBits` bits and returns them as an `UInt64` number, advancing by `fromBits` BIT positions.
func uint64(fromBits count: Int) -> UInt64

/// Aligns reader's BIT pointer to the BYTE border, i.e. moves BIT pointer to the first BIT of the next BYTE.
func align()

Expand All @@ -46,13 +58,25 @@ public protocol BitReader: class {
/// Reads `count` bytes and returns them as an array of `UInt8`, advancing by `count` BYTE positions.
func bytes(count: Int) -> [UInt8]

/// Reads `fromBytes` bytes and returns them as an `Int` number, advancing by `fromBytes` BYTE positions.
func int(fromBytes count: Int) -> Int

/// Reads 8 bytes and returns them as a `UInt64` number, advancing by 8 BYTE positions.
func uint64() -> UInt64

/// Reads `fromBytes` bytes and returns them as a `UInt64` number, advancing by 8 BYTE positions.
func uint64(fromBytes count: Int) -> UInt64

/// Reads 4 bytes and returns them as a `UInt32` number, advancing by 4 BYTE positions.
func uint32() -> UInt32

/// Reads `fromBytes` bytes and returns them as a `UInt32` number, advancing by 8 BYTE positions.
func uint32(fromBytes count: Int) -> UInt32

/// Reads 2 bytes and returns them as a `UInt16` number, advancing by 2 BYTE positions.
func uint16() -> UInt16

/// Reads `fromBytes` bytes and returns them as a `UInt16` number, advancing by 8 BYTE positions.
func uint16(fromBytes count: Int) -> UInt16

}
Loading

0 comments on commit 5ba2e08

Please sign in to comment.