Documentation ¶
Index ¶
- Variables
- func Bool(s string) (bool, error)
- func ByteGrid(s string) *structures.FlatGrid[byte]
- func Characters(s string) []string
- func Chunks(s string) (chunks []string)
- func ExtractDigits(s string) []int
- func ExtractFloat32s(s string) []float32
- func ExtractFloat64s(s string) []float64
- func ExtractInt64s(s string) []int64
- func ExtractInts(s string) []int
- func ExtractUint64s(s string) []uint64
- func ExtractUints(s string) []uint
- func Float32(s string) float32
- func Float32s(s []string) []float32
- func Float64(s string) float64
- func Float64s(s []string) []float64
- func Grid[T any](row Splitter, items func(string) []T, s string) [][]T
- func Int(s string) int
- func Int16(s string) int16
- func Int16s(s []string) []int16
- func Int32(s string) int32
- func Int32s(s []string) []int32
- func Int64(s string) int64
- func Int64s(s []string) []int64
- func Int8(s string) int8
- func Int8s(s []string) []int8
- func IntStrings(s string) []string
- func Ints(s []string) []int
- func Lines(s string) []string
- func MustReflect[T any](s []string) T
- func Reflect[T any](s []string) (T, error)
- func ReflectGrid[T any](row, col Splitter, s string) [][]T
- func Uint(s string) uint
- func Uint16(s string) uint16
- func Uint16s(s []string) []uint16
- func Uint32(s string) uint32
- func Uint32s(s []string) []uint32
- func Uint64(s string) uint64
- func Uint64s(s []string) []uint64
- func Uint8(s string) uint8
- func Uint8s(s []string) []uint8
- func UintStrings(s string) []string
- func Uints(s []string) []uint
- func Whitespace(s string) []string
- type Placeholder
- type Splitter
Constants ¶
This section is empty.
Variables ¶
View Source
var NotEnoughStrings = errors.New("not enough strings provided")
View Source
var PlaceholderDoesNotMatch = errors.New("string does not match placeholder match or regex tag")
View Source
var TooManyStrings = errors.New("too many strings provided")
View Source
var UnknownValueError = errors.New("unknown value")
Functions ¶
func ByteGrid ¶
func ByteGrid(s string) *structures.FlatGrid[byte]
ByteGrid converts a 2D grid represented as a string into a structures.FlatGrid. Each row should be represented by a line, and each item within that line should be represented by a single byte. This is useful for e.g. maze tasks where coordinates always stay inside the input grid
func Characters ¶
Characters splits a string on each character, optimized for ASCII strings
func Chunks ¶
Chunks splits a string into "chunks" split by blank lines. Additionally, CLRF is converted to LF
func ExtractDigits ¶
func ExtractFloat32s ¶
func ExtractFloat64s ¶
func ExtractInt64s ¶
func ExtractInts ¶
func ExtractUint64s ¶
func ExtractUints ¶
func IntStrings ¶
func MustReflect ¶
func ReflectGrid ¶
func UintStrings ¶
Types ¶
type Placeholder ¶
type Placeholder struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.