stringlib

package
v0.0.0-...-e0b5347 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LibLoader = packagelib.Loader{
	Load: load,
	Name: "string",
}

LibLoader specifies how to load the string lib

Functions

func Format

func Format(t *rt.Thread, format string, values []rt.Value) (string, error)

Format is the base for the implementation of lua string.format()

It works by scanning the verbs in the format string and converting the argument corresponding to this verb to the correct type, then calling Go's fmt.Sprintf().

It temporarily requires all the memory needed to store the formatted string, but releases it before returning so the caller should require memory first thing after the call.

func PackSize

func PackSize(format string) (uint, error)

func PackValues

func PackValues(format string, values []rt.Value, budget uint64) (string, uint64, error)

func UnpackString

func UnpackString(format, pack string, j int, budget uint64) (vals []rt.Value, nextPos int, used uint64, err error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL