diff --git a/Project.toml b/Project.toml index d59d073..bb189e6 100644 --- a/Project.toml +++ b/Project.toml @@ -6,9 +6,6 @@ authors = ["Tamas K. Papp "] 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" diff --git a/src/StrFs.jl b/src/StrFs.jl index abfe3d0..08dea50 100644 --- a/src/StrFs.jl +++ b/src/StrFs.jl @@ -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) @@ -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)