Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ authors = ["Tamas K. Papp <[email protected]>"]
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
StaticArrays = "^0.9, ^0.10"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
15 changes: 14 additions & 1 deletion src/StrFs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ using StaticArrays: SVector
using Parameters

import Base: sizeof, read, write, isless, cmp, ==, typemin, repeat, promote_rule, show,
codeunit, hash, length
codeunit, hash, length, ncodeunits, codeunit, codeunits, lastindex, firstindex,
isvalid

"""
StrF{S}(::String)
Expand Down Expand Up @@ -120,6 +121,18 @@ typemin(::StrF{S}) where S = StrF(zeros(SVector{S}))

length(str::StrF) = length(String(str)) # TODO improve

ncodeunits(s::StrF) = ncodeunits(String(s)) # TODO improve

codeunit(s::StrF, i::Integer) = codeunit(String(s), i) # TODO improve

codeunits(s::StrF) = codeunits(String(s)) # TODO improve

lastindex(s::StrF) = lastindex(String(s)) # TODO improve

firstindex(s::StrF) = firstindex(String(s)) # TODO improve

isvalid(s::StrF, i::Integer) = isvalid(String(s), i) # TODO improve

function repeat(str::StrF{S}, ::Val{n}) where {S, n}
@unpack bytes = str
s = sizeof(str)
Expand Down