12 Commits

Author SHA1 Message Date
Guillaume Lessard
3e268afe74
Implement base64 for Data in Swift (#337)
* [base64] initial Base-64 re-implementation

* Add BufferView._assertBounds() functions

- they act the same as the _checkBounds() functions
- but only in debug mode

* Improve BufferView slicing

- when all the necessary checking has been done, the BufferView initializer doesn’t need to validate the buffer length another time.

* remove premature reference to typealias

* add the `unsafe` particle to an initializer argument label

* [base64] modify Base64 with `OutputBuffer` and `BufferView`

* remove unused bits in OutputBuffer

* express a cascaded if statement as a switch

* make internal decoding initializer failable

* Update Sources/FoundationEssentials/Data/Data+Base64.swift

Co-authored-by: Elliot Knight <63256761+Harry-KNIGHT@users.noreply.github.com>

---------

Co-authored-by: Elliot Knight <63256761+Harry-KNIGHT@users.noreply.github.com>
2024-02-22 10:31:08 -08:00
Guillaume Lessard
cb63c4c577
Revert "Move count among the Collection conformance in BufferView" (#103)
This reverts a change in the internal representation of `BufferView` which has potentially significant performance consequences. We might want to make this change, but we need to carefully evaluate the performance consequences first.

This reverts commit 6900c61344048242878ccbb9b79b0a47b2b75e80.
2023-05-09 14:09:10 -07:00
noriaki watanabe
218892640f
Replace BufferViewIndex<Element> with Index in BufferView. (#96)
* Refactor BufferView to use typealias "Index" for Collection protocol methods

* Refactor BufferView to use "Index" consistently both within and outside of Collection extension methods.

* Remove comments in BufferView

* Revert the position defined of Index and make it clear that it is part of the Collection conformance in BufferView

* Move count among the Collection conformance in BufferView
2023-05-09 10:58:13 -07:00
Guillaume Lessard
d185fb59c5
rdar://108230575 (fix ABI issues in JSONScanner and BufferView) (#53) 2023-04-25 13:15:57 -07:00
Guillaume Lessard
ecd52ceb38
rdar://108073576 (Don't expose BufferView's baseAddress property) (#32)
* Clarify use of unsafe code and call to memcmp

* Do not expose a BufferView’s `baseAddress`
2023-04-17 16:37:12 -07:00
Guillaume Lessard
9fe8623124
adjust code formatting
- also incorporates some performance annotations added for the JSON decoder.
2023-04-11 10:26:37 -07:00
Guillaume Lessard
1b27c1cba7
make initializers from BufferPointer failable 2023-04-05 12:57:06 -07:00
Guillaume Lessard
49cf29f735
remove unnecessary public keywords 2023-04-04 17:20:50 -07:00
Guillaume Lessard
fe89db476a
remove dependsOn parameter
- it is not useful without compiler support.
2023-04-04 17:02:31 -07:00
Guillaume Lessard
c4a08fc971
remove commented-out code 2023-04-03 19:26:30 -07:00
Guillaume Lessard
8095d73d8a
add the copyright notice 2023-04-03 12:48:35 -07:00
Guillaume Lessard
b6d610d626
add internal BufferView prototype 2023-04-03 12:16:27 -07:00