import paged.*;
import strings;



//
// String
//

alias String = Vector[Char];


//
// construct from sequences of bytes
//

[A | Sequence?(A) and ByteSizedInteger?(SequenceElementType(A))]
overload String(a:A) = String(mapped(Char, a));



//
// construct from c-string
//

[T | ByteSizedInteger?(T)]
overload String(cstr : Pointer[T]) = String(CStringRef(cstr));



//
// cstring
//

overload cstring(s:String) {
    reserve(s, size(s) + 1);
    s[size(s)] = Char(0);
    return Pointer[Int8](&(begin(s)^));
}
