SWAG

Table of Contents

Namespaces

Structs

collections

compress

crypto

diagnostics

globalization

input

io

math

rand

serialization

serialization/read

serialization/write

system

text

thread

time

Interfaces

crypto

diagnostics

serialization

serialization/read

serialization/write

text

Enums

compress

diagnostics

input

io

rand

serialization/read

serialization/write

system

text

thread

time

Constants

io

rand

system

text

time

Type Aliases

input

io

math

system

thread

time

Attributes

serialization

system

Functions

algorithms

collections

compress

crypto

diagnostics

globalization

input

io

math

memory

rand

reflection

serialization

serialization/read

serialization/write

slice

system

text

thread

time

Swag Std.Core

The Std.core module contains basic types and algorithms. It is the base of all other modules of the standard Std workspace.

You will find collections like Array or HashTable, a dynamic String and so on.

Content

const Core.Constants [src]

ASSERT bool
BIG_ENDIAN bool
EndLine string
CharProperties const [256] Latin1.CharAttribute
AltDirectorySeparatorChar u8
DirectorySeparatorChar u8
VolumeSeparatorChar u8
NN s32
StringSmallSize u64
DayOfWeekNames const [7] string
DaysPer100Years s32
DaysPer400Years s32
DaysPer4Years s32
DaysPerYear s32
DaysTo10000 u64 Number of days from 1/1/0001 to 12/31/9999.
DaysTo1601 u64 Number of days from 1/1/0001 to 12/31/1600.
DaysTo1899 u64 Number of days from 1/1/0001 to 12/30/1899.
DaysTo1970 u64 Number of days from 1/1/0001 to 12/31/1969.
DaysToMonth365 const [13] u16
DaysToMonth366 const [13] u16
MaxMilliSeconds u64
MaxMillis u64
MaxTicks u64
MillisPerDay u64
MillisPerHour u64
MillisPerMinute u64
MillisPerSecond u64
MonthNames const [12] string
TicksPerDay u64
TicksPerHour u64
TicksPerMilliSecond u64
TicksPerMinute u64
TicksPerSecond u64
RuneError rune
Surr1 u32
Surr2 u32
Surr3 u32
SurrSelf u32
MaxRunes rune
RuneError rune
SurrogateMax rune
SurrogateMin rune
WINDOWS bool

type alias Env.Type Aliases [src]

ProcessHandle Env.ProcessHandle
FileHandle File.FileHandle
VirtualKey Input.VirtualKey
ConstF32 Math.ConstF32
ConstF64 Math.ConstF64
ThreadHandle Threading.ThreadHandle
Ticks Time.Ticks
TimerHandle Time.TimerHandle

struct Core.Array [src]

This is a generic dynamic array.

struct Array(T)
allocator Swag.IAllocator Associated allocator.
buffer ^Array.T Memory block of all datas.
count u64 Number of valid datas.
capacity u64 Number of elements that can be stored in the buffer.

Functions

add(self, &&T) Move one element at the end of the array.
add(self, T) Add a copy of one element at the end of the array.
add(self, const [..] T) Append a slice to the end of this instance.
addOnce Add a copy of one element at the end of the array.
back Returns a copy of the last element.
backPtr Returns the address of the last element.
clear Set the number of elements to 0.
contains Returns true if the given value is in the array.
createBuffer Create a working buffer.
createTemp Create a temporary array.
emplaceAddress Reserve room at the end of the array for num elements, but does not initialize them. Returns the address of the first element.
emplaceAt Move some values at the given index. If index is equal to count, then the values are moved at the end of the array. Order is preserved.
emplaceInitAddress Reserve room at the end of the array for num elements.
fill Fill the array with the given value.
free Free the array content.
front Returns a copy of the first element.
frontPtr Returns the address of the first element.
grow Ensure the Array is big enough to store at least newCount elements.
growResize Ensure that at least newCount elements are present and initizalized in the array.
insertAt(self, u64, &&T) Move a value at the given index. If index is equal to count, then the value is added at the end of the array. Order is preserved.
insertAt(self, u64, T) Insert a value at the given index. If index is equal to count, then the value is added at the end of the array. Order is preserved.
insertAt(self, u64, const [..] T) Insert some values at the given index. If index is equal to count, then the values are added at the end of the array. Order is preserved.
isEmpty Returns true if the array is empty.
popBack Returns a copy of the last element, and remove it from the array.
realloc
ref1 Returns a reference to a value given coordinate.
ref2 Returns a reference to a value given 2 coordinates and a width.
remove(self, V) Remove the given value If not found, does nothing.
remove(self, u64, u64) Remove num elements starting at index.
removeAt Remove an element at index by replacing it with the last element.
removeAtOrdered Remove numValues elements at index by shifting all others.
removeBack Remove the last element.
removeOrdered Remove the given value If not found, does nothing.
reserve Reserve room for newCapacity elements without changing the array count.
resize Change the number of valid elements in the array.
sort(self) Sort array.
sort(self, func(*void, T, T)->s32) Sort array.
sortReverse Sort array in reverse order (from biggest to lowest value).
swap Swap two elements.
toSlice(self) Returns a slice.
toSlice(self) Returns a slice.

Special Functions

opAffect Initializes an Array that contains values copied from the specified array.
opCast(self)
opCast(self)
opCount
opData
opDrop
opIndex(self, u64)
opIndex(self, u64)
opIndexAffect
opIndexAssign
opPostCopy
opSlice
opVisit Visit every elements of the array.

func IConvert.convert [src]

func convert(using self, buf: *ConcatBuffer, convFmt: StrConv.ConvertFormat, strFormat: string)

func Array.add [src]

Add a copy of one element at the end of the array.

func add(using self, value: self.T)

Move one element at the end of the array.

func add(using self, value: &&self.T)

Append a slice to the end of this instance.

func add(using self, values: const [..] self.T)

func Array.addOnce [src]

Add a copy of one element at the end of the array.

func addOnce(using self, value: self.T)

func Array.back [src]

Returns a copy of the last element.

func back(using self)->Array.T

func Array.backPtr [src]

Returns the address of the last element.

func backPtr(using self)->*Array.T

func Array.clear [src]

Set the number of elements to 0.

func clear(using self)

func Array.contains [src]

Returns true if the given value is in the array.

func(V) contains(using self, value: V)->bool

func Array.createBuffer [src]

Create a working buffer.

func createBuffer(size: u64)->Array'(u8)

func Array.createTemp [src]

Create a temporary array.

func(TA) createTemp()->Array'(TA)

func Array.emplaceAddress [src]

Reserve room at the end of the array for num elements, but does not initialize them. Returns the address of the first element.

func emplaceAddress(using self, num: u32 = 1)->^Array.T

func Array.emplaceAt [src]

Move some values at the given index. If index is equal to count, then the values are moved at the end of the array. Order is preserved.

func emplaceAt(using self, index: u64, values: [..] self.T)

func Array.emplaceInitAddress [src]

Reserve room at the end of the array for num elements.

func emplaceInitAddress(using self, num: u32 = 1)->^Array.T

Returns the address of the first element

func Array.fill [src]

Fill the array with the given value.

func fill(using self, value: self.T)

func Array.free [src]

Free the array content.

func free(using self)

func Array.front [src]

Returns a copy of the first element.

func front(using self)->Array.T

func Array.frontPtr [src]

Returns the address of the first element.

func frontPtr(using self)->*Array.T

func Array.grow [src]

Ensure the Array is big enough to store at least newCount elements.

func grow(using self, newCount: u64)

The number of valid elements does not change. If you want the number of valid elements to be changed also, use [[growResize]] instead.

func Array.growResize [src]

Ensure that at least newCount elements are present and initizalized in the array.

func growResize(using self, newCount: u64)

This will grow the array if necessary.

func Array.insertAt [src]

Insert a value at the given index. If index is equal to count, then the value is added at the end of the array. Order is preserved.

func insertAt(using self, index: u64, value: self.T)

Move a value at the given index. If index is equal to count, then the value is added at the end of the array. Order is preserved.

func insertAt(using self, index: u64, value: &&self.T)

Insert some values at the given index. If index is equal to count, then the values are added at the end of the array. Order is preserved.

func insertAt(using self, index: u64, values: const [..] self.T)

func Array.isEmpty [src]

Returns true if the array is empty.

func isEmpty(using const self)

func Array.opAffect [src]

Initializes an Array that contains values copied from the specified array.

func opAffect(using self, arr: const [..] self.T)

func Array.opCast [src]

func opCast(using self)->[..] Array.T func opCast(using const self)->const [..] Array.T

func Array.opCount [src]

func opCount(using self)->u64

func Array.opData [src]

func opData(using self)->const *Array.T

func Array.opDrop [src]

func opDrop(using self)

func Array.opIndex [src]

func opIndex(using const self, index: u64)->const &Array.T func opIndex(using self, index: u64)->&Array.T

func Array.opIndexAffect [src]

func opIndexAffect(using self, index: u64, value: self.T)

func Array.opIndexAssign [src]

func(op: string) opIndexAssign(using self, index: u64, value: self.T)

func Array.opPostCopy [src]

func opPostCopy(using self)

func Array.opSlice [src]

func opSlice(using self, lower, upper: u64)->[..] Array.T

func Array.opVisit [src]

Visit every elements of the array.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using const self, stmt: code)

Visiting by address and in reverse order is supported.

func Array.popBack [src]

Returns a copy of the last element, and remove it from the array.

func popBack(using self)->Array.T

func Array.realloc [src]

func realloc(using self, newCapacity: u64)

func Array.ref1 [src]

Returns a reference to a value given coordinate.

func ref1(using self, x: u64)->&Array.T

This is to use the array as an array with 2 dimensions.

func Array.ref2 [src]

Returns a reference to a value given 2 coordinates and a width.

func ref2(using self, x, y, w: u64)->&Array.T

This is to use the array as an array with 2 dimensions.

func Array.remove [src]

Remove num elements starting at index.

func remove(using self, index, num: u64)

Remove the given value If not found, does nothing.

func(V) remove(using self, value: V)

func Array.removeAt [src]

Remove an element at index by replacing it with the last element.

func removeAt(using self, index: u64)

Order is not preserved

func Array.removeAtOrdered [src]

Remove numValues elements at index by shifting all others.

func removeAtOrdered(using self, index: u64, numValues: u64 = 1)

Order is preserved

func Array.removeBack [src]

Remove the last element.

func removeBack(using self)

func Array.removeOrdered [src]

Remove the given value If not found, does nothing.

func(V) removeOrdered(using self, value: V)

func Array.reserve [src]

Reserve room for newCapacity elements without changing the array count.

func reserve(using self, newCapacity: u64)

The number of valid elements does not change.

func Array.resize [src]

Change the number of valid elements in the array.

func resize(using self, newCount: u64)

This can be used to reduce or increase the number of valid elements.

func Array.sort [src]

Sort array.

func sort(using self) func sort(using self, cb: func||(self.T, self.T)->s32)

func Array.sortReverse [src]

Sort array in reverse order (from biggest to lowest value).

func sortReverse(using self)

func Array.swap [src]

Swap two elements.

func swap(using self, idx0, idx1: u64)

func Array.toSlice [src]

Returns a slice.

func toSlice(using self)->[..] Array.T func toSlice(using const self)->const [..] Array.T

struct Core.ArrayPtr [src]

struct ArrayPtr(T)
using base Array'(*Core.ArrayPtr.T)

Functions

addNewPtr Allocate a new pointer, and add it to the array.
clear Release content.
deletePtr Delete one pointer allocated here.
newPtr Allocate a new pointer by using the contextual allocator.

Special Functions

opDrop
opPostCopy

func ArrayPtr.addNewPtr [src]

Allocate a new pointer, and add it to the array.

func addNewPtr(using self)->*ArrayPtr.T

func ArrayPtr.clear [src]

Release content.

func clear(using self)

func ArrayPtr.deletePtr [src]

Delete one pointer allocated here.

func deletePtr(using self, item: *self.T)

func ArrayPtr.newPtr [src]

Allocate a new pointer by using the contextual allocator.

func newPtr(using self)->*ArrayPtr.T

func ArrayPtr.opDrop [src]

func opDrop(using self)

func ArrayPtr.opPostCopy [src]

func opPostCopy(using self)

namespace Core.Atomic

Functions

add(*s16, s16)
add(*s32, s32)
add(*s64, s64)
add(*s8, s8)
add(*u16, u16)
add(*u32, u32)
add(*u64, u64)
add(*u8, u8)
compareExchange(*s16, s16, s16)
compareExchange(*s32, s32, s32)
compareExchange(*s64, s64, s64)
compareExchange(*s8, s8, s8)
compareExchange(*u16, u16, u16)
compareExchange(*u32, u32, u32)
compareExchange(*u64, u64, u64)
compareExchange(*u8, u8, u8)
exchange(*s16, s16)
exchange(*s32, s32)
exchange(*s64, s64)
exchange(*s8, s8)
exchange(*u16, u16)
exchange(*u32, u32)
exchange(*u64, u64)
exchange(*u8, u8)
get(*s16)
get(*s32)
get(*s64)
get(*s8)
get(*u16)
get(*u32)
get(*u64)
get(*u8)
logicAnd(*s16, s16)
logicAnd(*s32, s32)
logicAnd(*s64, s64)
logicAnd(*s8, s8)
logicAnd(*u16, u16)
logicAnd(*u32, u32)
logicAnd(*u64, u64)
logicAnd(*u8, u8)
logicOr(*s16, s16)
logicOr(*s32, s32)
logicOr(*s64, s64)
logicOr(*s8, s8)
logicOr(*u16, u16)
logicOr(*u32, u32)
logicOr(*u64, u64)
logicOr(*u8, u8)
logicXor(*s16, s16)
logicXor(*s32, s32)
logicXor(*s64, s64)
logicXor(*s8, s8)
logicXor(*u16, u16)
logicXor(*u32, u32)
logicXor(*u64, u64)
logicXor(*u8, u8)

func Atomic.add [src]

func add(addr: *s8, value: s8)->s8 func add(addr: *s16, value: s16)->s16 func add(addr: *s32, value: s32)->s32 func add(addr: *s64, value: s64)->s64 func add(addr: *u8, value: u8)->u8 func add(addr: *u16, value: u16)->u16 func add(addr: *u32, value: u32)->u32 func add(addr: *u64, value: u64)->u64

func Atomic.compareExchange [src]

func compareExchange(addr: *s8, compareTo, exchangeWith: s8)->s8 func compareExchange(addr: *s16, compareTo, exchangeWith: s16)->s16 func compareExchange(addr: *s32, compareTo, exchangeWith: s32)->s32 func compareExchange(addr: *s64, compareTo, exchangeWith: s64)->s64 func compareExchange(addr: *u8, compareTo, exchangeWith: u8)->u8 func compareExchange(addr: *u16, compareTo, exchangeWith: u16)->u16 func compareExchange(addr: *u32, compareTo, exchangeWith: u32)->u32 func compareExchange(addr: *u64, compareTo, exchangeWith: u64)->u64

func Atomic.exchange [src]

func exchange(addr: *s8, exchangeWith: s8)->s8 func exchange(addr: *s16, exchangeWith: s16)->s16 func exchange(addr: *s32, exchangeWith: s32)->s32 func exchange(addr: *s64, exchangeWith: s64)->s64 func exchange(addr: *u8, exchangeWith: u8)->u8 func exchange(addr: *u16, exchangeWith: u16)->u16 func exchange(addr: *u32, exchangeWith: u32)->u32 func exchange(addr: *u64, exchangeWith: u64)->u64

func Atomic.get [src]

func get(addr: *s8)->s8 func get(addr: *s16)->s16 func get(addr: *s32)->s32 func get(addr: *s64)->s64 func get(addr: *u8)->u8 func get(addr: *u16)->u16 func get(addr: *u32)->u32 func get(addr: *u64)->u64

func Atomic.logicAnd [src]

func logicAnd(addr: *s8, value: s8)->s8 func logicAnd(addr: *s16, value: s16)->s16 func logicAnd(addr: *s32, value: s32)->s32 func logicAnd(addr: *s64, value: s64)->s64 func logicAnd(addr: *u8, value: u8)->u8 func logicAnd(addr: *u16, value: u16)->u16 func logicAnd(addr: *u32, value: u32)->u32 func logicAnd(addr: *u64, value: u64)->u64

func Atomic.logicOr [src]

func logicOr(addr: *s8, value: s8)->s8 func logicOr(addr: *s16, value: s16)->s16 func logicOr(addr: *s32, value: s32)->s32 func logicOr(addr: *s64, value: s64)->s64 func logicOr(addr: *u8, value: u8)->u8 func logicOr(addr: *u16, value: u16)->u16 func logicOr(addr: *u32, value: u32)->u32 func logicOr(addr: *u64, value: u64)->u64

func Atomic.logicXor [src]

func logicXor(addr: *s8, value: s8)->s8 func logicXor(addr: *s16, value: s16)->s16 func logicXor(addr: *s32, value: s32)->s32 func logicXor(addr: *s64, value: s64)->s64 func logicXor(addr: *u8, value: u8)->u8 func logicXor(addr: *u16, value: u16)->u16 func logicXor(addr: *u32, value: u32)->u32 func logicXor(addr: *u64, value: u64)->u64

struct Core.BitArray [src]

Manages a compact array of bit values, which are represented as booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).

buffer ^u32
allocator Swag.IAllocator
count u64
capacity u64

Functions

andWith Performs the bitwise AND operation between the elements of the current BitArray and the corresponding elements in the specified array.
get Gets the value of the bit at a specific position.
invert(self) Inverts all the bit values, so that elements set to true are changed to false, and elements set to false are changed to true.
invert(self, u64) Inverts the value of the bit at a specific position.
orWith Performs the bitwise OR operation between the elements of the current BitArray and the corresponding elements in the specified array.
reserve(self, u64) Reserve the given amount of bits.
reserve(self, u64, bool) Reserve the given amount of bits and set an initial value to all bits.
set Sets the bit at a specific position to the specified value.
setAll Sets all bits to the specified value.
xorWith Performs the bitwise XOR operation between the elements of the current BitArray and the corresponding elements in the specified array.

Special Functions

opAffect Initializes a BitArray that contains bit values copied from the specified array of booleans.
opCount
opDrop
opEquals Compares two arrays, and returns true if they are equal.
opIndex Gets the value of the bit at a specific position.
opIndexAffect Sets the value of the bit at a specific position.
opPostCopy
opVisit Visit all the booleans.

func BitArray.andWith [src]

Performs the bitwise AND operation between the elements of the current BitArray and the corresponding elements in the specified array.

func andWith(using self, other: Self)

The current BitArray will be modified to store the result of the bitwise AND operation.

func BitArray.get [src]

Gets the value of the bit at a specific position.

func get(using const self, index: u64)->bool

func BitArray.invert [src]

Inverts the value of the bit at a specific position.

func invert(using self, index: u64)

Inverts all the bit values, so that elements set to true are changed to false, and elements set to false are changed to true.

func invert(using self)

func BitArray.opAffect [src]

Initializes a BitArray that contains bit values copied from the specified array of booleans.

func opAffect(using self, what: const [..] bool)

func BitArray.opCount [src]

func opCount(using const self)->u64

func BitArray.opDrop [src]

func opDrop(using self)

func BitArray.opEquals [src]

Compares two arrays, and returns true if they are equal.

func opEquals(using self, other: Self)->bool

func BitArray.opIndex [src]

Gets the value of the bit at a specific position.

func opIndex(using self, index: u64)->bool

func BitArray.opIndexAffect [src]

Sets the value of the bit at a specific position.

func opIndexAffect(using self, index: u64, value: bool)

func BitArray.opPostCopy [src]

func opPostCopy(using self)

func BitArray.opVisit [src]

Visit all the booleans.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using self, stmt: code)

func BitArray.orWith [src]

Performs the bitwise OR operation between the elements of the current BitArray and the corresponding elements in the specified array.

func orWith(using self, other: Self)

The current BitArray will be modified to store the result of the bitwise OR operation.

func BitArray.reserve [src]

Reserve the given amount of bits.

func reserve(using self, maxBits: u64)

The bits will not be initialized.

Reserve the given amount of bits and set an initial value to all bits.

func reserve(using self, maxBits: u64, initialValue: bool)

func BitArray.set [src]

Sets the bit at a specific position to the specified value.

func set(using self, index: u64, value: bool)

func BitArray.setAll [src]

Sets all bits to the specified value.

func setAll(using self, value: bool)

func BitArray.xorWith [src]

Performs the bitwise XOR operation between the elements of the current BitArray and the corresponding elements in the specified array.

func xorWith(using self, other: Self)

The current BitArray will be modified to store the result of the bitwise XOR operation.

struct Core.ByteStream [src]

readBuffer const [..] u8
writeBuffer *Array'(u8)
seek u64
eof bool

Functions

getSeek Returns the seek value.
isEof Returns true if end has been reached.
length Returns length of associated slice.
moveSeek Seek to the next byte.
openRead Creates a byte stream to read from a slice.
openWrite Creates a byte stream to write to an array.
peekU8 Read one byte and seek.
readBytes Read the given amount of bytes.
readData Get the buffer of datas to read.
readNative Read a native type value.
readU8 Read one byte and seek.
remainReadToSlice Returns a slice of the remaing bytes to read.
remainReadToString Returns a string of the remaing bytes to read.
setSeek Seek to the given position.
writeBytes Write the given amount of bytes.
writeNative Write a native type value.

func ByteStream.getSeek [src]

Returns the seek value.

func getSeek(using const self)->u64

func ByteStream.isEof [src]

Returns true if end has been reached.

func isEof(using const self)->bool

func ByteStream.length [src]

Returns length of associated slice.

func length(using const self)->u64

func ByteStream.moveSeek [src]

Seek to the next byte.

func moveSeek(using self, offset: u64 = 1)

func ByteStream.openRead [src]

Creates a byte stream to read from a slice.

func openRead(readBuffer: const [..] u8)->ByteStream

func ByteStream.openWrite [src]

Creates a byte stream to write to an array.

func openWrite(writeBuffer: *Array'u8)->Core.ByteStream

func ByteStream.peekU8 [src]

Read one byte and seek.

func peekU8(using self)->u8

func ByteStream.readBytes [src]

Read the given amount of bytes.

func readBytes(using self, dest: *u8, count: u64) throw

func ByteStream.readData [src]

Get the buffer of datas to read.

func readData(using self)->const ^u8

func ByteStream.readNative [src]

Read a native type value.

func(T) readNative(using self)->T throw

func ByteStream.readU8 [src]

Read one byte and seek.

func readU8(using self)->u8

func ByteStream.remainReadToSlice [src]

Returns a slice of the remaing bytes to read.

func remainReadToSlice(using self)->const [..] u8

func ByteStream.remainReadToString [src]

Returns a string of the remaing bytes to read.

func remainReadToString(using self)->string

func ByteStream.setSeek [src]

Seek to the given position.

func setSeek(using self, offset: u64)

func ByteStream.writeBytes [src]

Write the given amount of bytes.

func writeBytes(using self, slice: const [..] u8)

func ByteStream.writeNative [src]

Write a native type value.

func(T) writeNative(using self, val: T)

enum Core.CharacterSet [src]

Latin1
Unicode

namespace Core.CommandLine

Structs

IsSet The IsSet generic struct is a mirror of the user input struct.
ParseOptions
Result Result of the [parse] function.

Functions

getField
isOption Returns true if oneArg is a valid option (starting with a delimiter).
parse Parse all the arguments and fill the result.
splitArguments Clean and split a list of arguments -option:value or -option=value => -option value.

Attributes

ArgParams

attr CommandLine.ArgParams [src]

Usage: all
attr ArgParams(nameAlias: string = null)

struct CommandLine.IsSet [src]

The IsSet generic struct is a mirror of the user input struct.

struct IsSet(T)

Each field has the same name as the original one, but with a bool type.

It will indicate, after the command line parsing, that the corresponding argument has been specified or not by the user.

struct CommandLine.ParseOptions [src]

struct CommandLine.Result [src]

Result of the [parse] function.

struct Result(T)
isSet CommandLine.IsSet'(Core.CommandLine.IsSet.T)

func CommandLine.getField [src]

func getField(typeStruct: const *Swag.TypeInfoStruct, name: string)->const *Swag.TypeValue

func CommandLine.isOption [src]

Returns true if oneArg is a valid option (starting with a delimiter).

func isOption(oneArg: string, _options: ParseOptions)->bool

func CommandLine.parse [src]

Parse all the arguments and fill the result.

func(T) parse(st: *T, args: const [..] string, options = CommandLine.ParseOptions{})->CommandLine.Result'(Core.CommandLine.Result.T) throw

func parse.checkNext [src]

func checkNext() throw

func CommandLine.splitArguments [src]

Clean and split a list of arguments -option:value or -option=value => -option value.

func splitArguments(args: const [..] string, options: ParseOptions)->Array'(string)

namespace Core.Compress

Structs

BitStream
Deflate
Inflate
ZLib

struct Compress.BitStream [src]

stream const [..] u8
curByte u64
codeBuffer u32
numBits u8
eof bool

Functions

consumeBits
curPtr
discardToNextByte
init
peek32
peek32Be
peekBits
peekBitsNoRefill
peekBytes
readBits
readBitsNoRefill
refill
revert
size
startPtr

func BitStream.consumeBits [src]

func consumeBits(using self, width: u8)

func BitStream.curPtr [src]

func curPtr(using self)->const ^u8

func BitStream.discardToNextByte [src]

func discardToNextByte(using self)

func BitStream.init [src]

func init(using self, buf: const [..] u8)

func BitStream.peek32 [src]

func peek32(using self, dest: ^u8)

func BitStream.peek32Be [src]

func peek32Be(using self, dest: ^u8)

func BitStream.peekBits [src]

func peekBits(using self, width: u8)->u32

func BitStream.peekBitsNoRefill [src]

func peekBitsNoRefill(using self, width: u8)->u32

func BitStream.peekBytes [src]

func peekBytes(using self, width: u8, dest: ^u8)

func BitStream.readBits [src]

func readBits(using self, width: u8)->u32

func BitStream.readBitsNoRefill [src]

func readBitsNoRefill(using self, width: u8)->u32

func BitStream.refill [src]

func refill(using self, width = 24'u8)

func BitStream.revert [src]

func revert(using self)

func BitStream.size [src]

func size(using self)->u64

func BitStream.startPtr [src]

func startPtr(using self)->const ^u8

struct Compress.Deflate [src]

Functions

compress Compress the source buffer.
init Initialize the compressor Can be called multiple times.

Special Functions

opDrop

enum Deflate.CompressionFlags [src]

Zero
ComputeAdler32
Default

enum Deflate.CompressionLevel [src]

NoCompression
BestSpeed
Default
BestCompression
UberCompression

enum Deflate.CompressionStrategy [src]

Default
Filtered
HuffmanOnly
Rle
Fixed

func Deflate.compress [src]

Compress the source buffer.

func compress(using self, result: *Array'u8, src: const [..] u8) throw

func Deflate.init [src]

Initialize the compressor Can be called multiple times.

func init(using self, level = CompressionLevel.Default, strategy = CompressionStrategy.Default, flags = CompressionFlags.Default)

func Deflate.opDrop [src]

func opDrop(using self)

struct Compress.Inflate [src]

Functions

decompress Decompress the associated stream.

func Inflate.decompress [src]

Decompress the associated stream.

func decompress(using self, buf: const [..] u8, winSize: u32 = InflateMaxDistance)->Array'(u8) throw

struct Compress.ZLib [src]

Functions

compress Decompress stream.
decompress Decompress stream.

func ZLib.compress [src]

Decompress stream.

func compress(using self, buffer: const [..] u8, level = Deflate.CompressionLevel.Default)->Array'(u8) throw

func ZLib.decompress [src]

Decompress stream.

func decompress(using self, buffer: const [..] u8)->Array'(u8) throw

struct Core.ConcatBuffer [src]

Represents a growable buffer, which is divided in buckets to avoid a copy/realloc when the buffer needs to increase its size. This is the main difference with Array.

allocator Swag.IAllocator
firstBucket *ConcatBufferBucket
curBucket *ConcatBufferBucket
lastBucket *ConcatBufferBucket
currentSP ^u8
granularity u64
isAtEnd bool
viewFirstBucket ConcatBufferBucket

Functions

addBytes Append a slice of bytes to the buffer If contiguous is false, the slice will be divided in chunks if necessary.
addNative Append one byte to the buffer.
addStruct Append the content of a struct.
clear Clear the content without freing the buffers.
count Returns the number of bytes.
getOffset Get the linearized seek offset.
getSeek Returns the current seek in the buffer.
grow Be sure that there is enough room to store at least numBytes bytes.
makeLinear linearize all buckets in one single big bucket.
moveSeek Seek current write pointer.
moveToString Move the content of the buffer to the String if possible.
release Release all allocated buffers.
setAllocator Associate an allocator with the buffer.
setBucketSize Set the granularity of datas when allocated new buckets. Minimum size is 4.
setEndSeek Set the end seek.
setFirstBucket Share data with the firstBucket.
setSeek Set the current seek.
toSlice Convert to a slice only if the buffer is linear, or return null.
toString Convert the buffer to a String.

Special Functions

opCount
opDrop
opVisit Visit all valid buckets.

func ConcatBuffer.addBytes [src]

Append a slice of bytes to the buffer If contiguous is false, the slice will be divided in chunks if necessary.

func addBytes(using self, bytes: const [..] u8, contiguous = true)

func ConcatBuffer.addNative [src]

Append one byte to the buffer.

func(T) addNative(using self, val: T)

func ConcatBuffer.addStruct [src]

Append the content of a struct.

func(T) addStruct(using self, val: T)

func ConcatBuffer.clear [src]

Clear the content without freing the buffers.

func clear(using self)

func ConcatBuffer.count [src]

Returns the number of bytes.

func count(using self)->u64

func ConcatBuffer.getOffset [src]

Get the linearized seek offset.

func getOffset(seek: ConcatBufferSeek)->u64

func ConcatBuffer.getSeek [src]

Returns the current seek in the buffer.

func getSeek(using self)->ConcatBufferSeek

func ConcatBuffer.grow [src]

Be sure that there is enough room to store at least numBytes bytes.

func grow(using self, numBytes: u64)

func ConcatBuffer.makeLinear [src]

linearize all buckets in one single big bucket.

func makeLinear(using self)

func ConcatBuffer.moveSeek [src]

Seek current write pointer.

func moveSeek(using self, num: u64)

func ConcatBuffer.moveToString [src]

Move the content of the buffer to the String if possible.

func moveToString(using self)->String

If a direct move is not possible because the buffer contains more than on bucket, then a copy will be made instead.

func ConcatBuffer.opCount [src]

func opCount(using self)->u64

func ConcatBuffer.opDrop [src]

func opDrop(using self)

func ConcatBuffer.opVisit [src]

Visit all valid buckets.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using const self, stmt: code)

func ConcatBuffer.release [src]

Release all allocated buffers.

func release(using self)

func ConcatBuffer.setAllocator [src]

Associate an allocator with the buffer.

func setAllocator(using self, alloc: Swag.IAllocator)

The allocator can only be changed if the buffer has no pending buckets.

func ConcatBuffer.setBucketSize [src]

Set the granularity of datas when allocated new buckets. Minimum size is 4.

func setBucketSize(using self, size: u64)

func ConcatBuffer.setEndSeek [src]

Set the end seek.

func setEndSeek(using self, seek: ConcatBufferSeek)

func ConcatBuffer.setFirstBucket [src]

Share data with the firstBucket.

func setFirstBucket(using self, data: [..] u8)

func ConcatBuffer.setSeek [src]

Set the current seek.

func setSeek(using self, seek: ConcatBufferSeek)

func ConcatBuffer.toSlice [src]

Convert to a slice only if the buffer is linear, or return null.

func toSlice(using self)->[..] u8

See ConcatBuffer.makeLinear

func ConcatBuffer.toString [src]

Convert the buffer to a String.

func toString(using self, alloc: Swag.IAllocator = null)->String

A copy will be made, so the buffer is still valid after the call. See ConcatBuffer.moveToString

struct Core.ConcatBufferBucket [src]

datas ^u8
next *ConcatBufferBucket
count u64
size u64
countBefore u64

struct Core.ConcatBufferSeek [src]

bucket *ConcatBufferBucket
sp ^u8

namespace Core.Console

Enums

Color

Functions

fatal Fatal error Exit the process with code -1.
lock Use to access console with multiple threads.
print Write a bunch of parameters to the console.
printf Write a formatted message to the console.
println Write a line to the console.
prompt Wait for using input, and returns the corresponding string.
resetColor Restore the console colors to their default values.
setBackColor Set the console background color.
setTextColor Set the console foreground color.
silent Disable console output. This is a counter, so can be called multiple times with the same value Like any other console functions, this is not thread-safe => call lock before if necessary, and unlock after.
unlock

enum Console.Color [src]

Black
White
Gray
Red
Blue
Green
Cyan
Yellow
Magenta
DarkRed
DarkBlue
DarkGreen
DarkCyan
DarkYellow
DarkMagenta

func Console.fatal [src]

Fatal error Exit the process with code -1.

func fatal(msg: string, args: ...)

func Console.lock [src]

Use to access console with multiple threads.

func lock()

No console function is thread safe, so it is the user responsability to lock the console when necessary

func Console.print [src]

Write a bunch of parameters to the console.

func print(params: ...)

func Console.printf [src]

Write a formatted message to the console.

func printf(message: string, params: ...)

func Console.println [src]

Write a line to the console.

func println(params: ...)

func Console.prompt [src]

Wait for using input, and returns the corresponding string.

func prompt()->String

func Console.resetColor [src]

Restore the console colors to their default values.

func resetColor()

func Console.setBackColor [src]

Set the console background color.

func setBackColor(color: Color)

func Console.setTextColor [src]

Set the console foreground color.

func setTextColor(color: Color)

func Console.silent [src]

Disable console output. This is a counter, so can be called multiple times with the same value Like any other console functions, this is not thread-safe => call lock before if necessary, and unlock after.

func silent(value: bool)

func Console.unlock [src]

func unlock()

namespace Core.Debug

Functions

assert
breakPanic
safety
safetyBoundCheck

func Debug.assert [src]

func assert(expr: bool, message: string = null, loc = #callerlocation)

func Debug.breakPanic [src]

func breakPanic(message: string, loc = #callerlocation)

func Debug.safety [src]

func(what: string) safety(expr: bool, message: string = null, loc = #callerlocation)

func Debug.safetyBoundCheck [src]

func safetyBoundCheck(expr: bool, message: string = null, loc = #callerlocation)

namespace Core.Debugger

Functions

attach Try to attach to a debugger by calling "vsjitdebugger.exe" If it works, it will open a dialog box to pickup a visual studio instance.
debugBreak Trigger a breakpoint.
isAttached Returns true if a debugger is attached to the current process.
log Debug log.

func Debugger.attach [src]

Try to attach to a debugger by calling "vsjitdebugger.exe" If it works, it will open a dialog box to pickup a visual studio instance.

func attach() throw

func Debugger.debugBreak [src]

Trigger a breakpoint.

func debugBreak()

func Debugger.isAttached [src]

Returns true if a debugger is attached to the current process.

func isAttached()->bool

func Debugger.log [src]

Debug log.

func log(msg: string)

namespace Core.Directory

Structs

EnumerationOptions

Functions

create
enumerate Enumerate a directory.
enumerateDirectories Get all the directories in the given directory.
enumerateFiles Get all the files of the given directory.
exists Returns true if the given directory exists.
getCurrent Returns the current directory.
getDrives Get the list of logical drives.
getVolumes Get the list of volumes.
setCurrent Set the current directory.

struct Directory.EnumerationOptions [src]

matchExtension string
skipAttributes File.FileAttributes
recurse bool
wantFiles bool
wantDirectories bool
wantSpecialDirectories bool
filterLambda func(File.FileInfo)->bool

func Directory.create [src]

func create(dirname: string) throw

func Directory.enumerate [src]

Enumerate a directory.

func enumerate(dirName: string, options: EnumerationOptions)->Array'(Core.File.FileInfo) throw

func Directory.enumerateDirectories [src]

Get all the directories in the given directory.

func enumerateDirectories(dirName: string, matchExtension: string = null, recurse = false)->Array'(Core.File.FileInfo) throw

func Directory.enumerateFiles [src]

Get all the files of the given directory.

func enumerateFiles(dirName: string, matchExtension: string = null, recurse = false)->Array'(Core.File.FileInfo) throw

func Directory.exists [src]

Returns true if the given directory exists.

func exists(dirName: string)->bool

func Directory.getCurrent [src]

Returns the current directory.

func getCurrent()->String throw

func Directory.getDrives [src]

Get the list of logical drives.

func getDrives()->Array'(Core.String) throw

func Directory.getVolumes [src]

Get the list of volumes.

func getVolumes()->Array'(Core.String) throw

func Directory.setCurrent [src]

Set the current directory.

func setCurrent(dirName: string) throw

namespace Core.Env

Structs

Monitor Describes a physical monitor.
Process
StartInfo

Enums

SpecialDirectory

Functions

doSyncProcess Starts a new process with arguments, and wait for it to be done.
exit Exit the current process.
getArg Get a given argument, or null.
getArgs Get the program command line arguments as a [..] string.
getMonitors Get the list of all monitors.
getSpecialDirectory The system font directory.
hasArg Get a given argument, or null.
locateInExplorer Locate file in the file explorer.
locateUrl Locate file in the internet explorer.
startProcess(const &StartInfo) Starts a new process with arguments.
startProcess(string, string) Starts a new process with arguments.

struct Env.Monitor [src]

Describes a physical monitor.

rect Math.Rectangle
work Math.Rectangle
scale f32 Scale factor of this monitor.
rectReal Math.Rectangle The real monitor rect, without scaling.
workReal Math.Rectangle The real monitor work rect, without scaling.

struct Env.Process [src]

handle Env.ProcessHandle

Functions

waitForExit Wait for the process to be done.

func Process.waitForExit [src]

Wait for the process to be done.

func waitForExit(using self)

enum Env.SpecialDirectory [src]

Font
UserAppData
UserDocuments
CommonAppData
Desktop
UserPictures
UserVideos
UserMusic
CommonPictures
CommonVideos
CommonMusic

struct Env.StartInfo [src]

fileName string
arguments string

func Env.doSyncProcess [src]

Starts a new process with arguments, and wait for it to be done.

func doSyncProcess(fileName: string, arguments: string = null) throw

func Env.exit [src]

Exit the current process.

func exit(exitCode: u32)

func Env.getArg [src]

Get a given argument, or null.

func getArg(idx: u32)->string

func Env.getArgs [src]

Get the program command line arguments as a [..] string.

func getArgs()->const [..] string

func Env.getMonitors [src]

Get the list of all monitors.

func getMonitors()->Array'(Core.Env.Monitor)

func Env.getSpecialDirectory [src]

The system font directory.

func getSpecialDirectory(what: SpecialDirectory)->String

func Env.hasArg [src]

Get a given argument, or null.

func hasArg(arg: string)->bool

func Env.locateInExplorer [src]

Locate file in the file explorer.

func locateInExplorer(name: string)

func Env.locateUrl [src]

Locate file in the internet explorer.

func locateUrl(name: string)

func Env.startProcess [src]

Starts a new process with arguments.

func startProcess(info: StartInfo)->Env.Process throw func startProcess(fileName: string, arguments: string = null)->Env.Process throw

namespace Core.Errors

Structs

BadParameterError
FileNotFoundError
InvalidFileNameError
InvalidFormatError
InvalidVersion
OverflowError
ParseIncompleteError
SerializationError
SyntaxError
UnsupportedFormatError

Functions

mkString Make a string persistent for errors.

struct Errors.BadParameterError [src]

using base Swag.BaseError

struct Errors.FileNotFoundError [src]

using base Swag.BaseError
fileName string

struct Errors.InvalidFileNameError [src]

using base Swag.BaseError
fileName string

struct Errors.InvalidFormatError [src]

using base Swag.BaseError

struct Errors.InvalidVersion [src]

wantedVersion u32
foundVersion u32

struct Errors.OverflowError [src]

using base Swag.BaseError

struct Errors.ParseIncompleteError [src]

using base Swag.BaseError

struct Errors.SerializationError [src]

using base Swag.BaseError
field Swag.TypeValue Can contain the bad field.

struct Errors.SyntaxError [src]

using base Swag.BaseError
line u64
col u64
seek u64

struct Errors.UnsupportedFormatError [src]

using base Swag.BaseError

func Errors.mkString [src]

Make a string persistent for errors.

func mkString(str: string)->string

That kind of string can be stored in an error struct.

namespace Core.File

Structs

FileInfo
FileStream
Folder
TextReader
TweakFile

Enums

FileAccess
FileAttributes
FileMode
FileShare
SeekOrigin
TextEncoding

Functions

delete Delete the specified file.
duplicate Duplicate a file.
exists Returns true if the given file exists.
getAttributes Returns attributes associated to the given filename.
getFileInfo Get informations about a file.
getInfo Returns various file informations.
open Open a new file stream.
openRead Creates a new file stream for reading.
openWrite Creates a new file stream for writing.
readAllBytes Read a file, and store the result in an array of bytes.
readAllLines Read all the lines of a file.
readAllText Read a file, and store the result in an utf8 string.
readEachLines Call user code for each line.
touch Change the file write date/time.
writeAllBytes(string, const &ConcatBuffer) Write a file with the content of a ConcatBuffer.
writeAllBytes(string, const [..] u8) Write a file with the content of a slice of bytes.
writeAllLines Write a file with the content of an array of string, one per line.

enum File.FileAccess [src]

Read
Write
ReadWrite

enum File.FileAttributes [src]

Zero
ReadOnly
Hidden
System
Directory
Archive
Device
Normal
Temporary
SparseFile
ReparsePoint
Compressed
Offline
NotContentIndexed
Encrypted

struct File.FileInfo [src]

fullname String
attributes File.FileAttributes
creationTime Time.DateTime
lastAccessTime Time.DateTime
lastWriteTime Time.DateTime
size u64

Functions

isDirectory

func FileInfo.isDirectory [src]

func isDirectory(using const self)->bool

enum File.FileMode [src]

Append
Create
CreateNew
Open
OpenOrCreate
Truncate

enum File.FileShare [src]

Zero
Delete
Inheritable
Read
Write
ReadWrite

struct File.FileStream [src]

name String
handle File.FileHandle
canRead bool
canSeek bool
canWrite bool

Functions

close Close the given file stream.
getPosition Returns the current seek position of the given file stream.
getSize Returns the given file stream length on disk.
isOpen Returns true if the stream is valid.
read Read from the given file stream, and returns the number of bytes.
readValue Read from the given file stream, and returns true if all bytes have been read.
setPosition Set the current seek position of the given file stream.
skipPosition Skip bytes from current position.
write Write to the given file stream, and returns the number of written bytes.

Special Functions

opDrop

func FileStream.close [src]

Close the given file stream.

func close(using self)

func FileStream.getPosition [src]

Returns the current seek position of the given file stream.

func getPosition(using self)->u64 throw

func FileStream.getSize [src]

Returns the given file stream length on disk.

func getSize(using self)->u64 throw

func FileStream.isOpen [src]

Returns true if the stream is valid.

func isOpen(using const self)->bool

func FileStream.opDrop [src]

func opDrop(using self)

func FileStream.read [src]

Read from the given file stream, and returns the number of bytes.

func read(using self, buffer: *void, length: u64)->u64

func FileStream.readValue [src]

Read from the given file stream, and returns true if all bytes have been read.

func(T) readValue(using self, buffer: *T)->bool

func FileStream.setPosition [src]

Set the current seek position of the given file stream.

func setPosition(using self, origin: SeekOrigin, seek: u64) throw

func FileStream.skipPosition [src]

Skip bytes from current position.

func skipPosition(using self, bytes: u64) throw

func FileStream.write [src]

Write to the given file stream, and returns the number of written bytes.

func write(using self, buffer: const *void, length: u64)->u64 throw

struct File.Folder [src]

type const *Swag.TypeInfo
data ^void

enum File.SeekOrigin [src]

Begin
Current
End

enum File.TextEncoding [src]

Ascii
Utf8

struct File.TextReader [src]

stream File.FileStream
buffer Array'(u8)
encodingType File.TextEncoding
byteSeek u64
bufferSize u64
checkPreamble bool

Functions

close Close the reader.
open Open the reader.
readLine Read one line of text.
readToEnd Read from the current position to the end, and returns the corresponding utf8 string.

func TextReader.close [src]

Close the reader.

func close(using self)

func TextReader.open [src]

Open the reader.

func open(using self, fullname: string, encoding = TextEncoding.Utf8) throw

func TextReader.readLine [src]

Read one line of text.

func readLine(using self, result: &String)->bool

Returns false if the end of the stream has been reached.

func TextReader.readToEnd [src]

Read from the current position to the end, and returns the corresponding utf8 string.

func readToEnd(using self)->String

struct File.TweakFile [src]

folders Array'(Core.File.Folder)

Functions

parse(self, const &Array'(string)) Parse a list of lines.
parse(self, string) Parse a list of lines.
parseFile Read and parse a file.
registerFolder Register a new structure to be parsed.

func TweakFile.parse [src]

Parse a list of lines.

func parse(using self, content: string) throw func parse(using self, lines: Array'string) throw

func TweakFile.parseFile [src]

Read and parse a file.

func parseFile(using self, fileName: string) throw

func TweakFile.registerFolder [src]

Register a new structure to be parsed.

func(T) registerFolder(using self, folder: *T)

func File.delete [src]

Delete the specified file.

func delete(fullName: string) throw

func File.duplicate [src]

Duplicate a file.

func duplicate(newName, oldName: string) throw

func File.exists [src]

Returns true if the given file exists.

func exists(fullName: string)->bool

func File.getAttributes [src]

Returns attributes associated to the given filename.

func getAttributes(fullName: string)->File.FileAttributes throw

func File.getFileInfo [src]

Get informations about a file.

func getFileInfo(fullName: string)->File.FileInfo throw

func File.getInfo [src]

Returns various file informations.

func getInfo(fullname: string)->File.FileInfo throw

func File.open [src]

Open a new file stream.

func open(fullName: string, mode: FileMode, access: FileAccess, share: FileShare)->File.FileStream throw

func File.openRead [src]

Creates a new file stream for reading.

func openRead(fullName: string)->File.FileStream throw

func File.openWrite [src]

Creates a new file stream for writing.

func openWrite(fullName: string)->File.FileStream throw

func File.readAllBytes [src]

Read a file, and store the result in an array of bytes.

func readAllBytes(fullname: string)->Array'(u8) throw

func File.readAllLines [src]

Read all the lines of a file.

func readAllLines(fullname: string, encoding = TextEncoding.Utf8)->Array'(Core.String) throw

func File.readAllText [src]

Read a file, and store the result in an utf8 string.

func readAllText(fullname: string, encoding = TextEncoding.Utf8, normalizeEol = false)->String throw

func File.readEachLines [src]

Call user code for each line.

#[Swag.Macro] func readEachLines(fullname: string, encoding = TextEncoding.Utf8, stmt: code) throw

func File.touch [src]

Change the file write date/time.

func touch(fullName: string) throw

func File.writeAllBytes [src]

Write a file with the content of a slice of bytes.

func writeAllBytes(fullname: string, buffer: const [..] u8)->u64 throw

Write a file with the content of a ConcatBuffer.

func writeAllBytes(fullname: string, buffer: ConcatBuffer)->u64 throw

func File.writeAllLines [src]

Write a file with the content of an array of string, one per line.

func writeAllLines(fullname: string, lines: Array'string)->u64 throw

namespace Core.Format

Functions

append Format a string and put the result in a ConcatBuffer.
checkFormat Check if this is a valid fmt/values pair, coherent with format specification.
countPercent Count the number of valid % placeholders in the string format.
replaceString Format a string in dest.
toInterp(*ConcatBuffer, string) String interpolation.
toInterp(string) String interpolation.
toString Format a string and returns the result as a String.
toStringTemp Returns a formatted string stored in the temporary allocator.

func Format.append [src]

Format a string and put the result in a ConcatBuffer.

func append(buf: *ConcatBuffer, fmt: string, values: ...)

func Format.checkFormat [src]

Check if this is a valid fmt/values pair, coherent with format specification.

func checkFormat(fct: string, fmt: string, values: ...)

func Format.countPercent [src]

Count the number of valid % placeholders in the string format.

func countPercent(fmt: string)->u32

Note that %% will not be counted, as this represents the % character

func Format.replaceString [src]

Format a string in dest.

func replaceString(dest: *String, fmt: string, values: ...)

Can be a lot faster than the convenient version which returns a String.

func Format.toInterp [src]

String interpolation.

#[Swag.Macro] func toInterp(buf: *ConcatBuffer, exp: string)

Format is {<value to interpolate>:format}

String interpolation.

#[Swag.Macro] func toInterp(exp: string)->String

func Format.toString [src]

Format a string and returns the result as a String.

func toString(fmt: string, values: ...)->String

Use % as a place holder for a value.

let x = Format.toString("my life is %", myLife)

% can be followed by a format option between {}.

let x = Format.toString("my life in hexadecimal is %{X}", myLife)

func Format.toStringTemp [src]

Returns a formatted string stored in the temporary allocator.

func toStringTemp(fmt: string, values: ...)->string

namespace Core.Globalization

Structs

CultureInfo
NumberFormatInfo Provides culture-specific information for formatting and parsing numeric values.

Functions

getCultureInfo Returns the global culture info structure.

struct Globalization.CultureInfo [src]

numberFormat Globalization.NumberFormatInfo

struct Globalization.NumberFormatInfo [src]

Provides culture-specific information for formatting and parsing numeric values.

negativeSign u8
positiveSign u8
decimalSeparator u8

func Globalization.getCultureInfo [src]

Returns the global culture info structure.

func getCultureInfo()->*Globalization.CultureInfo

namespace Core.Hardware

Functions

getMacAddress Max address.
getProcessorCount Number of processors.

func Hardware.getMacAddress [src]

Max address.

func getMacAddress()->u64

func Hardware.getProcessorCount [src]

Number of processors.

func getProcessorCount()->u32

namespace Core.Hash

Structs

Adler32
City32
Crc32
Md5
Sha256

Functions

hash32 Hash the given value and returns the corresponding u32.
jenkins(u32)
jenkins(u64)
murmur3(u32)
murmur3(u32, u32)
murmur3(u64)
murmur3(u64, u64)

struct Hash.Adler32 [src]

adler u32

Functions

compute Returns the adler32 hash value for the given buffer.
init Initialize the hashing sequence.
update Update the hash value with buffer content.

func Adler32.compute [src]

Returns the adler32 hash value for the given buffer.

func compute(buffer: const [..] u8)->u32

func Adler32.init [src]

Initialize the hashing sequence.

func init(using self)

func Adler32.update [src]

Update the hash value with buffer content.

func update(using self, buffer: const [..] u8)

struct Hash.City32 [src]

crc u32

Functions

compute Returns the hash value for the given buffer.
init Initialize the hashing sequence.
update Update the hash value with buffer content.

func City32.compute [src]

Returns the hash value for the given buffer.

func compute(buffer: const [..] u8)->u32

func City32.init [src]

Initialize the hashing sequence.

func init(using self)

func City32.update [src]

Update the hash value with buffer content.

func update(using self, data: const [..] u8)

struct Hash.Crc32 [src]

crc u32

Functions

compute Returns the hash value for the given buffer.
init Initialize the hashing sequence.
update Update the hash value with buffer content.

func Crc32.compute [src]

Returns the hash value for the given buffer.

func compute(buffer: const [..] u8)->u32

func Crc32.init [src]

Initialize the hashing sequence.

func init(using self)

func Crc32.update [src]

Update the hash value with buffer content.

func update(using self, data: const [..] u8)

interface Hash.IHash32 [src]

compute func(const *Hash.IHash32)->u32

struct Hash.Md5 [src]

padding [64] u8
state [4] u32
count [2] u32
buffer [64] u8

Functions

compute Returns the md5 value for the given buffer.
final Finalize the computation.
init Initialize the hashing sequence.
toString Convert a MD5 result to a string.
update Update the hash value with buffer content.

func Md5.compute [src]

Returns the md5 value for the given buffer.

func compute(buffer: const [..] u8)->Hash.Md5.Digest

func Md5.final [src]

Finalize the computation.

func final(using self, digest: Digest)

func Md5.init [src]

Initialize the hashing sequence.

func init(using self)

func Md5.toString [src]

Convert a MD5 result to a string.

func toString(digest: Digest)->String

func Md5.update [src]

Update the hash value with buffer content.

func update(using self, data: const [..] u8)

struct Hash.Sha256 [src]

data [64] u8
state [8] u32
datalen u32
bitlen u64

Functions

compute Returns the sha256 value for the given buffer.
final Finalize the computation.
init Initialize the hashing sequence.
update Update the hash value with buffer content.

func Sha256.compute [src]

Returns the sha256 value for the given buffer.

func compute(buffer: const [..] u8)->Hash.Sha256.Digest

func Sha256.final [src]

Finalize the computation.

func final(using self, result: Digest)

func Sha256.init [src]

Initialize the hashing sequence.

func init(using self)

func Sha256.update [src]

Update the hash value with buffer content.

func update(using self, buffer: const [..] u8)

func Hash.hash32 [src]

Hash the given value and returns the corresponding u32.

func(T) hash32(value: T)->u32

func Hash.jenkins [src]

func jenkins(h: u64)->u64 func jenkins(h: u32)->u32

func Hash.murmur3 [src]

func murmur3(h: u32)->u32 func murmur3(h: u64)->u64 func murmur3(a, b: u32)->u32 func murmur3(a, b: u64)->u64

struct Core.HashSet [src]

A set of unique values.

struct HashSet(K)
HASH_FREE s32
HASH_DELETED s32
HASH_FIRST s32
HASH_MASK s32
allocator Swag.IAllocator
table ^HashSetEntry'(Core.HashSetEntry.K)
count u64 Number of valid entries.
capacity u64 Number of total entries the table can hold.
deleted u64 Number of deleted entries.

Functions

add(self, &&K) Add a new element.
add(self, K) Add a new element.
clear Remove all elements.
contains Returns true if the table contains the given element.
emplaceInternal Add a new element.
free Free the hashset content.
getNewIndex
grow
hashKey
remove Remove the given element if it exists.
reserve Reserve newCapacity elements in the set.

Special Functions

opAffect
opCount
opDrop
opPostCopy
opVisit

func IConvert.convert [src]

func convert(using self, buf: *ConcatBuffer, convFormat: StrConv.ConvertFormat, strFormat: string)

func HashSet.add [src]

Add a new element.

func add(using self, key: self.K)->*HashSetEntry'(Core.HashSetEntry.K) func add(using self, key: &&self.K)->*Core.HashSetEntry'(HashSetEntry.K)

func HashSet.clear [src]

Remove all elements.

func clear(using self)

func HashSet.contains [src]

Returns true if the table contains the given element.

func contains(using const self, key: self.K)->bool

func HashSet.emplaceInternal [src]

Add a new element.

func emplaceInternal(using self, hashVal: u32, key: &self.K)->*HashSetEntry'(Core.HashSetEntry.K)

func HashSet.free [src]

Free the hashset content.

func free(using self)

func HashSet.getNewIndex [src]

func getNewIndex(using self, key: self.K, idx: u64, hashVal: u64)->u64

func HashSet.grow [src]

func grow(using self)

func HashSet.hashKey [src]

func hashKey(key: K)->u32

func HashSet.opAffect [src]

func opAffect(using self, slice: const [..] self.K)

func HashSet.opCount [src]

func opCount(using self)->u64

func HashSet.opDrop [src]

func opDrop(using self)

func HashSet.opPostCopy [src]

func opPostCopy(using self)

func HashSet.opVisit [src]

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using const self, stmt: code)

func HashSet.remove [src]

Remove the given element if it exists.

func remove(using self, key: self.K)

func HashSet.reserve [src]

Reserve newCapacity elements in the set.

func reserve(using self, newCapacity: u64)

struct Core.HashSetEntry [src]

struct HashSetEntry(K)
hash u32
key HashSetEntry.K

struct Core.HashTable [src]

Map a key to a value.

struct HashTable(K, V)
HASH_FREE s32
HASH_DELETED s32
HASH_FIRST s32
HASH_MASK s32
allocator Swag.IAllocator
table ^HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)
count u64 Number of valid entries.
capacity u64 Number of total entries the table can hold.
deleted u64 Number of deleted entries.

Functions

add(self, K, &&V, bool) Add a new key value pair.
add(self, K, V, bool) Add a new key value pair.
clear Remove all elements.
contains Returns true if the table contains the given key.
emplaceInternal Use with care !.
find Find the given key, and returns the corresponding entry.
findOrAdd Get the entry if it exists, or creates a new one with a default value.
free Free the hashtable content.
get Find the given key, and returns the corresponding value.
getNewIndex
grow
hashKey
remove Remove the given key if it exists.
reserve Reserve newCapacity elements in the table.

Special Functions

opAffect
opCount
opDrop
opIndex(self, K)
opIndex(self, K)
opIndexAffect
opPostCopy
opVisit alias0 is the key, and alias1 is the value.

func IConvert.convert [src]

func convert(using self, buf: *ConcatBuffer, convFmt: StrConv.ConvertFormat, strFormat: string)

func HashTable.add [src]

Add a new key value pair.

func add(using self, key: self.K, value: self.V, updateValue = true)->*HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)

If the key already exists, then the value will be replaced if updateValue is true.

Add a new key value pair.

func add(using self, key: self.K, value: &&self.V, updateValue = true)->*HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)

If the key already exists, then the value will be replaced if updateValue is true.

func HashTable.clear [src]

Remove all elements.

func clear(using self)

func HashTable.contains [src]

Returns true if the table contains the given key.

func contains(using const self, key: self.K)->bool

func HashTable.emplaceInternal [src]

Use with care !.

func emplaceInternal(using self, hashVal: u32, key: &self.K, value: &self.V)->*HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)

func HashTable.find [src]

Find the given key, and returns the corresponding entry.

func find(using const self, key: self.K)->*HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)

Returns null if the key is not there.

func HashTable.findOrAdd [src]

Get the entry if it exists, or creates a new one with a default value.

func findOrAdd(using self, key: self.K)->*HashTableEntry'(Core.HashTableEntry.K, Core.HashTableEntry.V)

func HashTable.free [src]

Free the hashtable content.

func free(using self)

func HashTable.get [src]

Find the given key, and returns the corresponding value.

func get(using const self, key: self.K, val: self.V)->HashTable.V

If the key does not exist, then it will return val instead

func HashTable.getNewIndex [src]

func getNewIndex(using self, key: self.K, idx: u64, hashVal: u64)->u64

func HashTable.grow [src]

func grow(using self)

func HashTable.hashKey [src]

func hashKey(key: K)->u32

func HashTable.opAffect [src]

func opAffect(using self, slice: const [..] (K, V) { k: self.K, v: self.V } )

func HashTable.opCount [src]

func opCount(using self)->u64

func HashTable.opDrop [src]

func opDrop(using self)

func HashTable.opIndex [src]

func opIndex(using const self, key: self.K)->const &HashTable.V func opIndex(using self, key: self.K)->&HashTable.V

func HashTable.opIndexAffect [src]

func opIndexAffect(using self, key: self.K, val: self.V)

func HashTable.opPostCopy [src]

func opPostCopy(using self)

func HashTable.opVisit [src]

alias0 is the key, and alias1 is the value.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using const self, stmt: code)

func HashTable.remove [src]

Remove the given key if it exists.

func remove(using self, key: self.K)

func HashTable.reserve [src]

Reserve newCapacity elements in the table.

func reserve(using self, newCapacity: u64)

struct Core.HashTableEntry [src]

struct HashTableEntry(K, V)
hash u32
key HashTableEntry.K
value HashTableEntry.V

interface Core.ILogWriter [src]

print func(*ILogWriter, string)

namespace Core.Input

Structs

GamePad Represents a gamepad.
GamePadState Represents specific information about the state of the controller, including the current state of buttons and sticks.
Keyboard Allows getting keystrokes from keyboard.
KeyboardState Represents one keyboard state.
KeyboardStateNative
Mouse Allows reading position and button click information from mouse.
MouseState Represents one mouse state.

Enums

GamePadButton Enumerates gamepad buttons.
Key Defines the keys on a keyboard.
KeyModifiers
MouseButton

Functions

getKeyName Returns a "shortcut" display name.
getMousePos Returns the current mouse position.
setMousePos Set the current mouse position.
showMouseCursor Shoud or hide the mouse cursor.

struct Input.GamePad [src]

Represents a gamepad.

previousState Input.GamePadState
currentState Input.GamePadState
padIndex u32
connected bool

Functions

clear Reset the previous and current state.
getPosition Get the analog position of the given button.
isButtonJustPressed Determines whether specified input device button has just been pressed.
isButtonJustReleased Determines whether specified input device button has just been released.
isButtonPressed Determines whether specified input device button is pressed.
isButtonReleased Determines whether specified input device button is released (not pressed).
isConnected Returns true if the corresponding padIndex is connected.
setVibration(self, f32, f32) Set the vibration motor speeds.
setVibration(u32, f32, f32) Set the left and right vibration of the given padIndex.
update Update the GamePad current state.

func GamePad.clear [src]

Reset the previous and current state.

func clear(using self)

func GamePad.getPosition [src]

Get the analog position of the given button.

func getPosition(using self, button: GamePadButton)->Math.Point

func GamePad.isButtonJustPressed [src]

Determines whether specified input device button has just been pressed.

func isButtonJustPressed(using self, button: GamePadButton)->bool

func GamePad.isButtonJustReleased [src]

Determines whether specified input device button has just been released.

func isButtonJustReleased(using self, button: GamePadButton)->bool

func GamePad.isButtonPressed [src]

Determines whether specified input device button is pressed.

func isButtonPressed(using self, button: GamePadButton)->bool

func GamePad.isButtonReleased [src]

Determines whether specified input device button is released (not pressed).

func isButtonReleased(using self, button: GamePadButton)->bool

func GamePad.isConnected [src]

Returns true if the corresponding padIndex is connected.

func isConnected(padIndex: u32)->bool

func GamePad.setVibration [src]

Set the left and right vibration of the given padIndex.

func setVibration(padIndex: u32, left, right: f32) throw

Set the vibration motor speeds.

func setVibration(using self, left, right: f32) throw

func GamePad.update [src]

Update the GamePad current state.

func update(using self) throw

enum Input.GamePadButton [src]

Enumerates gamepad buttons.

A
B
Back
BigButton
DPadDown
DPadLeft
DPadRight
DPadUp
LeftShoulder
LeftStick
LeftThumbstickDown
LeftThumbstickLeft
LeftThumbstickRight
LeftThumbstickUp
LeftTrigger
RightShoulder
RightStick
RightThumbstickDown
RightThumbstickLeft
RightThumbstickRight
RightThumbstickUp
RightTrigger
Start
X
Y

struct Input.GamePadState [src]

Represents specific information about the state of the controller, including the current state of buttons and sticks.

pressed [25] bool
position [25] Math.Point

Functions

clear Reset state to its default value.
update Compute the current state of the given pad index.

func GamePadState.clear [src]

Reset state to its default value.

func clear(using self)

func GamePadState.update [src]

Compute the current state of the given pad index.

func update(using self, padIndex: u32) throw

enum Input.Key [src]

Defines the keys on a keyboard.

None
A
Add
Apps
Attn
B
Back
BrowserBack
BrowserFavorites
BrowserForward
BrowserHome
BrowserRefresh
BrowserSearch
BrowserStop
C
Cancel
Capital
CapsLock
Clear
Control
Crsel
D
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
Decimal
Delete
Divide
Down
E
End
Enter
EraseEof
Escape
Execute
Exsel
F
F1
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F2
F20
F21
F22
F23
F24
F3
F4
F5
F6
F7
F8
F9
FinalMode
G
H
HanguelMode
HangulMode
HanjaMode
Help
Home
I
IMEAccept
IMEAceept
IMEConvert
IMEModeChange
IMENonConvert
Insert
J
JunjaMode
K
KanaMode
KanjiMode
L
LButton
LControl
LMenu
LShift
LWin
LaunchApplication1
LaunchApplication2
LaunchMail
Left
LineFeed
M
MButton
MediaNextTrack
MediaPlayPause
MediaPreviousTrack
MediaStop
MenuCtrl
Multiply
N
Next
NoName
NumLock
NumPad0
NumPad1
NumPad2
NumPad3
NumPad4
NumPad5
NumPad6
NumPad7
NumPad8
NumPad9
O
Oem1
Oem102
Oem2
Oem3
Oem4
Oem5
Oem6
Oem7
Oem8
OemBackslash
OemClear
OemCloseBrackets
OemComma
OemMinus
OemOpenBrackets
OemPeriod
OemPipe
OemPlus
OemQuestion
OemQuotes
OemSemicolon
OemTilde
P
Pa1
Packet
PageDown
PageUp
Pause
Play
Print
PrintScreen
Prior
Process
Q
R
RButton
RControl
RMenu
RShift
RWin
Return
Right
S
Scroll
Select
SelectMedia
Separator
Shift
Sleep
Space
Subtract
T
Tab
U
Up
V
VolumeDown
VolumeMute
VolumeUp
W
X
XButton1
XButton2
Y
Z
Zoom

enum Input.KeyModifiers [src]

Zero
Shift
Control
Alt
CtrlShift
CtrlAlt

struct Input.Keyboard [src]

Allows getting keystrokes from keyboard.

previousState Input.KeyboardState
currentState Input.KeyboardState
pressedRepeat [188] bool
pressedTime [188] u32
pressedRepeatStartTimeMs u32
pressedRepeatTimeMs u32
canRepeat bool

Functions

clear Reset the keyboard state.
getPressedModifiers Returns the currently pressed key modifiers.
isKeyJustPressed Determines whether given key has just been pressed.
isKeyJustReleased Determines whether given key has just been released.
isKeyPressed(self, Key) Determines whether given key is currently being pressed.
isKeyPressed(Key) Returns true if the given key is pressed.
isKeyReleased Determines whether given key is currently being released.
keyToRune Try to transform the given key to the corresponding rune.
keyToVirtualKey
update Compute current state of the keyboard (all keys).
virtualKeyToKey

func Keyboard.clear [src]

Reset the keyboard state.

func clear(using self)

func Keyboard.getPressedModifiers [src]

Returns the currently pressed key modifiers.

func getPressedModifiers(using self)->Input.KeyModifiers

func Keyboard.isKeyJustPressed [src]

Determines whether given key has just been pressed.

func isKeyJustPressed(using self, key: Key)->bool

func Keyboard.isKeyJustReleased [src]

Determines whether given key has just been released.

func isKeyJustReleased(using self, key: Key)->bool

func Keyboard.isKeyPressed [src]

Determines whether given key is currently being pressed.

func isKeyPressed(using self, key: Key)->bool

Returns true if the given key is pressed.

func isKeyPressed(key: Key)->bool

func Keyboard.isKeyReleased [src]

Determines whether given key is currently being released.

func isKeyReleased(using self, key: Key)->bool

func Keyboard.keyToRune [src]

Try to transform the given key to the corresponding rune.

func keyToRune(using self, key: Key)->rune

func Keyboard.keyToVirtualKey [src]

func keyToVirtualKey(key: Key)->Input.VirtualKey

func Keyboard.update [src]

Compute current state of the keyboard (all keys).

func update(using self)

func Keyboard.virtualKeyToKey [src]

func virtualKeyToKey(vkey: VirtualKey)->Input.Key

struct Input.KeyboardState [src]

Represents one keyboard state.

using native Input.KeyboardStateNative
pressed [188] bool

Functions

clear Reset keyboard state.
update Compute current keyboard state.

func KeyboardState.clear [src]

Reset keyboard state.

func clear(using self)

func KeyboardState.update [src]

Compute current keyboard state.

func update(using self)

struct Input.KeyboardStateNative [src]

nativeState [256] Win32.BYTE

struct Input.Mouse [src]

Allows reading position and button click information from mouse.

previousState Input.MouseState
currentState Input.MouseState
dblClk [5] bool
dblClkTimeMs u32

Functions

clear Reset the mouse state to its default value.
getMove Returns the move between the current position and the previous one.
getPosition Returns the mouse position.
getPreviousPos Returns the previous mouse position, before the last update.
isButtonDoubleClick
isButtonJustPressed Determines whether the specified mouse button has just been pressed.
isButtonJustReleased Determines whether the specified mouse button has just been released.
isButtonPressed(self, MouseButton) Determines whether the specified mouse button is pressed.
isButtonPressed(MouseButton) Determins if one given mouse button is pressed or not.
isButtonReleased Determines whether the specified mouse button is released.
update Compute the current state of the mouse.

func Mouse.clear [src]

Reset the mouse state to its default value.

func clear(using self)

func Mouse.getMove [src]

Returns the move between the current position and the previous one.

func getMove(using self)->Math.Point

func Mouse.getPosition [src]

Returns the mouse position.

func getPosition(using self)->Math.Point

func Mouse.getPreviousPos [src]

Returns the previous mouse position, before the last update.

func getPreviousPos(using self)->Math.Point

func Mouse.isButtonDoubleClick [src]

func isButtonDoubleClick(using self, button: MouseButton)->bool

func Mouse.isButtonJustPressed [src]

Determines whether the specified mouse button has just been pressed.

func isButtonJustPressed(using self, button: MouseButton)->bool

func Mouse.isButtonJustReleased [src]

Determines whether the specified mouse button has just been released.

func isButtonJustReleased(using self, button: MouseButton)->bool

func Mouse.isButtonPressed [src]

Determins if one given mouse button is pressed or not.

func isButtonPressed(button: MouseButton)->bool

Determines whether the specified mouse button is pressed.

func isButtonPressed(using self, button: MouseButton)->bool

func Mouse.isButtonReleased [src]

Determines whether the specified mouse button is released.

func isButtonReleased(using self, button: MouseButton)->bool

func Mouse.update [src]

Compute the current state of the mouse.

func update(using self)

enum Input.MouseButton [src]

Left
Middle
Right
XButton1
XButton2

struct Input.MouseState [src]

Represents one mouse state.

pressed [5] bool
pressedTime [5] u32
pressedPos [5] Math.Point
position Math.Point

Functions

clear Reset the state to its default value.
update Compute the actual state of the mouse.

func MouseState.clear [src]

Reset the state to its default value.

func clear(using self)

func MouseState.update [src]

Compute the actual state of the mouse.

func update(using self)

func Input.getKeyName [src]

Returns a "shortcut" display name.

func getKeyName(mdf: KeyModifiers, key: Key)->String

func Input.getMousePos [src]

Returns the current mouse position.

func getMousePos()->Math.Point

func Input.setMousePos [src]

Set the current mouse position.

func setMousePos(x, y: s32)

func Input.showMouseCursor [src]

Shoud or hide the mouse cursor.

func showMouseCursor(show: bool)

namespace Core.Jobs

Structs

ForJob
Job
SliceJob

Enums

JobState

Functions

getNumWorkers Returns number of threads in the job system.
isSynchrone Returns true is the job system has been initialized.
parallelFor Do a for for in parallel chunks.
parallelVisit Operate on a range in parallel chunks.
scheduleJob Schedule a job to execute.
setNumWorkers Set the number of worker threads. Must be done once.
waitDone Wait for all registered jobs to be finished.
waitJob Wait for a given job to be finished.

struct Jobs.ForJob [src]

using base Jobs.Job
startIndex u32
endIndex u32
userData *void

struct Jobs.Job [src]

lambda func(*void)
data *void
state Jobs.JobState
pendingIndex u32

enum Jobs.JobState [src]

Zero
InPending
Done

struct Jobs.SliceJob [src]

struct SliceJob(T)
using base Jobs.Job
buffer [..] Jobs.SliceJob.T
offset u32
userData *void

func Jobs.getNumWorkers [src]

Returns number of threads in the job system.

func getNumWorkers()->u32

func Jobs.isSynchrone [src]

Returns true is the job system has been initialized.

func isSynchrone()->bool

func Jobs.parallelFor [src]

Do a for for in parallel chunks.

#[Swag.Macro] func parallelFor(count: u32, userData: *void = null, stmt: code)

Exposed variables: - #alias0: current for index - #alias1: userData as passed to the macro

func Jobs.parallelVisit [src]

Operate on a range in parallel chunks.

#[Swag.Macro] func(T) parallelVisit(range: [..] T, offset: u32 = 1, userData: *void = null, stmt: code)

Exposed variables: - buffer: address of the element of the range to process - data: userData as passed to the macro

func Jobs.scheduleJob [src]

Schedule a job to execute.

func scheduleJob(job: *Job)

func Jobs.setNumWorkers [src]

Set the number of worker threads. Must be done once.

func setNumWorkers(numWorkers: u32 = 0) throw

func Jobs.waitDone [src]

Wait for all registered jobs to be finished.

func waitDone()

func Jobs.waitJob [src]

Wait for a given job to be finished.

func waitJob(job: *Job)

namespace Core.Latin1

Enums

CharAttribute

Functions

compare Compare two utf8 strings, dealing only with latin1 table Returns -1, 0 or 1.
compareNatural Compare two utf8 strings in a natural way, dealing only with latin1 table Returns -1, 0 or 1.
isAscii
isBinDigit
isControl
isDigit
isHexDigit
isLetter
isLetterOrDigit
isLower
isNumber
isPunctuation
isSpace
isSymbol
isUpper
isWord
makeLower Make an utf8 buffer lower case, dealing only with latin1 table.
makeUpper Make an utf8 buffer upper case, dealing only with latin1 table.
toLower
toUpper
trim Trim the string.

enum Latin1.CharAttribute [src]

Zero
Control
Punctuation
BinDigit
HexDigit
Digit
Symbol
Spacing
Upper
Lower
Printable
LowerUtf8
UpperUtf8
Graphical
Letter

func Latin1.compare [src]

Compare two utf8 strings, dealing only with latin1 table Returns -1, 0 or 1.

func compare(src, dst: const [..] u8, ignoreCase = false)->s32

func Latin1.compareNatural [src]

Compare two utf8 strings in a natural way, dealing only with latin1 table Returns -1, 0 or 1.

func compareNatural(src, dst: const [..] u8, ignoreCase = false)->s32

:LICENCE This code is based on natsort by Martin Pool (https://github.com/sourcefrog/natsort) The original code has been modified for Swag See LICENCE.md for the corresponding licence.

func Latin1.isAscii [src]

func isAscii(c: u8)->bool

func Latin1.isBinDigit [src]

func isBinDigit(c: u8)->bool

func Latin1.isControl [src]

func isControl(c: u8)->bool

func Latin1.isDigit [src]

func isDigit(c: u8)->bool

func Latin1.isHexDigit [src]

func isHexDigit(c: u8)->bool

func Latin1.isLetter [src]

func isLetter(c: u8)->bool

func Latin1.isLetterOrDigit [src]

func isLetterOrDigit(c: u8)->bool

func Latin1.isLower [src]

func isLower(c: u8)->bool

func Latin1.isNumber [src]

func isNumber(c: u8)->bool

func Latin1.isPunctuation [src]

func isPunctuation(c: u8)->bool

func Latin1.isSpace [src]

func isSpace(c: u8)->bool

func Latin1.isSymbol [src]

func isSymbol(c: u8)->bool

func Latin1.isUpper [src]

func isUpper(c: u8)->bool

func Latin1.isWord [src]

func isWord(c: u8)->bool

func Latin1.makeLower [src]

Make an utf8 buffer lower case, dealing only with latin1 table.

func makeLower(buffer: [..] u8)

func Latin1.makeUpper [src]

Make an utf8 buffer upper case, dealing only with latin1 table.

func makeUpper(buffer: [..] u8)

func Latin1.toLower [src]

func toLower(c: u8)->u8

func Latin1.toUpper [src]

func toUpper(c: u8)->u8

func Latin1.trim [src]

Trim the string.

func trim(str: string)->string

struct Core.List [src]

struct List(T)
head *ListNode'(Core.ListNode.T)
tail *ListNode'(Core.ListNode.T)
count u64

Functions

addBack(self, &&T) Add a new element on front.
addBack(self, T) Add a new element on front.
addFront(self, &&T) Add a new element on front.
addFront(self, T) Add a new element on front.
clear Clear all elements.
insertAfter(self, *ListNode'(T), &&T)
insertAfter(self, *ListNode'(T), T) Insert a node before the reference.
insertBefore(self, *ListNode'(T), &&T)
insertBefore(self, *ListNode'(T), T) Insert a node before the reference.

Special Functions

opDrop
opVisit Visit every elements of the list.

func List.addBack [src]

Add a new element on front.

func addBack(using self, value: self.T)->*ListNode'(Core.ListNode.T) func addBack(using self, value: &&self.T)->*Core.ListNode'(ListNode.T)

func List.addFront [src]

Add a new element on front.

func addFront(using self, value: self.T)->*ListNode'(Core.ListNode.T) func addFront(using self, value: &&self.T)->*Core.ListNode'(ListNode.T)

func List.clear [src]

Clear all elements.

func clear(using self)

func List.insertAfter [src]

Insert a node before the reference.

func insertAfter(using self, node: *ListNode, value: self.T)->*ListNode'(Core.ListNode.T) func insertAfter(using self, node: *ListNode, value: &&self.T)->*Core.ListNode'(ListNode.T)

func List.insertBefore [src]

Insert a node before the reference.

func insertBefore(using self, node: *ListNode, value: self.T)->*ListNode'(Core.ListNode.T) func insertBefore(using self, node: *ListNode, value: &&self.T)->*Core.ListNode'(ListNode.T)

func List.opDrop [src]

func opDrop(using self)

func List.opVisit [src]

Visit every elements of the list.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using self, stmt: code)
  • #alias0 is the value
  • #alias1 is the node
  • #alias2 is the index

Visiting by pointer and in reverse order is supported

struct Core.ListNode [src]

struct ListNode(T)
prev *ListNode'(Core.ListNode.T)
next *ListNode'(Core.ListNode.T)
value ListNode.T

struct Core.Log [src]

lock Sync.Mutex
buf StrConv.StringBuilder
dt Time.DateTime
writers Array'(Core.ILogWriter)
prefix string
flags LogFlags

Functions

addWriter Register a new writer interface.
clearWriters Remove all writers.
create Create a new log.
getFlags Get the logger prefix.
getPrefix Get the logger prefix.
print Main print function.
setFlags Set the logger flags.
setPrefix Set the logger prefix.

func Log.addWriter [src]

Register a new writer interface.

func addWriter(using self, writer: ILogWriter)

func Log.clearWriters [src]

Remove all writers.

func clearWriters(using self)

func Log.create [src]

Create a new log.

func create()->Log

func Log.getFlags [src]

Get the logger prefix.

func getFlags(using self)->LogFlags

func Log.getPrefix [src]

Get the logger prefix.

func getPrefix(using self)->string

func Log.print [src]

Main print function.

func print(using self, text: string, loc = #callerlocation)

func Log.setFlags [src]

Set the logger flags.

func setFlags(using self, flags: LogFlags)

func Log.setPrefix [src]

Set the logger prefix.

func setPrefix(using self, prefix: string)

enum Core.LogFlags [src]

Zero
Prefix
Date
Time
ShortFileName Exclusive with LongFileName.
LongFileName
Line Exclusive with FullLoc.
FullLoc
Default

namespace Core.Math

Structs

Angle
Const
Int128
Matrix3x3
Matrix4x4
NumericArray
Point A simple Point with 2 coordinates X and Y.
Rectangle A simple rectangle with 4 coordinates.
Transform2
Variant
Vector2
Vector3
Vector4

Functions

abs(f32)
abs(f64)
abs(s16)
abs(s32)
abs(s64)
abs(s8)
acos(f32)
acos(f64)
asin(f32)
asin(f64)
atan(f32)
atan(f64)
atan2(f32, f32)
atan2(f64, f64)
bigEndianToNative Convert a big endian integer to current arch native format.
byteswap(u16) Swap bytes.
byteswap(u32)
byteswap(u64)
ceil(f32)
ceil(f64)
clamp
cos(f32)
cos(f64)
cosh(f32)
cosh(f64)
countOnes(u16)
countOnes(u32)
countOnes(u64)
countOnes(u8) Returns the number of bits set to 1.
cubicLerp(f32, f32, f32, f32, f32)
cubicLerp(f64, f64, f64, f64, f64)
exp(f32)
exp(f64)
exp2(f32)
exp2(f64)
floor(f32)
floor(f64)
gcd Find the gcd between a and b.
hasByte(u16, u8) Determin if an integer has a given byte.
hasByte(u32, u8)
hasByte(u64, u8)
hasZeroByte(u16) Determin if any of the bytes is zero.
hasZeroByte(u32)
hasZeroByte(u64)
interpHermite(f32)
interpHermite(f64)
interpQuintic(f32)
interpQuintic(f64)
isEqualEpsilon(f32, f32, f32)
isEqualEpsilon(f64, f64, f64)
isNan(f32)
isNan(f64)
isPowerOf2(u16)
isPowerOf2(u32)
isPowerOf2(u64)
isPowerOf2(u8)
isZeroEpsilon(f32, f32)
isZeroEpsilon(f64, f64)
lcm Find the Least Common Multiple between a and b.
leadingZeros(u16)
leadingZeros(u32)
leadingZeros(u64)
leadingZeros(u8) Returns the number of bits set to 0 from the left.
lerp(f32, f32, f32)
lerp(f64, f64, f64)
littleEndianToNative Convert a little endian integer to current arch native format.
log(f32)
log(f64)
log10(f32)
log10(f64)
log2(f32)
log2(f64)
make64 Make a 64 bits with two 32 bits.
makeRepeat16 Make a 16 bits by repeating a given byte 0x20 => 0x2020.
makeRepeat32 Make a 32 bits by repeating a given byte 0x20 => 0x20202020.
makeRepeat64 Make a 64 bits by repeating a given byte 0x20 => 0x20202020_20202020.
map(f32, f32, f32, f32, f32)
map(f64, f64, f64, f64, f64)
max(T, T)
max(T, T, T)
max(T, T, T, T)
max(s16, s16)
max(s32, s32)
max(s64, s64)
max(s8, s8)
max(u16, u16)
max(u32, u32)
max(u64, u64)
max(u8, u8)
min(T, T)
min(T, T, T)
min(T, T, T, T)
min(s16, s16)
min(s32, s32)
min(s64, s64)
min(s8, s8)
min(u16, u16)
min(u32, u32)
min(u64, u64)
min(u8, u8)
mulAdd(f32, f32, f32)
mulAdd(f64, f64, f64)
mulU64
nativeToBigEndian Convert a native arch integer to a big endian.
pow(f32, f32)
pow(f64, f64)
reverse(u16)
reverse(u32)
reverse(u64)
reverse(u8) Reverse all bits.
rol(u16, u16)
rol(u32, u32)
rol(u64, u64)
rol(u8, u8) Rotate bits left.
ror(u16, u16)
ror(u32, u32)
ror(u64, u64)
ror(u8, u8) Rotate bits right.
round(f32)
round(f64)
roundDownToPowerOf2(u32)
roundDownToPowerOf2(u64)
roundUpToPowerOf2(u32)
roundUpToPowerOf2(u64)
saturate(f32)
saturate(f64)
sign(f32)
sign(f64)
sign(s16)
sign(s32)
sign(s64)
sign(s8)
sin(f32)
sin(f64)
sinh(f32)
sinh(f64)
smoothstep(f32, f32, f32)
smoothstep(f64, f64, f64)
sqrt(f32)
sqrt(f64)
tan(f32)
tan(f64)
tanh(f32)
tanh(f64)
toDegrees(f32)
toDegrees(f64)
toRadians(f32)
toRadians(f64)
trailingZeros(u16)
trailingZeros(u32)
trailingZeros(u64)
trailingZeros(u8) Returns the number of bits set to 0 from the right.
trunc(f32)
trunc(f64)

struct Math.Angle [src]

rad f32

Functions

toDegrees

Special Functions

opAffect
opAffectLiteral

func Angle.opAffect [src]

func opAffect(using self, valueRad: f32)

func Angle.opAffectLiteral [src]

func(suffix: string) opAffectLiteral(using self, value: f32)

func Angle.toDegrees [src]

func toDegrees(using const self)->f32

struct Math.Const [src]

struct Const(T)
Pi Math.Const.T
E Math.Const.T
TwoPi Math.Const.T
PiBy2 Math.Const.T
PiBy3 Math.Const.T
PiBy4 Math.Const.T
PiBy6 Math.Const.T
PiBy8 Math.Const.T
ThreePiBy4 Math.Const.T
OneByPi Math.Const.T
TwoByPi Math.Const.T
Sqrt2 Math.Const.T
OneBySqrt2 Math.Const.T
Ln2 Math.Const.T
Ln10 Math.Const.T
Log2E Math.Const.T
Log10E Math.Const.T
Epsilon Math.Const.T

struct Math.Int128 [src]

lo u64
hi s64

Functions

mul

Special Functions

opCast
opCmp

func Int128.mul [src]

func mul(x, y: s64)->Math.Int128

func Int128.opCast [src]

func opCast(using const self)->f64

func Int128.opCmp [src]

func opCmp(using const self, other: Int128)->s32

struct Math.Matrix3x3 [src]

m [3,3] f32

Functions

setIdentity

func Matrix3x3.setIdentity [src]

func setIdentity(using self)

struct Math.Matrix4x4 [src]

m [4,4] f32

Functions

setIdentity

func Matrix4x4.setIdentity [src]

func setIdentity(using self)

struct Math.NumericArray [src]

struct NumericArray(T, N: u32)
buf [?] Math.NumericArray.T

Functions

from
mulAdd(self, NumericArray'(T, N), NumericArray'(T, N)) Multiply & Add.
mulAdd(self, T, T) Multiply & add.
set Set all values.

Special Functions

opAffect(self, T)
opAffect(self, const [..] T)
opAssign(self, NumericArray'(T, N))
opAssign(self, T)
opBinary
opEquals
opIndex

func NumericArray.from [src]

func from(values: T...)->Math.NumericArray'(Core.Math.NumericArray.T, N)

func NumericArray.mulAdd [src]

Multiply & add.

func mulAdd(using self, value1, value2: self.T)

Multiply & Add.

func mulAdd(using self, value1, value2: Self)

func NumericArray.opAffect [src]

func opAffect(using self, what: self.T) func opAffect(using self, what: const [..] self.T)

func NumericArray.opAssign [src]

func(op: string) opAssign(using self, value: self.T) func(op: string) opAssign(using self, value: Self)

func NumericArray.opBinary [src]

func(op: string) opBinary(using const self, other: Self)->Math.NumericArray'(Core.Math.NumericArray.T, N)

func NumericArray.opEquals [src]

func opEquals(using const self, other: Self)->bool

func NumericArray.opIndex [src]

func opIndex(using const self, idx: u64)->Math.NumericArray.T

func NumericArray.set [src]

Set all values.

func set(using self, values: self.T...)

struct Math.Point [src]

A simple Point with 2 coordinates X and Y.

x f32
y f32

Functions

ceil Perform a Math.ceil operation on all the coordinates.
clear Set Point to (0, 0).
isEqualEpsilon Check if two points are equal with an epsilon.
isZero Returns true if the Point is null.
isZeroEpsilon Check for zero with an epsilon.
offset(self, f32) Offset this Point by a given value.
offset(self, f32, f32) Offset this Point by a given value.
round Perform a Math.round operation on all the coordinates.
trunc Perform a Math.trunc operation on all the coordinates.

Special Functions

opAffect
opAssign(self, const &Point)
opAssign(self, f32)
opBinary(self, const &Point)
opBinary(self, f32)
opUnary

func Point.ceil [src]

Perform a Math.ceil operation on all the coordinates.

func ceil(using self)

func Point.clear [src]

Set Point to (0, 0).

func clear(using self)

func Point.isEqualEpsilon [src]

Check if two points are equal with an epsilon.

func isEqualEpsilon(using const self, other: Point, eps = ConstF32.Epsilon)->bool

func Point.isZero [src]

Returns true if the Point is null.

func isZero(using const self)->bool

func Point.isZeroEpsilon [src]

Check for zero with an epsilon.

func isZeroEpsilon(using const self, eps = ConstF32.Epsilon)->bool

func Point.offset [src]

Offset this Point by a given value.

func offset(using self, value: f32) func offset(self, x, y: f32)

func Point.opAffect [src]

func opAffect(using self, value: f32)

func Point.opAssign [src]

func(op: string) opAssign(using self, other: Point) func(op: string) opAssign(using self, value: f32)

func Point.opBinary [src]

func(op: string) opBinary(using const self, other: Point)->Math.Point func(op: string) opBinary(using const self, value: f32)->Math.Point

func Point.opUnary [src]

func(op: string) opUnary(using const self)->Math.Point

func Point.round [src]

Perform a Math.round operation on all the coordinates.

func round(using self)

func Point.trunc [src]

Perform a Math.trunc operation on all the coordinates.

func trunc(using self)

struct Math.Rectangle [src]

A simple rectangle with 4 coordinates.

x f32 Left position.
y f32 Top position.
width f32 Rectangle width.
height f32 Rectangle height.

Functions

applyPadding Add a padding (offset to each side).
bottom Bottom coordinate (y + height).
ceil Perform a Math.ceil operation on all the coordinates.
center Central point.
clear Set rectangle to (0, 0, 0, 0).
constrainIn Constrain the rectangle to be inside another one, without changing its size (so the other rectangle must be bigger).
contains(self, const &Point) Determines if the specfied point is contained within the rectangular region.
contains(self, const &Rectangle) Determines if the specfied rectangle is contained within the rectangular region.
contains(self, f32, f32) Determines if the specfied point is contained within the rectangular region.
getUnion Creates a rectangle that represents the union between a and b.
horzCenter Horizontal center coordinate (x + width / 2).
inflate(self, f32) Inflates the rectangle by the given value.
inflate(self, f32, f32) Inflates the rectangle by the given amount in x and y directions.
intersect(self, const &Rectangle) Intersect this rectangle with another one.
intersect(const &Rectangle, const &Rectangle) Creates a rectangle that represents the intersetion between a and b.
intersectWith Determines if this rectangle intersets with rect.
isEmpty Returns true if this instance has a surface of zero (width or height are null).
isEmptyEpsilon Returns true if this instance has a surface of zero (width and height are null).
isNormalized Returns true if this instance has a positive or null surface (width and height greater or equal than zero).
isZero Returns true if this instance is null.
isZeroEpsilon Returns true if this instance is null with an epsilon.
moveBottom Move the left coordinate, reducing the width.
moveLeft Move the left coordinate, reducing the width.
moveRight Move the left coordinate, reducing the width.
moveTop Move the left coordinate, reducing the width.
offset(self, const &Point) Offset the rectangle position by a given value.
offset(self, f32) Offset the rectangle position by a given value.
offset(self, f32, f32) Offset the rectangle position by a x and y values.
right Right coordinate (x + width).
round Perform a Math.round operation on all the coordinates.
scale(self, f32) Multiply the width and height of the rectangle by a given value.
scale(self, f32, f32) Multiply the width by x and the height by y.
set Initialize the rectangle with two position.
setBottom Bottom coordinate (y + height).
setRight Right coordinate (x + width).
setUnion Creates a rectangle that represents the union.
trunc Perform a Math.trunc operation on all the coordinates.
vertCenter Vertical center coordinate (y + height / 2).

Special Functions

opEquals

func Rectangle.applyPadding [src]

Add a padding (offset to each side).

func applyPadding(using self, padding: Math.Vector4)

func Rectangle.bottom [src]

Bottom coordinate (y + height).

func bottom(using const self)->f32

func Rectangle.ceil [src]

Perform a Math.ceil operation on all the coordinates.

func ceil(using self)

func Rectangle.center [src]

Central point.

func center(using const self)->Math.Point

func Rectangle.clear [src]

Set rectangle to (0, 0, 0, 0).

func clear(using self)

func Rectangle.constrainIn [src]

Constrain the rectangle to be inside another one, without changing its size (so the other rectangle must be bigger).

func constrainIn(using self, other: Rectangle)

func Rectangle.contains [src]

Determines if the specfied point is contained within the rectangular region.

func contains(const self, x, y: f32)->bool func contains(using const self, pt: Point)->bool

Determines if the specfied rectangle is contained within the rectangular region.

func contains(using const self, rect: Rectangle)->bool

func Rectangle.getUnion [src]

Creates a rectangle that represents the union between a and b.

func getUnion(a, b: Rectangle)->Math.Rectangle

func Rectangle.horzCenter [src]

Horizontal center coordinate (x + width / 2).

func horzCenter(using const self)->f32

func Rectangle.inflate [src]

Inflates the rectangle by the given value.

func inflate(using self, value: f32)

Inflates the rectangle by the given amount in x and y directions.

func inflate(self, x, y: f32)

func Rectangle.intersect [src]

Intersect this rectangle with another one.

func intersect(using self, other: Rectangle)

Creates a rectangle that represents the intersetion between a and b.

func intersect(a, b: Rectangle)->Math.Rectangle

If there is no intersection, Zero is returned.

func Rectangle.intersectWith [src]

Determines if this rectangle intersets with rect.

func intersectWith(using const self, rect: Rectangle)->bool

func Rectangle.isEmpty [src]

Returns true if this instance has a surface of zero (width or height are null).

func isEmpty(using const self)->bool

func Rectangle.isEmptyEpsilon [src]

Returns true if this instance has a surface of zero (width and height are null).

func isEmptyEpsilon(using const self, eps = ConstF32.Epsilon)->bool

func Rectangle.isNormalized [src]

Returns true if this instance has a positive or null surface (width and height greater or equal than zero).

func isNormalized(using self)->bool

func Rectangle.isZero [src]

Returns true if this instance is null.

func isZero(using const self)->bool

func Rectangle.isZeroEpsilon [src]

Returns true if this instance is null with an epsilon.

func isZeroEpsilon(using const self, eps = ConstF32.Epsilon)->bool

func Rectangle.moveBottom [src]

Move the left coordinate, reducing the width.

func moveBottom(using self, value: f32)

func Rectangle.moveLeft [src]

Move the left coordinate, reducing the width.

func moveLeft(using self, value: f32)

func Rectangle.moveRight [src]

Move the left coordinate, reducing the width.

func moveRight(using self, value: f32)

func Rectangle.moveTop [src]

Move the left coordinate, reducing the width.

func moveTop(using self, value: f32)

func Rectangle.offset [src]

Offset the rectangle position by a given value.

func offset(using self, offsetXY: f32)

Offset the rectangle position by a x and y values.

func offset(using self, offsetX, offsetY: f32)

Offset the rectangle position by a given value.

func offset(using self, offset: Math.Point)

func Rectangle.opEquals [src]

func opEquals(using const self, other: Rectangle)->bool

func Rectangle.right [src]

Right coordinate (x + width).

func right(using const self)->f32

func Rectangle.round [src]

Perform a Math.round operation on all the coordinates.

func round(using self)

func Rectangle.scale [src]

Multiply the width and height of the rectangle by a given value.

func scale(using self, value: f32)

Multiply the width by x and the height by y.

func scale(self, x, y: f32)

func Rectangle.set [src]

Initialize the rectangle with two position.

func set(using self, topLeft, bottomRight: Math.Point)

func Rectangle.setBottom [src]

Bottom coordinate (y + height).

func setBottom(using self, value: f32)

func Rectangle.setRight [src]

Right coordinate (x + width).

func setRight(using self, value: f32)

func Rectangle.setUnion [src]

Creates a rectangle that represents the union.

func setUnion(using self, other: Rectangle)

func Rectangle.trunc [src]

Perform a Math.trunc operation on all the coordinates.

func trunc(using self)

func Rectangle.vertCenter [src]

Vertical center coordinate (y + height / 2).

func vertCenter(using const self)->f32

struct Math.Transform2 [src]

m11 f32
m12 f32
m21 f32
m22 f32
m31 f32
m32 f32
m [2,2] f32
tx f32
ty f32

Functions

createRotation Creates a rotation matix, with a given center of rotation.
createScale Creates a scale matix, with a given center.
createTranslation Creates a translation matix.
multiply Multiply two matricies.
setIdentity Set transform to identity.

func Transform2.createRotation [src]

Creates a rotation matix, with a given center of rotation.

func createRotation(angle: f32, centerX, centerY: f32)->Math.Transform2

func Transform2.createScale [src]

Creates a scale matix, with a given center.

func createScale(scaleX, scaleY: f32, centerX, centerY: f32)->Math.Transform2

func Transform2.createTranslation [src]

Creates a translation matix.

func createTranslation(x, y: f32)->Math.Transform2

func Transform2.multiply [src]

Multiply two matricies.

func multiply(using self, matrix2: Transform2)

func Transform2.setIdentity [src]

Set transform to identity.

func setIdentity(using self)

struct Math.Variant [src]

struct Variant(T: const [..] typeinfo)
type const *Swag.TypeInfo
buffer [?] u8
AllFlags s32

Functions

checkValidType
drop Drop the variant content (if necessary).
get Get the variant value of the given type Will assert if the current type does not match.
set Set the variant value.

Special Functions

opAffect
opCmp
opDrop
opEquals
opPostCopy
opPostMove

func Variant.checkValidType [src]

func checkValidType(t: const [..] typeinfo, tn: typeinfo)->bool

func Variant.drop [src]

Drop the variant content (if necessary).

func drop(using self)

func Variant.get [src]

Get the variant value of the given type Will assert if the current type does not match.

func(TN) get(using self)->TN

func Variant.opAffect [src]

func(TN) opAffect(using self, other: TN)

func Variant.opCmp [src]

func(TN) opCmp(using self, other: TN)->s32

func Variant.opDrop [src]

func opDrop(using self)

func Variant.opEquals [src]

func(TN) opEquals(using self, other: TN)->bool

func Variant.opPostCopy [src]

func opPostCopy(using self)

func Variant.opPostMove [src]

func opPostMove(using self)

func Variant.set [src]

Set the variant value.

func(TN) set(using self, value: TN)

struct Math.Vector2 [src]

x f32
y f32

Functions

angle Returns the angle with another vector.
angle0To2Pi Returns the angle with another vector in the range [0, 2Pi].
ceil Math.ceil.
clear Set the vector to zero.
cosAngle Returns the cosine angle with another vector.
cross(self, const &Vector2) Returns the Z signed length of the perpendicular vector.
cross(self, f32) Returns the perpendicular vector in the 2D plane.
distance Returns the distance between two vectors.
distanceSquared Returns the square distance between two vectors.
distanceToLine Returns the distance of the point to the given line.
distanceToSegment Returns the distance of the point to the given segment.
dot Returns the dot product between two vectors.
floor Math.floor.
isEqualEpsilon Returns true if this vector is equals to another with an epsilon.
isInEllipse Returns true if the point pt is inside an ellipse.
isInTriangle Returns true if the point pt is inside the triangle defined with 'a, b, c'.
isZero Returns true if this vector is null.
isZeroEpsilon Returns true if this vector is null with an epsilon.
length Return sthe length of the vector.
lengthSquared Returns the squared length of the vector.
lerp Lerp one vector with another.
lineLineIntersect Compute the intersection point of two lines.
max Returns a vector which is the min of two vectors.
min Returns a vector which is the min of two vectors.
nearestPointsSegSeg Returns the minimal segment between two segments (and the minimal distance).
negate Negate the vector.
normalize Normalize this vector (set its length to 1).
normalizeSafe Normalize this vector (set its length to 1) even if its length is almost null.
polyContains Returns true if the given point is inside the polygon PNPoly by W. Randolph Franklin.
rotate Rotate the vector by a given angle.
round Math.round.
segSegIntersect Compute the intersection point of two segments.
set Set content.
setLength Set the vector length.
setLengthSafe Set the vector length.
toNormalize Returns this vector normalized.
toNormalizeSafe Returns this vector normalized even if its length is almost null.

Special Functions

opAffect
opAssign(self, const &Vector2)
opAssign(self, f32)
opBinary(self, const &Vector2)
opBinary(self, f32)
opUnary

func Vector2.angle [src]

Returns the angle with another vector.

func angle(using const self, other: Self)->f32

func Vector2.angle0To2Pi [src]

Returns the angle with another vector in the range [0, 2Pi].

func angle0To2Pi(using const self, other: Self)->f32

func Vector2.ceil [src]

Math.ceil.

func ceil(using self)

func Vector2.clear [src]

Set the vector to zero.

func clear(using self)

func Vector2.cosAngle [src]

Returns the cosine angle with another vector.

func cosAngle(using const self, other: Self)->f32

func Vector2.cross [src]

Returns the perpendicular vector in the 2D plane.

func cross(using const self, axis: f32)->Math.Vector2

axis will give the sign of the result

Returns the Z signed length of the perpendicular vector.

func cross(using const self, other: Self)->f32

func Vector2.distance [src]

Returns the distance between two vectors.

func distance(using const self, dest: Self)->f32

func Vector2.distanceSquared [src]

Returns the square distance between two vectors.

func distanceSquared(using const self, dest: Self)->f32

func Vector2.distanceToLine [src]

Returns the distance of the point to the given line.

func distanceToLine(using const self, a, b: Vector2)->f32

func Vector2.distanceToSegment [src]

Returns the distance of the point to the given segment.

func distanceToSegment(using const self, a, b: Vector2)->f32

func Vector2.dot [src]

Returns the dot product between two vectors.

func dot(using const self, other: Self)->f32

func Vector2.floor [src]

Math.floor.

func floor(using self)

func Vector2.isEqualEpsilon [src]

Returns true if this vector is equals to another with an epsilon.

func isEqualEpsilon(using const self, other: Self, eps = cast(f32) ConstF64.Epsilon)->bool

func Vector2.isInEllipse [src]

Returns true if the point pt is inside an ellipse.

func isInEllipse(using const self, center: Vector2, radiusX, radiusY: f32)->bool

func Vector2.isInTriangle [src]

Returns true if the point pt is inside the triangle defined with 'a, b, c'.

func isInTriangle(using const self, a, b, c: Vector2)->bool

func Vector2.isZero [src]

Returns true if this vector is null.

func isZero(using const self)->bool

func Vector2.isZeroEpsilon [src]

Returns true if this vector is null with an epsilon.

func isZeroEpsilon(using const self, eps = cast(f32) ConstF64.Epsilon)->bool

func Vector2.length [src]

Return sthe length of the vector.

func length(using const self)->f32

func Vector2.lengthSquared [src]

Returns the squared length of the vector.

func lengthSquared(using const self)->f32

func Vector2.lerp [src]

Lerp one vector with another.

func lerp(src, dst: Vector2, factor: f32)->Math.Vector2

func Vector2.lineLineIntersect [src]

Compute the intersection point of two lines.

func lineLineIntersect(start0, end0, start1, end1: Vector2, epsilon: f32 = ConstF32.Epsilon)->{yes:bool,pos:Math.Vector2}

func Vector2.max [src]

Returns a vector which is the min of two vectors.

func max(a, b: Self)->Math.Vector2

func Vector2.min [src]

Returns a vector which is the min of two vectors.

func min(a, b: Self)->Math.Vector2

func Vector2.nearestPointsSegSeg [src]

Returns the minimal segment between two segments (and the minimal distance).

func nearestPointsSegSeg(p0, p1, q0, q1: Math.Vector2)->{a:Math.Vector2,b:Math.Vector2,dist:f32}

David Eberly, Geometric Tools, Redmond WA 98052 Copyright (c) 1998-2022 Distributed under the Boost Software License, Version 1.0. https://www.boost.org/LICENSE_1_0.txt https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt https://www.geometrictools.com/GTE/Mathematics/DistSegmentSegment.h

func Vector2.negate [src]

Negate the vector.

func negate(using self)

func Vector2.normalize [src]

Normalize this vector (set its length to 1).

func normalize(using self)

func Vector2.normalizeSafe [src]

Normalize this vector (set its length to 1) even if its length is almost null.

func normalizeSafe(using self)

func Vector2.opAffect [src]

func opAffect(using self, value: f32)

func Vector2.opAssign [src]

func(op: string) opAssign(using self, other: Self) func(op: string) opAssign(using self, value: f32)

func Vector2.opBinary [src]

func(op: string) opBinary(using const self, other: Self)->Math.Vector2 func(op: string) opBinary(using const self, value: f32)->Math.Vector2

func Vector2.opUnary [src]

func(op: string) opUnary(using const self)->Math.Vector2

func Vector2.polyContains [src]

Returns true if the given point is inside the polygon PNPoly by W. Randolph Franklin.

func polyContains(poly: Array'Math.Vector2, pt: Math.Vector2)->bool

func Vector2.rotate [src]

Rotate the vector by a given angle.

func rotate(using self, angle: Math.Angle)

func Vector2.round [src]

Math.round.

func round(using self)

func Vector2.segSegIntersect [src]

Compute the intersection point of two segments.

func segSegIntersect(start0, end0, start1, end1: Vector2, epsilon: f32 = ConstF32.Epsilon)->{yes:bool,pos:Math.Vector2}

func Vector2.set [src]

Set content.

func set(using self, x, y: f32)

func Vector2.setLength [src]

Set the vector length.

func setLength(using self, newLength: f32)

func Vector2.setLengthSafe [src]

Set the vector length.

func setLengthSafe(using self, newLength: f32)

func Vector2.toNormalize [src]

Returns this vector normalized.

func toNormalize(using const self)->Math.Vector2

func Vector2.toNormalizeSafe [src]

Returns this vector normalized even if its length is almost null.

func toNormalizeSafe(using const self)->Math.Vector2

struct Math.Vector3 [src]

x f32
y f32
z f32

Functions

clear Set the vector to zero.
distance Returns the distance between two vectors.
distanceSquared Returns the square distance between two vectors.
dot Returns the dot product between two vectors.
isEqualEpsilon Returns true if this vector is equals to another with an epsilon.
isZero Returns true if this vector is null.
isZeroEpsilon Returns true if this vector is null with an epsilon.
length Return sthe length of the vector.
lengthSquared Returns the squared length of the vector.
lerp Lerp one vector with another.
max Returns a vector which is the min of two vectors.
min Returns a vector which is the min of two vectors.
negate Negate the vector.
normalize Normalize this vector (set its length to 1).
normalizeSafe Normalize this vector (set its length to 1) even if its length is almost null.
set Set content.
setLength Set the vector length.
setLengthSafe Set the vector length.
toNormalize Returns this vector normalized.
toNormalizeSafe Returns this vector normalized even if its length is almost null.

Special Functions

opAffect
opAssign(self, const &Vector3)
opAssign(self, f32)
opBinary(self, const &Vector3)
opBinary(self, f32)
opUnary

func Vector3.clear [src]

Set the vector to zero.

func clear(using self)

func Vector3.distance [src]

Returns the distance between two vectors.

func distance(using const self, dest: Self)->f32

func Vector3.distanceSquared [src]

Returns the square distance between two vectors.

func distanceSquared(using const self, dest: Self)->f32

func Vector3.dot [src]

Returns the dot product between two vectors.

func dot(using const self, other: Self)->f32

func Vector3.isEqualEpsilon [src]

Returns true if this vector is equals to another with an epsilon.

func isEqualEpsilon(using const self, other: Self, eps = cast(f32) ConstF64.Epsilon)->bool

func Vector3.isZero [src]

Returns true if this vector is null.

func isZero(using const self)->bool

func Vector3.isZeroEpsilon [src]

Returns true if this vector is null with an epsilon.

func isZeroEpsilon(using const self, eps = cast(f32) ConstF64.Epsilon)->bool

func Vector3.length [src]

Return sthe length of the vector.

func length(using const self)->f32

func Vector3.lengthSquared [src]

Returns the squared length of the vector.

func lengthSquared(using const self)->f32

func Vector3.lerp [src]

Lerp one vector with another.

func lerp(src, dst: Vector3, factor: f32)->Math.Vector3

func Vector3.max [src]

Returns a vector which is the min of two vectors.

func max(a, b: Self)->Math.Vector3

func Vector3.min [src]

Returns a vector which is the min of two vectors.

func min(a, b: Self)->Math.Vector3

func Vector3.negate [src]

Negate the vector.

func negate(using self)

func Vector3.normalize [src]

Normalize this vector (set its length to 1).

func normalize(using self)

func Vector3.normalizeSafe [src]

Normalize this vector (set its length to 1) even if its length is almost null.

func normalizeSafe(using self)

func Vector3.opAffect [src]

func opAffect(using self, value: f32)

func Vector3.opAssign [src]

func(op: string) opAssign(using self, other: Self) func(op: string) opAssign(using self, value: f32)

func Vector3.opBinary [src]

func(op: string) opBinary(using self, other: Self)->Math.Vector3 func(op: string) opBinary(using self, value: f32)->Math.Vector3

func Vector3.opUnary [src]

func(op: string) opUnary(using self)->Math.Vector3

func Vector3.set [src]

Set content.

func set(using self, x, y, z: f32)

func Vector3.setLength [src]

Set the vector length.

func setLength(using self, newLength: f32)

func Vector3.setLengthSafe [src]

Set the vector length.

func setLengthSafe(using self, newLength: f32)

func Vector3.toNormalize [src]

Returns this vector normalized.

func toNormalize(using const self)->Math.Vector3

func Vector3.toNormalizeSafe [src]

Returns this vector normalized even if its length is almost null.

func toNormalizeSafe(using const self)->Math.Vector3

struct Math.Vector4 [src]

x f32
y f32
z f32
w f32

Functions

clear Set the vector to zero.
lerp Lerp one vector with another.

Special Functions

opAffect
opUnary

func Vector4.clear [src]

Set the vector to zero.

func clear(using self)

func Vector4.lerp [src]

Lerp one vector with another.

func lerp(src, dst: Vector4, factor: f32)->Math.Vector4

func Vector4.opAffect [src]

func opAffect(using self, value: f32)

func Vector4.opUnary [src]

func(op: string) opUnary(using self)->Math.Vector4

func Math.abs [src]

func abs(x: s8)->s8 func abs(x: s16)->s16 func abs(x: s32)->s32 func abs(x: s64)->s64 func abs(x: f32)->f32 func abs(x: f64)->f64

func Math.acos [src]

func acos(x: f32)->f32 func acos(x: f64)->f64

func Math.asin [src]

func asin(x: f32)->f32 func asin(x: f64)->f64

func Math.atan [src]

func atan(x: f32)->f32 func atan(x: f64)->f64

func Math.atan2 [src]

func atan2(x, y: f32)->f32 func atan2(x, y: f64)->f64

func Math.bigEndianToNative [src]

Convert a big endian integer to current arch native format.

func(T) bigEndianToNative(x: T)->T

func Math.byteswap [src]

Swap bytes.

func byteswap(x: u16)->u16 func byteswap(x: u32)->u32 func byteswap(x: u64)->u64

func Math.ceil [src]

func ceil(x: f32)->f32 func ceil(x: f64)->f64

func Math.clamp [src]

func(T) clamp(x, low, up: T)->T

func Math.cos [src]

func cos(x: f32)->f32 func cos(x: f64)->f64

func Math.cosh [src]

func cosh(x: f32)->f32 func cosh(x: f64)->f64

func Math.countOnes [src]

Returns the number of bits set to 1.

func countOnes(x: u8)->u8 func countOnes(x: u16)->u16 func countOnes(x: u32)->u32 func countOnes(x: u64)->u64

func Math.cubicLerp [src]

func cubicLerp(a, b, c, d, t: f32)->f32 func cubicLerp(a, b, c, d, t: f64)->f64

func Math.exp [src]

func exp(x: f32)->f32 func exp(x: f64)->f64

func Math.exp2 [src]

func exp2(x: f32)->f32 func exp2(x: f64)->f64

func Math.floor [src]

func floor(x: f32)->f32 func floor(x: f64)->f64

func Math.gcd [src]

Find the gcd between a and b.

func gcd(a0, b0: s64)->s64

func Math.hasByte [src]

Determin if an integer has a given byte.

func hasByte(value: u16, byte: u8)->bool func hasByte(value: u32, byte: u8)->bool func hasByte(value: u64, byte: u8)->bool

func Math.hasZeroByte [src]

Determin if any of the bytes is zero.

func hasZeroByte(v: u16)->bool func hasZeroByte(v: u32)->bool func hasZeroByte(v: u64)->bool

func Math.interpHermite [src]

func interpHermite(t: f32)->f32 func interpHermite(t: f64)->f64

func Math.interpQuintic [src]

func interpQuintic(t: f32)->f32 func interpQuintic(t: f64)->f64

func Math.isEqualEpsilon [src]

func isEqualEpsilon(x, y: f32, eps = ConstF32.Epsilon)->bool func isEqualEpsilon(x, y: f64, eps = ConstF64.Epsilon)->bool

func Math.isNan [src]

func isNan(x: f32)->bool func isNan(x: f64)->bool

func Math.isPowerOf2 [src]

func isPowerOf2(x: u8)->bool func isPowerOf2(x: u16)->bool func isPowerOf2(x: u32)->bool func isPowerOf2(x: u64)->bool

func Math.isZeroEpsilon [src]

func isZeroEpsilon(x: f32, eps = ConstF32.Epsilon)->bool func isZeroEpsilon(x: f64, eps = ConstF64.Epsilon)->bool

func Math.lcm [src]

Find the Least Common Multiple between a and b.

func lcm(a, b: s64)->s64

func Math.leadingZeros [src]

Returns the number of bits set to 0 from the left.

func leadingZeros(x: u8)->u8 func leadingZeros(x: u16)->u16 func leadingZeros(x: u32)->u32 func leadingZeros(x: u64)->u64

func Math.lerp [src]

func lerp(x, y, factor: f32)->f32 func lerp(x, y, factor: f64)->f64

func Math.littleEndianToNative [src]

Convert a little endian integer to current arch native format.

func(T) littleEndianToNative(x: T)->T

func Math.log [src]

func log(x: f32)->f32 func log(x: f64)->f64

func Math.log10 [src]

func log10(x: f32)->f32 func log10(x: f64)->f64

func Math.log2 [src]

func log2(x: f32)->f32 func log2(x: f64)->f64

func Math.make64 [src]

Make a 64 bits with two 32 bits.

func make64(high, low: u32)->u64

func Math.makeRepeat16 [src]

Make a 16 bits by repeating a given byte 0x20 => 0x2020.

func makeRepeat16(v: u8)->u16

func Math.makeRepeat32 [src]

Make a 32 bits by repeating a given byte 0x20 => 0x20202020.

func makeRepeat32(v: u8)->u32

func Math.makeRepeat64 [src]

Make a 64 bits by repeating a given byte 0x20 => 0x20202020_20202020.

func makeRepeat64(v: u8)->u64

func Math.map [src]

func map(val, minSrc, maxSrc, minDst, maxDst: f32)->f32 func map(val, minSrc, maxSrc, minDst, maxDst: f64)->f64

func Math.max [src]

func(T) max(x, y: T)->T func(T) max(x, y, z: T)->T func(T) max(x, y, z, w: T)->T func max(x, y: s8)->s8 func max(x, y: s16)->s16 func max(x, y: s32)->s32 func max(x, y: s64)->s64 func max(x, y: u8)->u8 func max(x, y: u16)->u16 func max(x, y: u32)->u32 func max(x, y: u64)->u64

func Math.min [src]

func(T) min(x, y: T)->T func(T) min(x, y, z: T)->T func(T) min(x, y, z, w: T)->T func min(x, y: s8)->s8 func min(x, y: s16)->s16 func min(x, y: s32)->s32 func min(x, y: s64)->s64 func min(x, y: u8)->u8 func min(x, y: u16)->u16 func min(x, y: u32)->u32 func min(x, y: u64)->u64

func Math.mulAdd [src]

func mulAdd(x, y, z: f32)->f32 func mulAdd(x, y, z: f64)->f64

func Math.mulU64 [src]

func mulU64(x, y: u64)->{hi:u64,lo:u64}

func Math.nativeToBigEndian [src]

Convert a native arch integer to a big endian.

func(T) nativeToBigEndian(x: T)->T

func Math.pow [src]

func pow(x, y: f32)->f32 func pow(x, y: f64)->f64

func Math.reverse [src]

Reverse all bits.

func reverse(x: u8)->u8 func reverse(x: u16)->u16 func reverse(x: u32)->u32 func reverse(x: u64)->u64

func Math.rol [src]

Rotate bits left.

func rol(x, y: u8)->u8 func rol(x, y: u16)->u16 func rol(x, y: u32)->u32 func rol(x, y: u64)->u64

func Math.ror [src]

Rotate bits right.

func ror(x, y: u8)->u8 func ror(x, y: u16)->u16 func ror(x, y: u32)->u32 func ror(x, y: u64)->u64

func Math.round [src]

func round(x: f32)->f32 func round(x: f64)->f64

func Math.roundDownToPowerOf2 [src]

func roundDownToPowerOf2(x: u32)->u32 func roundDownToPowerOf2(x: u64)->u64

func Math.roundUpToPowerOf2 [src]

func roundUpToPowerOf2(x: u32)->u32 func roundUpToPowerOf2(x: u64)->u64

func Math.saturate [src]

func saturate(x: f32)->f32 func saturate(x: f64)->f64

func Math.sign [src]

func sign(x: f32)->s32 func sign(x: f64)->s32 func sign(x: s8)->s8 func sign(x: s16)->s16 func sign(x: s32)->s32 func sign(x: s64)->s64

func Math.sin [src]

func sin(x: f32)->f32 func sin(x: f64)->f64

func Math.sinh [src]

func sinh(x: f32)->f32 func sinh(x: f64)->f64

func Math.smoothstep [src]

func smoothstep(edge0, edge1, x: f32)->f32 func smoothstep(edge0, edge1, x: f64)->f64

func Math.sqrt [src]

func sqrt(x: f32)->f32 func sqrt(x: f64)->f64

func Math.tan [src]

func tan(x: f32)->f32 func tan(x: f64)->f64

func Math.tanh [src]

func tanh(x: f32)->f32 func tanh(x: f64)->f64

func Math.toDegrees [src]

func toDegrees(x: f32)->f32 func toDegrees(x: f64)->f64

func Math.toRadians [src]

func toRadians(x: f32)->f32 func toRadians(x: f64)->f64

func Math.trailingZeros [src]

Returns the number of bits set to 0 from the right.

func trailingZeros(x: u8)->u8 func trailingZeros(x: u16)->u16 func trailingZeros(x: u32)->u32 func trailingZeros(x: u64)->u64

func Math.trunc [src]

func trunc(x: f32)->f32 func trunc(x: f64)->f64

namespace Core.Memory

Functions

align(const ^void, u32) Align a pointer to the given amount.
align(u64, u32) Align a value to the given amount.
alloc Allocate a given amount of bytes.
assertIsAllocated Check if a given pointer is allocated.
clear Clear one block of memory.
compare Compare two blocks of memory.
copy Copy one block of memory to a given address.
copyOver Move one block of memory to a given address.
delete(*T, IAllocator, string, const &SourceCodeLocation) Drop and release memory of the given type.
delete(^T, u64, IAllocator, string, const &SourceCodeLocation) Drop and release memory of an array of the given type.
delete(*void, const *TypeInfo, IAllocator, string, const &SourceCodeLocation) Drop and release memory of the given type.
equals Compare two blocks of memory.
free Free the specified memory block.
freeAll Free all allocated memory of the given allocator if possible.
freeTemp Clear the temporary allocator.
new(IAllocator, u32, string, const &SourceCodeLocation) Allocate and initialize the given type.
new(u64, IAllocator, u32, string, const &SourceCodeLocation) Allocate and initialize an array of the given type.
new(const *TypeInfo, IAllocator, u32, string, const &SourceCodeLocation) Allocate and initialize the given type.
pushAllocator Push a new allocator for the given block of code.
pushTempAllocator Push the temporary allocator for the given block of code.
realloc Reallocate/allocate a given amount of bytes.
set Set the content of one block of memory to a specific byte value.
tempAlloc Allocate a given amount of bytes in the temporary allocator.

func Memory.align [src]

Align a value to the given amount.

func align(value: u64, alignment: u32)->u64

Align a pointer to the given amount.

func align(value: const ^void, alignment: u32)->const ^void

func Memory.alloc [src]

Allocate a given amount of bytes.

func alloc(size: u64, allocator: IAllocator = null, alignment: u32 = 0, hint: string = null, loc = #callerlocation)->^void

func Memory.assertIsAllocated [src]

Check if a given pointer is allocated.

func assertIsAllocated(buffer: ^void, size: u64, allocator: IAllocator = null, hint: string = null, loc = #callerlocation)

func Memory.clear [src]

Clear one block of memory.

func clear(dest: ^void, size: u64)

func Memory.compare [src]

Compare two blocks of memory.

func compare(dest, src: const ^void, size: u64)->s32

func Memory.copy [src]

Copy one block of memory to a given address.

func copy(dest: ^void, src: const ^void, size: u64)

func Memory.copyOver [src]

Move one block of memory to a given address.

func copyOver(dest: ^void, src: const ^void, size: u64)

func Memory.delete [src]

Drop and release memory of the given type.

func(T) delete(ptr: *T, allocator: IAllocator = null, hint: string = null, loc = #callerlocation) func delete(ptr: *void, type: typeinfo, allocator: IAllocator = null, hint: string = null, loc = #callerlocation)

Drop and release memory of an array of the given type.

func(T) delete(ptr: ^T, num: u64, allocator: IAllocator = null, hint: string = null, loc = #callerlocation)

func Memory.equals [src]

Compare two blocks of memory.

func(T) equals(dest, src: const *T)->bool

func Memory.free [src]

Free the specified memory block.

func free(buffer: ^void, size: u64, allocator: IAllocator = null, hint: string = null, loc = #callerlocation)

func Memory.freeAll [src]

Free all allocated memory of the given allocator if possible.

func freeAll(allocator: IAllocator, hint: string = null, loc = #callerlocation)

func Memory.freeTemp [src]

Clear the temporary allocator.

func freeTemp()

func Memory.new [src]

Allocate and initialize the given type.

func new(type: typeinfo, allocator: IAllocator = null, alignment: u32 = 0, hint: string = null, loc = #callerlocation)->*u8 func(T) new(allocator: IAllocator = null, alignment: u32 = 0, hint: string = null, loc = #callerlocation)->*T

Allocate and initialize an array of the given type.

func(T) new(num: u64, allocator: IAllocator = null, alignment: u32 = 0, hint: string = null, loc = #callerlocation)->^T

func Memory.pushAllocator [src]

Push a new allocator for the given block of code.

#[Swag.Macro] func pushAllocator(allocator: Swag.IAllocator, stmt: code)

func Memory.pushTempAllocator [src]

Push the temporary allocator for the given block of code.

#[Swag.Macro] func pushTempAllocator(stmt: code)

func Memory.realloc [src]

Reallocate/allocate a given amount of bytes.

func realloc(buffer: ^void, newSize: u64, oldSize: u64, allocator: IAllocator = null, alignment: u16 = 0, hint: string = null, loc = #callerlocation)->^void

func Memory.set [src]

Set the content of one block of memory to a specific byte value.

func set(dest: ^void, value: u8, size: u64)

func Memory.tempAlloc [src]

Allocate a given amount of bytes in the temporary allocator.

func tempAlloc(size: u64, alignment: u32 = 0, hint: string = null, loc = #callerlocation)->^void

namespace Core.Noise

Structs

FastNoise

Enums

FastNoiseKind

Functions

perlin(f32, f32, f32, s32)
perlin(f32, f32, s32) Perlin noise.

struct Noise.FastNoise [src]

kind Noise.FastNoiseKind
seed s32
octaves s32 The number of layers of noise. More octaves create a more varied look but are also more resource-intensive to calculate.
frequency f32 The period in which we sample the noise. A higher frequency results in more frequent noise change.
lacunarity f32 The rate of change of the frequency for each successive octave. A lacunarity value of 1 results in each octave having the same frequency.
gain f32 The scaling factor applied to each octave. gain is only used when octaves is set to a value higher than 1.
fractalBounding f32

Functions

noise Get a noise result.
perlinFractalBillow
perlinFractalFBM
perlinFractalRigidMulti
update Update internal values.
valueFractalBillow
valueFractalFBM
valueFractalRigidMulti

func FastNoise.noise [src]

Get a noise result.

func noise(using const self, x, y: f32)->f32

func FastNoise.perlinFractalBillow [src]

func perlinFractalBillow(using const self, x, y: f32)->f32

func FastNoise.perlinFractalFBM [src]

func perlinFractalFBM(using const self, x, y: f32)->f32

func FastNoise.perlinFractalRigidMulti [src]

func perlinFractalRigidMulti(using const self, x, y: f32)->f32

func FastNoise.update [src]

Update internal values.

func update(using self)

Should be called each time an internal parameter has been changed.

func FastNoise.valueFractalBillow [src]

func valueFractalBillow(using const self, x, y: f32)->f32

func FastNoise.valueFractalFBM [src]

func valueFractalFBM(using const self, x, y: f32)->f32

func FastNoise.valueFractalRigidMulti [src]

func valueFractalRigidMulti(using const self, x, y: f32)->f32

enum Noise.FastNoiseKind [src]

Perlin
PerlinFractalFBM
PerlinFractalBillow
PerlinFractalRigidMulti
Value
ValueFractalFBM
ValueFractalBillow
ValueFractalRigidMulti

func Noise.perlin [src]

Perlin noise.

func perlin(x, y: f32, seed: s32 = 1337)->f32

Result range is [-1, 1]

func perlin(x, y, z: f32, seed: s32 = 1337)->f32

namespace Core.Parser

Structs

RegExp Simple regular expression matcher.

struct Parser.RegExp [src]

Simple regular expression matcher.

* zero or more
? zero or one
+ one or more
. any rune
^<expr> start of buffer
<expr>$ end of buffer
a
b
[abc] match any in list
[a-zA-Z] match any in range
[[:digit:]] [0-9]
[[:xdigit:]] [a-fA-F0-9]
[[:alpha:]] [a-zA-Z]
[[:alnum:]] [a-zA-Z0-9]
[[:lower:]] [a-z]
[[:upper:]] [A-Z]
[[:blank:]] whitespace or tab
[[:space:]] and whitespace character
[[:word:]] [a-zA-Z0-9_]
[[:ascii:]] Any ascii character
[^<interval>] Inverse of <interval>
d [[:digit:]]
D [^[:digit:]]
l [[:lower:]]
L [^[:lower:]]
u [[:upper:]]
U [^[:upper:]]
s [[:space:]]
S [^[:space:]]
w [[:word:]]
W [^[:word:]]
b start or end of word
pL unicode letter
pN unicode number
pS unicode symbol
p{Ll} unicode lower letter
p{Lu} unicode upper letter
p{Sm} unicode symbol math
1 to 9 backreference to a capture block

Functions

clear Clear content.
compile Compile the expression.
create Creates and return an expression.
getCapture Returns the parsed string associated with a given captured group.
getCaptures Returns all the captured strings, in order.
grep(self, string) Find the first occurence in the string.
grep(string, string) Find the first occurence in the string.
grepAll(self, string) Find all the occurences in the string.
grepAll(string, string) Find all the occurences in the string.
match(self, string) Returns true if str matches the regexp.
match(self, string, string, bool) Compile and match the expression.
partialMatch Try to match the start of the string, and returns the matched value or null.

Special Functions

opDrop
opIndex You can get a capture group value by using the derefence syntax.

func RegExp.clear [src]

Clear content.

func clear(using self)

func RegExp.compile [src]

Compile the expression.

func compile(using self, expr: string, ignoreCase = false) throw

func RegExp.create [src]

Creates and return an expression.

func create(expr: string, ignoreCase = false)->Parser.RegExp throw

func RegExp.getCapture [src]

Returns the parsed string associated with a given captured group.

func getCapture(using self, rank: u32)->string

func RegExp.getCaptures [src]

Returns all the captured strings, in order.

func getCaptures(using self)->Array'(string)

func RegExp.grep [src]

Find the first occurence in the string.

func grep(expr, str: string)->string throw func grep(using self, str: string)->string

func RegExp.grepAll [src]

Find all the occurences in the string.

func grepAll(expr, str: string)->Array'(string) throw func grepAll(using self, str: string)->Core.Array'(string)

func RegExp.match [src]

Compile and match the expression.

func match(using self, expr, str: string, ignoreCase = false)->bool throw

Returns true if str matches the regexp.

func match(using self, str: string)->bool

Should have been compiled before.

func RegExp.opDrop [src]

func opDrop(using self)

func RegExp.opIndex [src]

You can get a capture group value by using the derefence syntax.

func opIndex(using self, idx: u64)->string

Returns null if the capture group does not exist

func RegExp.partialMatch [src]

Try to match the start of the string, and returns the matched value or null.

func partialMatch(using self, str: string)->string

namespace Core.Path

Functions

combine Combine multiple paths into one, by adding a directory separator between them if necessary.
equals Returns true if the two paths are equal.
getAbsolute Transform fullname to an absolute path.
getDirectoryName Returns the directory part of the path, null if not found.
getExtension Returns the file name extension, including the . character Returns null if no extension was found.
getExtensionLowerCase Returns the file name extension, including the . character, in lower case Returns null if no extension was found.
getFileName Returns the file name part of the path, null if not found.
getFileNameWithoutExtension Returns the path file name, null if not found.
getRootLength Returns the length of the root part of the path.
getRootName Returns the root part of the path, null if not found.
hasExtension Returns true if the file name contains an extension.
isDirectorySeparator Returns true if the given character is a directory separator.
isExtension Returns true if the given file is of the given extension.
isRooted Tests if the given path contains a root. A path is considered rooted if it starts with a directory separator or a drive letter and a colon.
isValidFileName Returns true if the given file name is valid.
isValidPathName Returns true if the given path name is valid.
normalize Normalize path ' are replaced with /' as this is the std norm for paths.

func Path.combine [src]

Combine multiple paths into one, by adding a directory separator between them if necessary.

func combine(fullnames: string...)->String

func Path.equals [src]

Returns true if the two paths are equal.

func equals(path1, path2: string)->bool

func Path.getAbsolute [src]

Transform fullname to an absolute path.

func getAbsolute(fullname: string)->String throw

func Path.getDirectoryName [src]

Returns the directory part of the path, null if not found.

func getDirectoryName(fullname: string)->string

func Path.getExtension [src]

Returns the file name extension, including the . character Returns null if no extension was found.

func getExtension(fullname: string)->string

func Path.getExtensionLowerCase [src]

Returns the file name extension, including the . character, in lower case Returns null if no extension was found.

func getExtensionLowerCase(fullname: string)->String

func Path.getFileName [src]

Returns the file name part of the path, null if not found.

func getFileName(fullname: string)->string

func Path.getFileNameWithoutExtension [src]

Returns the path file name, null if not found.

func getFileNameWithoutExtension(fullname: string)->string

func Path.getRootLength [src]

Returns the length of the root part of the path.

func getRootLength(fullname: string)->u32

func Path.getRootName [src]

Returns the root part of the path, null if not found.

func getRootName(fullname: string)->string

func Path.hasExtension [src]

Returns true if the file name contains an extension.

func hasExtension(fullname: string)->bool

func Path.isDirectorySeparator [src]

Returns true if the given character is a directory separator.

func isDirectorySeparator(c: u8)->bool

func Path.isExtension [src]

Returns true if the given file is of the given extension.

func isExtension(fullname, extension: string)->bool

func Path.isRooted [src]

Tests if the given path contains a root. A path is considered rooted if it starts with a directory separator or a drive letter and a colon.

func isRooted(fullname: string)->bool

func Path.isValidFileName [src]

Returns true if the given file name is valid.

func isValidFileName(fullname: string)->bool

func Path.isValidPathName [src]

Returns true if the given path name is valid.

func isValidPathName(fullname: string)->bool

func Path.normalize [src]

Normalize path ' are replaced with /' as this is the std norm for paths.

func normalize(fullname: *String)

namespace Core.Random

Structs

CMWC4096
MWC
Mt64
Rng

Functions

shared Get the default per thread random generator.

struct Random.CMWC4096 [src]

q [4096] u32
c u32
i u32 special invalid value (> 4095) to force the seed on first get.

Functions

nextU32
seedU32

func CMWC4096.nextU32 [src]

func nextU32(using self)->u32

func CMWC4096.seedU32 [src]

func seedU32(using self, value: u32)

struct Random.MWC [src]

w u32
z u32

Functions

nextU32
seedU32(self, u32)
seedU32(self, u32, u32)

func MWC.nextU32 [src]

func nextU32(using self)->u32

func MWC.seedU32 [src]

func seedU32(using self, value: u32) func seedU32(using self, value1, value2: u32)

struct Random.Mt64 [src]

mt [312] u64
mti u64

Functions

nextU64
seedU64(self, const [..] u64)
seedU64(self, u64)

func Mt64.nextU64 [src]

func nextU64(using self)->u64

func Mt64.seedU64 [src]

func seedU64(using self, seed: u64) func seedU64(using self, seed: const [..] u64)

struct Random.Rng [src]

struct Rng(T = MWC)
rng Random.Rng.T
seedDone bool

Functions

nextBool Returns a random bool.
nextF32(self) Range is [0..1[, so 1.0 will never be returned.
nextF32(self, f32, f32) Returns a float value in a given range max is excluded.
nextF64(self) Range is [0..1[, so 1.0 will never be returned.
nextF64(self, f64, f64) Returns a float value in a given range max is excluded.
nextS32(self) Returns a signed 32 bits random value.
nextS32(self, s32, s32) Returns a signed random value in a given range max is excluded.
nextS64(self) Returns a signed 64 bits random value.
nextS64(self, s64, s64) Returns a signed random value in a given range max is excluded.
nextU32(self) Returns an unsigned 32 bits random value.
nextU32(self, u32, u32) Returns an unsigned random value in a given range max is excluded.
nextU64(self) Returns an unsigned 64 bits random value.
nextU64(self, u64, u64) Returns an unsigned random value in a given range max is excluded.
seedNow Seed the rng with the current time.
seedU32 Seed random generator with a 32 bits value.
seedU64 Seed random generator with a 64 bits value.
shuffle Randomly change the order of a slice.

func Rng.nextBool [src]

Returns a random bool.

func nextBool(using self)->bool

func Rng.nextF32 [src]

Range is [0..1[, so 1.0 will never be returned.

func nextF32(using self)->f32

Returns a float value in a given range max is excluded.

func nextF32(using self, min, max: f32)->f32

func Rng.nextF64 [src]

Range is [0..1[, so 1.0 will never be returned.

func nextF64(using self)->f64

Returns a float value in a given range max is excluded.

func nextF64(using self, min, max: f64)->f64

func Rng.nextS32 [src]

Returns a signed 32 bits random value.

func nextS32(using self)->s32

Returns a signed random value in a given range max is excluded.

func nextS32(using self, min, max: s32)->s32

func Rng.nextS64 [src]

Returns a signed 64 bits random value.

func nextS64(using self)->s64

Returns a signed random value in a given range max is excluded.

func nextS64(using self, min, max: s64)->s64

func Rng.nextU32 [src]

Returns an unsigned 32 bits random value.

func nextU32(using self)->u32

Returns an unsigned random value in a given range max is excluded.

func nextU32(using self, min, max: u32)->u32

func Rng.nextU64 [src]

Returns an unsigned 64 bits random value.

func nextU64(using self)->u64

Returns an unsigned random value in a given range max is excluded.

func nextU64(using self, min, max: u64)->u64

func Rng.seedNow [src]

Seed the rng with the current time.

func seedNow(using self)

func Rng.seedU32 [src]

Seed random generator with a 32 bits value.

func seedU32(using self, seed: u32)

func Rng.seedU64 [src]

Seed random generator with a 64 bits value.

func seedU64(using self, seed: u64)

func Rng.shuffle [src]

Randomly change the order of a slice.

func(V) shuffle(using self, slice: [..] V)

func Random.shared [src]

Get the default per thread random generator.

func shared()->*Random.Rng'(Core.Random.MWC)

namespace Core.Reflection

Functions

appendValueStructArray Add an element in a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).
canCopy
clearStructArray Used to clear a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).
copy
crcToType Convert a crc to a registered typeinfo.
getAttribute(const *TypeInfo, const *TypeInfo) Returns the given associated attribute to type or null.
getAttribute(const *TypeValue, const *TypeInfo) Returns the given associated attribute to value or null.
getAttributeValue(const *TypeValue, const *TypeInfo, string, T) Returns the given attribute value, or null.
getAttributeValue(const *Attribute, string) Returns the given attribute value, or null.
getAttributeValue(const *TypeInfo, const *TypeInfo, string) Returns the given attribute value, or null.
getAttributeValue(const *TypeValue, const *TypeInfo, string) Returns the given attribute value, or null.
getAttributes(const *TypeInfo, const *TypeInfo) Returns the given associated attributes to type.
getAttributes(const *TypeValue, const *TypeInfo) Returns the given associated attributes to value.
getEnumName Returns the enum value name corresponding to the value pointed by valueAddr Can have multiple names if the enum is tagged with #[Swag.EnumFlags].
getEnumValue Get information about a specific value in a given enum Returns null if the value does not exist.
getField Get information about a specific field in a given struct Returns null if the field does not exist.
getFieldValue Get a field value with a given runtime type.
getMethod Get information about a specific method in a given struct.
getStructArrayType Returns the generic type of the Core.Array typeinfo.
hasAttribute(const *TypeInfo, const *TypeInfo) Returns true if the given type has the associated attribute.
hasAttribute(const *TypeValue, const *TypeInfo) Returns true if the given value has the associated attribute.
hasDrop
hasInterface Returns true if the interface itf is implemented in the given structure type.
hasMethod Helper function to know if a struct has a special method.
hasPostCopy
hasPostMove
isAny
isBool
isEnum
isEnumFlags
isFloat
isGeneric
isInteger
isInterface
isNative
isPod
isPointer
isPointerArithmetic
isPointerRef
isRune
isSimpleNative
isSlice
isStaticArray
isString
isStruct
isStructArray Returns true if the type t is a Core.Array type.
isStructOfName Returns true if this is a struct of the given name.
isTuple
isType
isTypeAlias
makeConcreteAlias In case this is a type alias, need to go deep inside it to find the right type.
makeConcreteEnum Transform an enum type to its underling real native type.
maxSizeOf Returns the maximum sizeof a bunch of typeinfo.
nameToType Convert a crc to a registered typeinfo.
orFlags Make an union of flags of all types.
removeValueStructArray Remove an element in a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).
setFieldValue Set a field value with a given runtime type.

func Reflection.appendValueStructArray [src]

Add an element in a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).

func appendValueStructArray(arrayPtr: *void, valueType: typeinfo)->*void

func Reflection.canCopy [src]

func canCopy(type: typeinfo)->bool

func Reflection.clearStructArray [src]

Used to clear a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).

func clearStructArray(arrayPtr: *void, valueType: typeinfo)

func Reflection.copy [src]

func copy(dst, src: *void, type: typeinfo)

func Reflection.crcToType [src]

Convert a crc to a registered typeinfo.

func crcToType(crc: u32)->const *Swag.TypeInfo

func Reflection.getAttribute [src]

Returns the given associated attribute to value or null.

func getAttribute(value: const *Swag.TypeValue, attribute: typeinfo)->const *Swag.Attribute

Returns the given associated attribute to type or null.

func getAttribute(type: typeinfo, attribute: typeinfo)->const *Swag.Attribute

func Reflection.getAttributeValue [src]

Returns the given attribute value, or null.

func getAttributeValue(type: const *Swag.TypeValue, attribute: typeinfo, value: string)->any func(T) getAttributeValue(type: const *Swag.TypeValue, attribute: typeinfo, value: string, def: T)->T func getAttributeValue(type: typeinfo, attribute: typeinfo, value: string)->any func getAttributeValue(attribute: const *Swag.Attribute, value: string)->any

func Reflection.getAttributes [src]

Returns the given associated attributes to value.

func getAttributes(value: const *Swag.TypeValue, attribute: typeinfo)->Array'(const *Swag.Attribute)

Returns the given associated attributes to type.

func getAttributes(type: typeinfo, attribute: typeinfo)->Array'(const *Swag.Attribute)

func Reflection.getEnumName [src]

Returns the enum value name corresponding to the value pointed by valueAddr Can have multiple names if the enum is tagged with #[Swag.EnumFlags].

func getEnumName(type: typeinfo, valueAddr: const *void, fullname = true)->String

func Reflection.getEnumValue [src]

Get information about a specific value in a given enum Returns null if the value does not exist.

func getEnumValue(type: typeinfo, name: string)->const *Swag.TypeValue

func Reflection.getField [src]

Get information about a specific field in a given struct Returns null if the field does not exist.

func getField(type: typeinfo, name: string)->const *Swag.TypeValue

func Reflection.getFieldValue [src]

Get a field value with a given runtime type.

func getFieldValue(dest: *void, type: const *TypeValue, src: *void, hardCast: bool = false)

func Reflection.getMethod [src]

Get information about a specific method in a given struct.

func getMethod(type: typeinfo, name: string)->const *Swag.TypeValue

Returns null if the method does not exist

func Reflection.getStructArrayType [src]

Returns the generic type of the Core.Array typeinfo.

func getStructArrayType(t: typeinfo)->const *Swag.TypeInfo

If t is not a Core.Array, returns null

func Reflection.hasAttribute [src]

Returns true if the given value has the associated attribute.

func hasAttribute(value: const *Swag.TypeValue, attribute: typeinfo)->bool

Returns true if the given type has the associated attribute.

func hasAttribute(type: typeinfo, attribute: typeinfo)->bool

func Reflection.hasDrop [src]

func hasDrop(type: typeinfo)->bool

func Reflection.hasInterface [src]

Returns true if the interface itf is implemented in the given structure type.

func hasInterface(type: typeinfo, itf: typeinfo)->bool

func Reflection.hasMethod [src]

Helper function to know if a struct has a special method.

func hasMethod(type: typeinfo, name: string)->bool

func Reflection.hasPostCopy [src]

func hasPostCopy(type: typeinfo)->bool

func Reflection.hasPostMove [src]

func hasPostMove(type: typeinfo)->bool

func Reflection.isAny [src]

func isAny(t: typeinfo)->bool

func Reflection.isBool [src]

func isBool(t: typeinfo)->bool

func Reflection.isEnum [src]

func isEnum(t: typeinfo)->bool

func Reflection.isEnumFlags [src]

func isEnumFlags(t: typeinfo)->bool

func Reflection.isFloat [src]

func isFloat(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isGeneric [src]

func isGeneric(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isInteger [src]

func isInteger(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isInterface [src]

func isInterface(t: typeinfo)->bool

func Reflection.isNative [src]

func isNative(t: typeinfo)->bool

func Reflection.isPod [src]

func isPod(type: typeinfo)->bool

func Reflection.isPointer [src]

func isPointer(t: typeinfo)->bool

func Reflection.isPointerArithmetic [src]

func isPointerArithmetic(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isPointerRef [src]

func isPointerRef(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isRune [src]

func isRune(t: typeinfo)->bool

func Reflection.isSimpleNative [src]

func isSimpleNative(t: typeinfo)->bool

func Reflection.isSlice [src]

func isSlice(t: typeinfo)->bool

func Reflection.isStaticArray [src]

func isStaticArray(t: typeinfo)->bool

func Reflection.isString [src]

func isString(t: typeinfo)->bool

func Reflection.isStruct [src]

func isStruct(t: typeinfo)->bool

func Reflection.isStructArray [src]

Returns true if the type t is a Core.Array type.

func isStructArray(t: typeinfo)->bool

func Reflection.isStructOfName [src]

Returns true if this is a struct of the given name.

func isStructOfName(type: typeinfo, name: string)->bool

func Reflection.isTuple [src]

func isTuple(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isType [src]

func isType(t: typeinfo)->Swag.TypeInfoFlags

func Reflection.isTypeAlias [src]

func isTypeAlias(t: typeinfo)->bool

func Reflection.makeConcreteAlias [src]

In case this is a type alias, need to go deep inside it to find the right type.

func makeConcreteAlias(type: typeinfo)->const *Swag.TypeInfo

func Reflection.makeConcreteEnum [src]

Transform an enum type to its underling real native type.

func makeConcreteEnum(type: typeinfo)->const *Swag.TypeInfo

func Reflection.maxSizeOf [src]

Returns the maximum sizeof a bunch of typeinfo.

func maxSizeOf(v: const [..] typeinfo)->u64

func Reflection.nameToType [src]

Convert a crc to a registered typeinfo.

func nameToType(name: string)->const *Swag.TypeInfo

func Reflection.orFlags [src]

Make an union of flags of all types.

func orFlags(v: const [..] typeinfo)->Swag.TypeInfoFlags

func Reflection.removeValueStructArray [src]

Remove an element in a Core.Array without knowing the type of the element at compile time but knowing it at runtime (valueType).

func removeValueStructArray(arrayPtr: *void, valueType: typeinfo, index: u64)

func Reflection.setFieldValue [src]

Set a field value with a given runtime type.

func setFieldValue(dest: *void, type: const *TypeValue, src: const *void, hardCast: bool = false)

namespace Core.Serialization

Structs

Decoder Serialization decoder.
Encoder Serialization encoder.
Serializer

Enums

DecoderFlags
SectionKind

Functions

isPodFinal Determin if a type can be serialized by a simple copy.

Attributes

Alias Accept this other name for the struct field or the struct itself.
Final The struct does not need versionning.
NoSerialize Do not serialize a struct or a field.
Version Set the struct version number.

attr Serialization.Alias [src]

Accept this other name for the struct field or the struct itself.

Usage: struct struct-var multi
attr Alias(name: string)

struct Serialization.Decoder [src]

Serialization decoder.

struct Decoder(T)
serializer Serialization.Decoder.T
flags Serialization.DecoderFlags

This is a high level decoder that needs a specific implementation like Core.Serialization.Read.TagBin or Core.Serialization.Read.JSon.

var res = File.readAllBytes(file) var decoder: Decoder'Read.TagBin let myStruct = catch decoder.readAll'MyStruct(res.toSlice())

Functions

end Finish reading.
readAll Read a full struct.
readTypeValue
readValue
start Start reading.

func IDecoder.beginField [src]

func beginField(using self, val: Swag.TypeValue)->bool throw

func IDecoder.beginSection [src]

func beginSection(using self, kind: SectionKind) throw

func IDecoder.end [src]

func end(using self) throw

func IDecoder.endField [src]

func endField(using self) throw

func IDecoder.endSection [src]

func endSection(using self) throw

func IDecoder.getVersion [src]

func getVersion(using self)->u32

func IDecoder.isTextual [src]

func isTextual(using self)->bool

func IDecoder.read [src]

func read(using self, data: *void, dataType: typeinfo) throw

func IDecoder.readBool [src]

func readBool(using self)->bool throw

func IDecoder.readBufferU8 [src]

func readBufferU8(using self, count: u64)->*u8 throw

func IDecoder.readF32 [src]

func readF32(using self)->f32 throw

func IDecoder.readF64 [src]

func readF64(using self)->f64 throw

func IDecoder.readS16 [src]

func readS16(using self)->s16 throw

func IDecoder.readS32 [src]

func readS32(using self)->s32 throw

func IDecoder.readS64 [src]

func readS64(using self)->s64 throw

func IDecoder.readS8 [src]

func readS8(using self)->s8 throw

func IDecoder.readString [src]

func readString(using self)->String throw

func IDecoder.readU16 [src]

func readU16(using self)->u16 throw

func IDecoder.readU32 [src]

func readU32(using self)->u32 throw

func IDecoder.readU64 [src]

func readU64(using self)->u64 throw

func IDecoder.readU8 [src]

func readU8(using self)->u8 throw

func IDecoder.start [src]

func start(using self, input: const [..] u8) throw

func Decoder.end [src]

Finish reading.

func end(using self) throw

func Decoder.readAll [src]

Read a full struct.

func(TR) readAll(using self, input: const [..] u8)->*TR throw

func Decoder.readTypeValue [src]

func readTypeValue(using self, typeVal: TypeValue, data: ^void) throw

func Decoder.readValue [src]

func readValue(using self, data: ^void, dataType: typeinfo) throw

func Decoder.start [src]

Start reading.

func start(using self, input: const [..] u8) throw

enum Serialization.DecoderFlags [src]

Zero
IgnoreStructFieldError

struct Serialization.Encoder [src]

Serialization encoder.

struct Encoder(T)
serializer Serialization.Encoder.T
errorIfUnknown bool If true, an error will be raised if a type cannot be saved. The field will be ignored if set to false.

This is a high level encoder that needs a specific implementation like Core.Serialization.Write.TagBin or Core.Serialization.Write.JSon.

var buf: ConcatBuffer var encoder: Encoder'Write.TagBin encoder.writeAll(&buf, myStruct) File.writeAllBytes(file, buf)

Can be serialized:

  • All simple types: bool/u8/u16/u32/u64/s8/s16/s32/s64/rune/f32/f64
  • A type value typeinfo, which will be saved as a crc32.
  • An interface. Will be stored as a type and a typed value.
  • A struct.
  • A Core.String.
  • A Core.Array of valid values.
  • A static array of valid values.
Note

Type string is not supported. Consider using Core.String instead.

A struct can implement the ISerialize interface in order to have a specific serialization. If not defined, then the struct will be saved field by field.

Functions

end End serialization.
start Start serialization.
writeAll Write a full struct.
writeTypeValue Write a given Swag.TypeValue.
writeValue Write a given value with a given type.

func IEncoder.beginField [src]

func beginField(using self, val: Swag.TypeValue) throw

func IEncoder.beginSection [src]

func beginSection(using self, kind: SectionKind) throw

func IEncoder.end [src]

End serialization.

func end(using self) throw

func IEncoder.endField [src]

func endField(using self) throw

func IEncoder.endSection [src]

func endSection(using self) throw

func IEncoder.isTextual [src]

func isTextual(using self)->bool

func IEncoder.start [src]

Start serialization.

func start(using self, result: *ConcatBuffer) throw

func IEncoder.write [src]

func write(using self, data: const ^void, type: typeinfo) throw

func IEncoder.writeBool [src]

func writeBool(using self, value: bool)

func IEncoder.writeBufferU8 [src]

func writeBufferU8(using self, data: const ^u8, count: u64) throw

func IEncoder.writeF32 [src]

func writeF32(using self, value: f32)

func IEncoder.writeF64 [src]

func writeF64(using self, value: f64)

func IEncoder.writeS16 [src]

func writeS16(using self, value: s16)

func IEncoder.writeS32 [src]

func writeS32(using self, value: s32)

func IEncoder.writeS64 [src]

func writeS64(using self, value: s64)

func IEncoder.writeS8 [src]

func writeS8(using self, value: s8)

func IEncoder.writeString [src]

func writeString(using self, value: string)

func IEncoder.writeU16 [src]

func writeU16(using self, value: u16)

func IEncoder.writeU32 [src]

func writeU32(using self, value: u32)

func IEncoder.writeU64 [src]

func writeU64(using self, value: u64)

func IEncoder.writeU8 [src]

func writeU8(using self, value: u8)

func Encoder.end [src]

End serialization.

func end(using self) throw

func Encoder.start [src]

Start serialization.

func start(using self, result: *ConcatBuffer) throw

func Encoder.writeAll [src]

Write a full struct.

func writeAll(using self, result: *ConcatBuffer, value: any) throw

Will call Encoder.start, Encoder.writeValue and Encoder.end

func Encoder.writeTypeValue [src]

Write a given Swag.TypeValue.

func writeTypeValue(using self, typeVal: TypeValue, data: const ^void) throw

func Encoder.writeValue [src]

Write a given value with a given type.

func writeValue(using self, data: const ^void, dataType: typeinfo) throw

attr Serialization.Final [src]

The struct does not need versionning.

Usage: struct
attr Final

interface Serialization.IDecoder [src]

getVersion func(*Serialization.IDecoder)->u32
isTextual func(*Serialization.IDecoder)->bool
start func(*Serialization.IDecoder, const [..] u8) throw
end func(*Serialization.IDecoder) throw
beginField func(*Serialization.IDecoder, Swag.TypeValue)->bool throw
endField func(*Serialization.IDecoder) throw
beginSection func(*Serialization.IDecoder, Serialization.SectionKind) throw
endSection func(*Serialization.IDecoder) throw
read func(*Serialization.IDecoder, *void, const *Swag.TypeInfo) throw
readBufferU8 func(*Serialization.IDecoder, u64)->*u8 throw
readBool func(*Serialization.IDecoder)->bool throw
readS8 func(*Serialization.IDecoder)->s8 throw
readS16 func(*Serialization.IDecoder)->s16 throw
readS32 func(*Serialization.IDecoder)->s32 throw
readS64 func(*Serialization.IDecoder)->s64 throw
readU8 func(*Serialization.IDecoder)->u8 throw
readU16 func(*Serialization.IDecoder)->u16 throw
readU32 func(*Serialization.IDecoder)->u32 throw
readU64 func(*Serialization.IDecoder)->u64 throw
readF32 func(*Serialization.IDecoder)->f32 throw
readF64 func(*Serialization.IDecoder)->f64 throw
readString func(*Serialization.IDecoder)->String throw

interface Serialization.IEncoder [src]

isTextual func(*Serialization.IEncoder)->bool
start func(*Serialization.IEncoder, *ConcatBuffer) throw
end func(*Serialization.IEncoder) throw
beginField func(*Serialization.IEncoder, Swag.TypeValue) throw
endField func(*Serialization.IEncoder) throw
beginSection func(*Serialization.IEncoder, Serialization.SectionKind) throw
endSection func(*Serialization.IEncoder) throw
write func(*Serialization.IEncoder, const ^void, const *Swag.TypeInfo) throw
writeBufferU8 func(*Serialization.IEncoder, const ^u8, u64) throw
writeBool func(*Serialization.IEncoder, bool)
writeS8 func(*Serialization.IEncoder, s8)
writeS16 func(*Serialization.IEncoder, s16)
writeS32 func(*Serialization.IEncoder, s32)
writeS64 func(*Serialization.IEncoder, s64)
writeU8 func(*Serialization.IEncoder, u8)
writeU16 func(*Serialization.IEncoder, u16)
writeU32 func(*Serialization.IEncoder, u32)
writeU64 func(*Serialization.IEncoder, u64)
writeF32 func(*Serialization.IEncoder, f32)
writeF64 func(*Serialization.IEncoder, f64)
writeString func(*Serialization.IEncoder, string)

interface Serialization.ISerialize [src]

read func(*Serialization.ISerialize, Serialization.IDecoder)->bool throw
write func(*Serialization.ISerialize, Serialization.IEncoder)->bool throw
readElement func(*Serialization.ISerialize, Swag.TypeValue, *void, Serialization.IDecoder)->bool throw
writeElement func(*Serialization.ISerialize, Swag.TypeValue, const *void, Serialization.IEncoder)->bool throw
postRead func(*Serialization.ISerialize, *void, Serialization.IDecoder) throw

attr Serialization.NoSerialize [src]

Do not serialize a struct or a field.

Usage: struct struct-var

namespace Core.Serialization.Read

Structs

JSon A simple JSON reader.
TagBin Binary serializer with forward/backward compatibility.
TagBinOptions
TagBinSection
Xml A simple XML reader.

struct Read.JSon [src]

A simple JSON reader.

stream ByteStream
line u64
col u64
propName String

In the case of a struct, the JSON file must represent the structure layout (order of fields matters).

Functions

beginElement
beginRoot
beginSection
beginSequence
beginStruct
beginValue
endElement
endRoot
endSection
endSequence
endStruct
endValue
getError
getVersion
isTextual
readNative
startRead
toNextSequenceElement
zapBlanks

func JSon.beginElement [src]

func beginElement(using self, val: TypeValue)->bool throw

func JSon.beginRoot [src]

func beginRoot(using self) throw

func JSon.beginSection [src]

func beginSection(using self, _kind: SectionKind) throw

func JSon.beginSequence [src]

func beginSequence(using self, _typeElem: typeinfo, _data: *u8, _countElem: *u64)->bool throw

func JSon.beginStruct [src]

func beginStruct(using self, _structType: typeinfo, _structData: const *u8)->bool throw

func JSon.beginValue [src]

func beginValue(using self) throw

func JSon.endElement [src]

func endElement(using self) throw

func JSon.endRoot [src]

func endRoot(using self) throw

func JSon.endSection [src]

func endSection(using self) throw

func JSon.endSequence [src]

func endSequence(using self) throw

func JSon.endStruct [src]

func endStruct(using self) throw

func JSon.endValue [src]

func endValue(using self) throw

func JSon.getError [src]

func getError(using self, val: string)->Errors.SyntaxError

func JSon.getVersion [src]

func getVersion(using self)->u32

func JSon.isTextual [src]

func isTextual(using self)->bool

func JSon.readNative [src]

func(NT) readNative(using self)->NT throw

func JSon.startRead [src]

func startRead(using self, input: const [..] u8)

func JSon.toNextSequenceElement [src]

func toNextSequenceElement(using self, _countElem: *u64)->bool

func JSon.zapBlanks [src]

func zapBlanks(using self)

struct Read.TagBin [src]

Binary serializer with forward/backward compatibility.

stream ByteStream
options Serialization.Read.TagBinOptions
freeSections ArrayPtr'(Core.Serialization.Read.TagBinSection)
sections ArrayPtr'(Core.Serialization.Read.TagBinSection)
convertNextNative const *Swag.TypeInfoNative
convertValToArray bool
convertArrayToVal bool

Changes that are supported from V to V+1 are :

  • Add a new field. The new field will stay at the default value.
  • Remove a field. It will just be ignored.
  • Reorder of fields, as long as their name/type are the same.
  • Rename a field with Serialization.Alias.

Supported type changes are :

  • Conversion from integer/float/rune/bool to integer/float/rune/bool.
  • Change the size of a static array.
  • Conversion from a static array to a dynamic Core.Array, and vice versa.
  • Conversion from a single value to a static array or Core.Array, and vice versa.
  • Rename a struct with Serialization.Alias.
  • Convert an existing complexe type to Serialization.Final

Supported attributes are :

  • Serialisation.Version. If version is specified, then loading will not have versioning if versions are the same
  • Serialization.Alias. To rename a field or a struct type. Multiple aliases are supported.
  • Serialization.Final. The struct will be loaded/saved without versioning (faster and lower serialization size)

Functions

beginElement
beginRoot
beginSection
beginSequence
beginStruct
beginValue
endElement
endRoot
endSection
endSequence
endStruct
endValue
getVersion
isTextual
readNative
startRead
toNextSequenceElement

func TagBin.beginElement [src]

func beginElement(using self, val: TypeValue)->bool throw

func TagBin.beginRoot [src]

func beginRoot(using self) throw

func TagBin.beginSection [src]

func beginSection(using self, kind: SectionKind, skipFat = false) throw

func TagBin.beginSequence [src]

func beginSequence(using self, typeElem: typeinfo, data: *u8, countElem: *u64)->bool throw

func TagBin.beginStruct [src]

func beginStruct(using self, structType: typeinfo, _structData: const *u8)->bool throw

func TagBin.beginValue [src]

func beginValue(using self) throw

func TagBin.endElement [src]

func endElement(using self) throw

func TagBin.endRoot [src]

func endRoot(using self) throw

func TagBin.endSection [src]

func endSection(using self) throw

func TagBin.endSequence [src]

func endSequence(using self) throw

func TagBin.endStruct [src]

func endStruct(using self) throw

func TagBin.endValue [src]

func endValue(using self) throw

func TagBin.getVersion [src]

func getVersion(using self)->u32

func TagBin.isTextual [src]

func isTextual(using self)->bool

func TagBin.readNative [src]

func(NT) readNative(using self)->NT throw

func TagBin.startRead [src]

func startRead(using self, input: const [..] u8) throw

func TagBin.toNextSequenceElement [src]

func toNextSequenceElement(using self, countElem: *u64)->bool

struct Read.TagBinOptions [src]

tryForward bool Accept to try to read a newest version, otherwise error.

struct Read.TagBinSection [src]

mapSeek HashTable'(u32, u64)
afterFatSeek u64
version u32
kind Serialization.SectionKind
skipFat bool

struct Read.Xml [src]

A simple XML reader.

stream ByteStream
line u64
col u64
stackTags Array'(string)

In the case of a struct, the XML file must represent the structure layout (order of fields matters).

Functions

beginElement
beginRoot
beginSection
beginSequence
beginStruct
beginValue
endElement
endRoot
endSection
endSequence
endStruct
endValue
getError
getVersion
isTextual
readEndTag
readNative
readStartTag
readTag
startRead
toNextSequenceElement
zapBlanks

func Xml.beginElement [src]

func beginElement(using self, val: TypeValue)->bool throw

func Xml.beginRoot [src]

func beginRoot(using self) throw

func Xml.beginSection [src]

func beginSection(using self, _kind: SectionKind) throw

func Xml.beginSequence [src]

func beginSequence(using self, _typeElem: typeinfo, _data: *u8, _countElem: *u64)->bool throw

func Xml.beginStruct [src]

func beginStruct(using self, structType: typeinfo, structData: const *u8)->bool throw

func Xml.beginValue [src]

func beginValue(using self) throw

func Xml.endElement [src]

func endElement(using self) throw

func Xml.endRoot [src]

func endRoot(using self) throw

func Xml.endSection [src]

func endSection(using self) throw

func Xml.endSequence [src]

func endSequence(using self) throw

func Xml.endStruct [src]

func endStruct(using self) throw

func Xml.endValue [src]

func endValue(using self) throw

func Xml.getError [src]

func getError(using self, val: string)->Errors.SyntaxError

func Xml.getVersion [src]

func getVersion(using self)->u32

func Xml.isTextual [src]

func isTextual(using self)->bool

func Xml.readEndTag [src]

func readEndTag(using self) throw

func Xml.readNative [src]

func(NT) readNative(using self)->NT throw

func Xml.readStartTag [src]

func readStartTag(using self)->string throw

func Xml.readTag [src]

func readTag(using self)->string throw

func Xml.startRead [src]

func startRead(using self, input: const [..] u8)

func Xml.toNextSequenceElement [src]

func toNextSequenceElement(using self, _countElem: *u64)->bool

func Xml.zapBlanks [src]

func zapBlanks(using self)

enum Serialization.SectionKind [src]

Raw
Unordered
Ordered

struct Serialization.Serializer [src]

encode Serialization.IEncoder
decode Serialization.IDecoder
isWrite bool

Functions

beginSection Start a new section.
end End encoding/decoding.
endSection End the previous section.
isReading
isWriting
serialize(self, string, *MT) Serialize one value.
serialize(self, string, u32, *MT) Serialize one value.
startRead Start decoding.
startWrite Start encoding.

func Serializer.beginSection [src]

Start a new section.

func beginSection(using self, kind = SectionKind.Unordered) throw

func Serializer.end [src]

End encoding/decoding.

func end(using self) throw

func Serializer.endSection [src]

End the previous section.

func endSection(using self) throw

func Serializer.isReading [src]

func isReading(using self)->bool

func Serializer.isWriting [src]

func isWriting(using self)->bool

func Serializer.serialize [src]

Serialize one value.

func(MT) serialize(using self, name: string, crc32: u32, res: *MT) throw #[Swag.Macro] func(MT) serialize(using self, name: string, res: *MT) throw

func Serializer.startRead [src]

Start decoding.

func startRead(using self, decoder: IDecoder, input: const [..] u8) throw

func Serializer.startWrite [src]

Start encoding.

func startWrite(using self, encoder: IEncoder, output: *ConcatBuffer) throw

attr Serialization.Version [src]

Set the struct version number.

Usage: struct
attr Version(v: u32)

namespace Core.Serialization.Write

Structs

JSon A JSON writer.
JSonOptions
TagBin
TagBinSection

Enums

TagBinSignatures

struct Write.JSon [src]

A JSON writer.

options Serialization.Write.JSonOptions
output *ConcatBuffer
indent u32
fmtInt StrConv.ConvertFormatInt
fmtFloat StrConv.ConvertFormatFloat
lastSeekValue ConcatBufferSeek

Functions

beginElement
beginRoot
beginSection
beginSequence
beginStruct
beginValue
endElement
endRoot
endSection
endSequence
endStruct
endValue
isTextual
startWrite
writeIndent
writeNative

func JSon.beginElement [src]

func beginElement(using self, val: TypeValue)

func JSon.beginRoot [src]

func beginRoot(using self)

func JSon.beginSection [src]

func beginSection(using self, _kind: SectionKind)

func JSon.beginSequence [src]

func beginSequence(using self, _typeElem: typeinfo, _data: const *void, _countElem: u64)->bool

func JSon.beginStruct [src]

func beginStruct(using self, _structType: typeinfo, _structData: const *u8)->bool

func JSon.beginValue [src]

func beginValue(using self)

func JSon.endElement [src]

func endElement(using self)

func JSon.endRoot [src]

func endRoot(using self)

func JSon.endSection [src]

func endSection(using self)

func JSon.endSequence [src]

func endSequence(using self)

func JSon.endStruct [src]

func endStruct(using self)

func JSon.endValue [src]

func endValue(using self)

func JSon.isTextual [src]

func isTextual(using self)->bool

func JSon.startWrite [src]

func startWrite(using self, buf: *ConcatBuffer)

func JSon.writeIndent [src]

func writeIndent(using self)

func JSon.writeNative [src]

func(NT) writeNative(using self, value: NT)

struct Write.JSonOptions [src]

indentLevel u32
saveBlanks bool

struct Write.TagBin [src]

output *ConcatBuffer
freeSections ArrayPtr'(Core.Serialization.Write.TagBinSection)
sections ArrayPtr'(Core.Serialization.Write.TagBinSection)

Functions

beginElement
beginRoot
beginSection
beginSequence
beginStruct
beginValue
endElement
endRoot
endSection
endSequence
endStruct
endValue
isTextual
startWrite
writeNative

func TagBin.beginElement [src]

func beginElement(using self, val: TypeValue)

func TagBin.beginRoot [src]

func beginRoot(using self)

func TagBin.beginSection [src]

func beginSection(using self, kind: SectionKind)

func TagBin.beginSequence [src]

func beginSequence(using self, typeElem: typeinfo, data: const *void, countElem: u64)->bool

func TagBin.beginStruct [src]

func beginStruct(using self, structType: typeinfo, _structData: const *u8)->bool

func TagBin.beginValue [src]

func beginValue(using self)

func TagBin.endElement [src]

func endElement(using self)

func TagBin.endRoot [src]

func endRoot(using self)

func TagBin.endSection [src]

func endSection(using self)

func TagBin.endSequence [src]

func endSequence(using self)

func TagBin.endStruct [src]

func endStruct(using self)

func TagBin.endValue [src]

func endValue(using self)

func TagBin.isTextual [src]

func isTextual(using self)->bool

func TagBin.startWrite [src]

func startWrite(using self, buf: *ConcatBuffer)

func TagBin.writeNative [src]

func(NT) writeNative(using self, value: NT)

struct Write.TagBinSection [src]

startSeek ConcatBufferSeek
mapSeek HashTable'(u32, Core.ConcatBufferSeek)
kind Serialization.SectionKind

enum Write.TagBinSignatures [src]

Root
Fat
Sequence
Version
Raw
UnRaw

func Serialization.isPodFinal [src]

Determin if a type can be serialized by a simple copy.

func isPodFinal(type: typeinfo)->{raw:bool,sizeof:u64}

namespace Core.Slice

Functions

allOf Returns true if cb returns true for all values.
anyOf Returns true if cb returns true for at least one value.
contains Returns true if the given slice contains the value.
containsSorted Returns true if the given slice contains the value.
equals Returns true if two slices are equal.
findLinear Find value in a slice by performing a linear search.
findSlice Returns true if the given slice contains the sub slice value.
findSorted Find value in a slice by performing a binary search.
insertionSort Insertion sort algorithm (slow).
isSorted(const [..] T) Returns true if the slice is sorted.
isSorted(const [..] T, func(*void, T, T)->s32) Returns true if the slice is sorted.
map Map the content of a slice to an array of type R.
max Get the maximum value of a slice, and the corresponding value index.
min Get the minimum value of a slice, and the corresponding value index.
modify Transform in place the content of a slice with a given lambda.
nextPermutation Get a permutation of the slice Shuffle the slice until no more permutation is possible, and then returns false. To obtain all permutations, the slice must be sorted the first time.
noneOf Returns true if cb returns false for all values.
quickSort Quick sort algorithm.
reduce Reduce the content of a slice to one single value.
reverse Reverse the content of a slice.
sort([..] T, bool) Sort the slice, by picking the right algorithm depending on the type and the number of elements.
sort([..] T, func(*void, T, T)->s32) Sort the slice, by picking the right algorithm depending on the type and the number of elements.

func Slice.allOf [src]

Returns true if cb returns true for all values.

func(T) allOf(values: const [..] T, cb: func||(T)->bool)->bool

func Slice.anyOf [src]

Returns true if cb returns true for at least one value.

func(T) anyOf(values: const [..] T, cb: func||(T)->bool)->bool

func Slice.contains [src]

Returns true if the given slice contains the value.

func(T, V) contains(values: const [..] T, value: V)->bool

func Slice.containsSorted [src]

Returns true if the given slice contains the value.

func(T, V) containsSorted(values: const [..] T, value: V)->bool

The slice must be sorted in ascending order

func Slice.equals [src]

Returns true if two slices are equal.

func(T) equals(dst, src: const [..] T)->bool

func Slice.findLinear [src]

Find value in a slice by performing a linear search.

func(T, V) findLinear(values: const [..] T, value: V)->u64

O^n, but slice does not have to be sorted. Returns Swag.U64.Max if not found.

func Slice.findSlice [src]

Returns true if the given slice contains the sub slice value.

func(T) findSlice(values, value: const [..] T)->u32

func Slice.findSorted [src]

Find value in a slice by performing a binary search.

func(T, V) findSorted(values: const [..] T, value: V)->u64

The slice must be sorted in ascending order Returns Swag.U64.Max if not found.

func Slice.insertionSort [src]

Insertion sort algorithm (slow).

func(T) insertionSort(values: [..] T, cb: func||(T, T)->s32)

func Slice.isSorted [src]

Returns true if the slice is sorted.

func(T) isSorted(values: const [..] T)->bool func(T) isSorted(values: const [..] T, cb: func||(T, T)->s32)->bool

func Slice.map [src]

Map the content of a slice to an array of type R.

func(T, R) map(values: const [..] T, cb: func||(T)->R)->Array'(R)

The lambda must return the value of R for each element of the slice.

func Slice.max [src]

Get the maximum value of a slice, and the corresponding value index.

func(T) max(values: const [..] T)->{value:T,index:u64}

func Slice.min [src]

Get the minimum value of a slice, and the corresponding value index.

func(T) min(values: const [..] T)->{value:T,index:u64}

func Slice.modify [src]

Transform in place the content of a slice with a given lambda.

func(T) modify(values: [..] T, cb: func||(*T))

func Slice.nextPermutation [src]

Get a permutation of the slice Shuffle the slice until no more permutation is possible, and then returns false. To obtain all permutations, the slice must be sorted the first time.

func(T) nextPermutation(arr: [..] T)->bool

func Slice.noneOf [src]

Returns true if cb returns false for all values.

func(T) noneOf(values: const [..] T, cb: func||(T)->bool)->bool

func Slice.quickSort [src]

Quick sort algorithm.

func(T) quickSort(values: [..] T, cb: func||(T, T)->s32)

func Slice.reduce [src]

Reduce the content of a slice to one single value.

func(T) reduce(values: const [..] T, cb: func||(T, T)->T)->T

The lambda is called with the previous reduced value and each element of the slice. The first reduced value is the first element of the slice.

func Slice.reverse [src]

Reverse the content of a slice.

func(T) reverse(values: [..] T)

func Slice.sort [src]

Sort the slice, by picking the right algorithm depending on the type and the number of elements.

func(T) sort(values: [..] T, bigFirst = false) func(T) sort(values: [..] T, cb: func||(T, T)->s32)

struct Core.StaticArray [src]

struct StaticArray(T, N: u64)
buffer [?] StaticArray.T
count u64

Functions

add(self, &&T) Move one element at the end of the array.
add(self, T) Add a copy of one element at the end of the array.
add(self, const [..] T) Append a slice to the end of this instance.
addOnce Add a copy of one element at the end of the array.
back Returns a copy of the last element.
backPtr Returns the address of the last element.
clear Set the number of elements to 0.
contains Returns true if the given value is in the array.
emplaceAddress Reserve room at the end of the array for num elements.
emplaceAt Move some values at the given index.
emplaceInitAddress Reserve room at the end of the array for num elements.
free Free the array content.
front Returns a copy of the first element.
frontPtr Returns the address of the first element.
insertAt(self, u64, &&T) Move a value at the given index.
insertAt(self, u64, T) Insert a value at the given index.
insertAt(self, u64, const [..] T) Insert some values at the given index.
isEmpty Returns true if the array is empty.
popBack Returns a copy of the last element, and remove it from the array.
remove(self, V) Remove the given value If not found, does nothing.
remove(self, u64, u64) Remove num elements starting at index.
removeAt Remove an element at index by replacing it with the last element.
removeAtOrdered Remove numValues elements at index by shifting all others.
removeBack Remove the last element.
removeOrdered Remove the given value If not found, does nothing.
resize Change the number of valid elements in the array.
sort(self) Sort array.
sort(self, func(*void, T, T)->s32) Sort array.
sortReverse Sort array in reverse order (from biggest to lowest value).
toSlice Returns a slice.

Special Functions

opAffect Initializes an Array that contains values copied from the specified array.
opCast(self)
opCast(self)
opCount
opData
opDrop
opIndex(self, u64)
opIndex(self, u64)
opIndexAffect
opIndexAssign
opSlice
opVisit Visit every elements of the array.

func StaticArray.add [src]

Add a copy of one element at the end of the array.

func add(using self, value: self.T)

Move one element at the end of the array.

func add(using self, value: &&self.T)

Append a slice to the end of this instance.

func add(using self, values: const [..] self.T)

func StaticArray.addOnce [src]

Add a copy of one element at the end of the array.

func addOnce(using self, value: self.T)

func StaticArray.back [src]

Returns a copy of the last element.

func back(using self)->StaticArray.T

func StaticArray.backPtr [src]

Returns the address of the last element.

func backPtr(using self)->*StaticArray.T

func StaticArray.clear [src]

Set the number of elements to 0.

func clear(using self)

func StaticArray.contains [src]

Returns true if the given value is in the array.

func(V) contains(using self, value: V)->bool

func StaticArray.emplaceAddress [src]

Reserve room at the end of the array for num elements.

func emplaceAddress(using self, num: u32 = 1)->^StaticArray.T

Does not initialize them. Returns the address of the first element

func StaticArray.emplaceAt [src]

Move some values at the given index.

func emplaceAt(using self, index: u64, values: [..] self.T)

If index is equal to count, then the values are moved at the end of the array. Order is preserved.

func StaticArray.emplaceInitAddress [src]

Reserve room at the end of the array for num elements.

func emplaceInitAddress(using self, num: u32 = 1)->^StaticArray.T

Returns the address of the first element

func StaticArray.free [src]

Free the array content.

func free(using self)

func StaticArray.front [src]

Returns a copy of the first element.

func front(using self)->StaticArray.T

func StaticArray.frontPtr [src]

Returns the address of the first element.

func frontPtr(using self)->*StaticArray.T

func StaticArray.insertAt [src]

Insert a value at the given index.

func insertAt(using self, index: u64, value: self.T)

If index is equal to count, then the value is added at the end of the array. Order is preserved.

Move a value at the given index.

func insertAt(using self, index: u64, value: &&self.T)

If index is equal to count, then the value is added at the end of the array. Order is preserved.

Insert some values at the given index.

func insertAt(using self, index: u64, values: const [..] self.T)

If index is equal to count, then the values are added at the end of the array. Order is preserved.

func StaticArray.isEmpty [src]

Returns true if the array is empty.

func isEmpty(using const self)

func StaticArray.opAffect [src]

Initializes an Array that contains values copied from the specified array.

func opAffect(using self, arr: const [..] self.T)

func StaticArray.opCast [src]

func opCast(using self)->[..] StaticArray.T func opCast(using self)->const [..] StaticArray.T

func StaticArray.opCount [src]

func opCount(using self)->u64

func StaticArray.opData [src]

func opData(using self)->const *StaticArray.T

func StaticArray.opDrop [src]

func opDrop(using self)

func StaticArray.opIndex [src]

func opIndex(using const self, index: u64)->const &StaticArray.T func opIndex(using self, index: u64)->&StaticArray.T

func StaticArray.opIndexAffect [src]

func opIndexAffect(using self, index: u64, value: self.T)

func StaticArray.opIndexAssign [src]

func(op: string) opIndexAssign(using self, index: u64, value: self.T)

func StaticArray.opSlice [src]

func opSlice(using self, lower, upper: u64)->[..] StaticArray.T

func StaticArray.opVisit [src]

Visit every elements of the array.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using const self, stmt: code)

Visiting by pointer and in reverse order is supported

func StaticArray.popBack [src]

Returns a copy of the last element, and remove it from the array.

func popBack(using self)->StaticArray.T

func StaticArray.remove [src]

Remove num elements starting at index.

func remove(using self, index, num: u64)

Remove the given value If not found, does nothing.

func(V) remove(using self, value: V)

func StaticArray.removeAt [src]

Remove an element at index by replacing it with the last element.

func removeAt(using self, index: u64)

Order is not preserved

func StaticArray.removeAtOrdered [src]

Remove numValues elements at index by shifting all others.

func removeAtOrdered(using self, index: u64, numValues: u64 = 1)

Order is preserved

func StaticArray.removeBack [src]

Remove the last element.

func removeBack(using self)

func StaticArray.removeOrdered [src]

Remove the given value If not found, does nothing.

func(V) removeOrdered(using self, value: V)

func StaticArray.resize [src]

Change the number of valid elements in the array.

func resize(using self, newCount: u64)

func StaticArray.sort [src]

Sort array.

func sort(using self) func sort(using self, cb: func||(self.T, self.T)->s32)

func StaticArray.sortReverse [src]

Sort array in reverse order (from biggest to lowest value).

func sortReverse(using self)

func StaticArray.toSlice [src]

Returns a slice.

func toSlice(using self)->[..] StaticArray.T

namespace Core.StrConv

Structs

ConvertFormat
ConvertFormatFloat Format structure to convert a float to a string.
ConvertFormatInt Format structure to convert an integer to a string.
StringBuilder

Functions

convert Templated version. Convert a value of type T.
convertAny Convert a value to an utf8 string, and append the result in a ConcatBuffer.
convertBool Convert a bool to a string, and put the result in a ConcatBuffer.
convertFloat(*ConcatBuffer, any, const &ConvertFormat, string) Convert a float to an utf8 string, and put the result in a ConcatBuffer.
convertFloat(*ConcatBuffer, any, const &ConvertFormatFloat) Convert a float to an utf8 string, and put the result in a ConcatBuffer.
convertInt(*ConcatBuffer, any, const &ConvertFormat, string) Convert an integer to an utf8 string, and put the result in a ConcatBuffer.
convertInt(*ConcatBuffer, any, const &ConvertFormatInt) Convert an integer to an utf8 string, and put the result in a ConcatBuffer.
convertRune Convert a rune to a string, and put the result in a ConcatBuffer.
convertStruct Convert a structure content to an utf8 string, and put the result in a ConcatBuffer.
parseB64 Convert an utf8 buffer in binary to an unsigned integer value.
parseBool Convert an utf8 buffer to a boolean.
parseF32 Convert an utf8 buffer to a floating point value.
parseF64
parseIdentifier Parse an identifier name in the sens of swag (ascii).
parseRune Convert an utf8 buffer to a simple rune.
parseS16
parseS32
parseS64
parseS8 Convert an utf8 buffer to an signed integer value.
parseString Convert an utf8 buffer to a String.
parseU16
parseU32
parseU64
parseU8 Convert an utf8 buffer in decimal to an unsigned integer value.
parseValue This function will parse the string buf and decode the corresponding value in addr.
parseX64 Convert an utf8 buffer in hexadecimal to an unsigned integer value.
toDisplaySize Convert a size in a displayable format (with Kb, Mb and so on).
toF32 Transform a string to an f32.
toF64 Transform a string to an f64.
toNum Transform a string to an integer or float.
toS16 Transform a string to an s16.
toS32 Transform a string to an s32.
toS64 Transform a string to an s64.
toS8 Transform a string to an s8.
toU16 Transform a string to an u16.
toU32 Transform a string to an u32.
toU64 Transform a string to an u64.
toU8 Transform a string to an u8.

namespace Core.StrConv.Atod

Functions

parse

func Atod.parse [src]

func parse(s: const [..] u8)->{value:f64,eat:u32,ovf:bool} throw

struct StrConv.ConvertFormat [src]

formatInt StrConv.ConvertFormatInt
formatFloat StrConv.ConvertFormatFloat

struct StrConv.ConvertFormatFloat [src]

Format structure to convert a float to a string.

precision s8 -1 is for 'most possible precision'.
fmt u8
forceSign bool

Functions

setFormat Set some format options with a given user string.

func ConvertFormatFloat.setFormat [src]

Set some format options with a given user string.

func setFormat(using self, strFormat: string)

Format is [+][fmt][precision]

+

To force the positive sign if the number is positive + fmt This is the output format:

e -d.dddde±dd, a decimal exponent
E -d.ddddE±dd, a decimal exponent
f -ddd.dddd, no exponent
g e for large exponents, f otherwise
G E for large exponents, f otherwise

precision

A number which is the precision of the fractional part

struct StrConv.ConvertFormatInt [src]

Format structure to convert an integer to a string.

base u32
padding u8
width u8
forceSign bool

If signed is true, the value to convert must be stored in signedValue, otherwise it must be stored in unsignedValue.

Functions

setFormat Set some format options with a given user string.

func ConvertFormatInt.setFormat [src]

Set some format options with a given user string.

func setFormat(using self, strFormat: string)

The format is [+][fmt][padding][width]'

+'

To force the positive sign if the number is positive + fmt This is the output format:

B Binary
D Decimal
X Hexadecimal

padding

The padding character, in ascii. It's mandatory before the next field + width The width of the output, in number of characters

namespace Core.StrConv.Dtoa

Functions

parse Convert of floating value to a string.

func Dtoa.parse [src]

Convert of floating value to a string.

func parse(buf: *ConcatBuffer, val: f64, fmt: u8, precision: s64, forceSign: bool)

The format fmt is one of:

e -d.dddde±dd, a decimal exponent
E -d.ddddE±dd, a decimal exponent
f -ddd.dddd, no exponent
g e for large exponents, f otherwise
G E for large exponents, f otherwise

A negative precision means only as much as needed to be exact

interface StrConv.IConvert [src]

convert func(*StrConv.IConvert, *ConcatBuffer, StrConv.ConvertFormat, string)

interface StrConv.IPokeValue [src]

poke func(*StrConv.IPokeValue, string)->string throw

struct StrConv.StringBuilder [src]

buffer ConcatBuffer

Functions

appendAny Append a value.
appendEOL Append a end of line.
appendFormat Append a formatted string.
appendRune Append a rune.
appendString Append a string.
clear Clear the content of the builder.
count Returns the number of characters.
moveToString Return the content as a string by eating the content of the string builder (if possible).
setBucketSize Set sizes of buckets of the string builder.
toString Return the content as a string.
zeroTerminated Force a ending 0.

func StringBuilder.appendAny [src]

Append a value.

func appendAny(using self, value: any, strFormat: string = null)

func StringBuilder.appendEOL [src]

Append a end of line.

func appendEOL(using self)

func StringBuilder.appendFormat [src]

Append a formatted string.

func appendFormat(using self, fmt: string, values: ...)

func StringBuilder.appendRune [src]

Append a rune.

func appendRune(using self, value: rune)

func StringBuilder.appendString [src]

Append a string.

func appendString(using self, value: string)

func StringBuilder.clear [src]

Clear the content of the builder.

func clear(using self)

func StringBuilder.count [src]

Returns the number of characters.

func count(using const self)->u64

func StringBuilder.moveToString [src]

Return the content as a string by eating the content of the string builder (if possible).

func moveToString(using const self)->String

func StringBuilder.setBucketSize [src]

Set sizes of buckets of the string builder.

func setBucketSize(using self, size: u64)

func StringBuilder.toString [src]

Return the content as a string.

func toString(using const self)->String

func StringBuilder.zeroTerminated [src]

Force a ending 0.

func zeroTerminated(using self)

func StrConv.convert [src]

Templated version. Convert a value of type T.

func(T) convert(buf: *ConcatBuffer, value: T, convFmt: ConvertFormat, strFormat: string)

func StrConv.convertAny [src]

Convert a value to an utf8 string, and append the result in a ConcatBuffer.

func convertAny(buf: *ConcatBuffer, value: any, convFmt: ConvertFormat, strFormat: string)

func StrConv.convertBool [src]

Convert a bool to a string, and put the result in a ConcatBuffer.

func convertBool(buf: *ConcatBuffer, value: bool)

func StrConv.convertFloat [src]

Convert a float to an utf8 string, and put the result in a ConcatBuffer.

func convertFloat(buf: *ConcatBuffer, value: any, fmt: ConvertFormatFloat) func convertFloat(buf: *ConcatBuffer, value: any, convFmt: ConvertFormat, strFormat: string)

func StrConv.convertInt [src]

Convert an integer to an utf8 string, and put the result in a ConcatBuffer.

func convertInt(buf: *ConcatBuffer, value: any, fmt: ConvertFormatInt) func convertInt(buf: *ConcatBuffer, value: any, convFmt: ConvertFormat, strFormat: string)

func StrConv.convertRune [src]

Convert a rune to a string, and put the result in a ConcatBuffer.

func convertRune(buf: *ConcatBuffer, value: rune)

func StrConv.convertStruct [src]

Convert a structure content to an utf8 string, and put the result in a ConcatBuffer.

func convertStruct(buf: *ConcatBuffer, value: any, convFmt: ConvertFormat, strFormat: string)

func StrConv.parseB64 [src]

Convert an utf8 buffer in binary to an unsigned integer value.

func parseB64(str: string)->{value:u64,eat:u32,ovf:bool} throw

Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow

func StrConv.parseBool [src]

Convert an utf8 buffer to a boolean.

func parseBool(str: string)->{value:bool,eat:u32} throw

Returns the value and the number of bytes used to make the conversion

func StrConv.parseF32 [src]

Convert an utf8 buffer to a floating point value.

func parseF32(str: string)->{value:f32,eat:u32,ovf:bool} throw

Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow

func StrConv.parseF64 [src]

func parseF64(str: string)->{value:f64,eat:u32,ovf:bool} throw

func StrConv.parseIdentifier [src]

Parse an identifier name in the sens of swag (ascii).

func parseIdentifier(str: string)->string throw

func StrConv.parseRune [src]

Convert an utf8 buffer to a simple rune.

func parseRune(str: string)->{value:rune,eat:u32} throw

func StrConv.parseS16 [src]

func parseS16(str: string)->{value:s16,eat:u32,ovf:bool} throw

func StrConv.parseS32 [src]

func parseS32(str: string)->{value:s32,eat:u32,ovf:bool} throw

func StrConv.parseS64 [src]

func parseS64(str: string)->{value:s64,eat:u32,ovf:bool} throw

func StrConv.parseS8 [src]

Convert an utf8 buffer to an signed integer value.

func parseS8(str: string)->{value:s8,eat:u32,ovf:bool} throw

Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow

func StrConv.parseString [src]

Convert an utf8 buffer to a String.

func parseString(str: string)->{value:String,eat:u32} throw

String in the buffer can be quoted (but the result will not be in that case)

func StrConv.parseU16 [src]

func parseU16(str: string)->{value:u16,eat:u32,ovf:bool} throw

func StrConv.parseU32 [src]

func parseU32(str: string)->{value:u32,eat:u32,ovf:bool} throw

func StrConv.parseU64 [src]

func parseU64(str: string)->{value:u64,eat:u32,ovf:bool} throw

func StrConv.parseU8 [src]

Convert an utf8 buffer in decimal to an unsigned integer value.

func parseU8(str: string)->{value:u8,eat:u32,ovf:bool} throw

Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow

func StrConv.parseValue [src]

This function will parse the string buf and decode the corresponding value in addr.

func parseValue(addr: *void, type: typeinfo, buf: string)->string throw

addr must point to an initialized memory location that can hold type

Accepted types are :

  • s8, s16, s32, s64, u8, u16, u32, u64, rune, bool, f32, f64
  • Core.String literal strings are not supported as buf is supposed to be transient
  • enum with or without Swag.EnumFlags attribute

buf can contain multiple values separated with blanks if type is:

  • a static array of the types above
  • a dynamic Core.Array of the types above

func StrConv.parseX64 [src]

Convert an utf8 buffer in hexadecimal to an unsigned integer value.

func parseX64(str: string)->{value:u64,eat:u32,ovf:bool} throw

Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow

func StrConv.toDisplaySize [src]

Convert a size in a displayable format (with Kb, Mb and so on).

func toDisplaySize(value: u64)->String

func StrConv.toF32 [src]

Transform a string to an f32.

func toF32(str: string)->f32 throw

func StrConv.toF64 [src]

Transform a string to an f64.

func toF64(str: string)->f64 throw

func StrConv.toNum [src]

Transform a string to an integer or float.

func(T) toNum(str: string)->T throw

func StrConv.toS16 [src]

Transform a string to an s16.

func toS16(str: string)->s16 throw

func StrConv.toS32 [src]

Transform a string to an s32.

func toS32(str: string)->s32 throw

func StrConv.toS64 [src]

Transform a string to an s64.

func toS64(str: string)->s64 throw

func StrConv.toS8 [src]

Transform a string to an s8.

func toS8(str: string)->s8 throw

func StrConv.toU16 [src]

Transform a string to an u16.

func toU16(str: string)->u16 throw

func StrConv.toU32 [src]

Transform a string to an u32.

func toU32(str: string)->u32 throw

func StrConv.toU64 [src]

Transform a string to an u64.

func toU64(str: string)->u64 throw

func StrConv.toU8 [src]

Transform a string to an u8.

func toU8(str: string)->u8 throw

struct Core.String [src]

buffer ^u8
length u64
capacity u64
allocator Swag.IAllocator
padding [16] u8

Functions

append(self, rune) Append a rune to the String.
append(self, string) Append a string to the String.
append(self, u8) Append a byte to the String.
appendFormat Append a formatted string.
back Get the last byte.
clear Set the length of the String to 0.
contains(self, const [..] u8)
contains(self, rune)
contains(self, string)
contains(self, u8) Returns true if the string contains what.
ensureNotNull Transform a null string in an empty one.
from Convert a literal string to a String.
grow Ensure the String is big enough to store a given amount of bytes.
indexOf(self, rune, u64)
indexOf(self, string, u64, ComparisonType) Find what, and returns the byte index of it.
insert(self, u64, string) Insert a substring at the given position.
insert(self, u64, u8) Insert an ascii byte at the given position.
isEmpty Returns true if the String has zero length.
isNull Returns true if the String is null (undefined).
isNullOrEmpty Returns true if the String is null or empty.
join Join a list of strings to make a unique one.
joinWith Join an list of strings to make a unique one, by using a given separator between them.
makeLower Convert the string inplace to lower case.
makeUpper Convert the string inplace to upper case.
remove Remove some bytes at the given index.
removeBack Remove some bytes at the end.
replace(self, rune, string) Replace all occurences of what with by.
replace(self, string, string, ComparisonType) Replace all occurences of what with by.
reserve Reserve room for at least newCapacity bytes.
startsWith Return true if the string starts with str.
toLower(self, CharacterSet) Returns a new String in lower case.
toLower(string, CharacterSet) Returns a new String in lower case.
toRuneArray Convert string to a 32 bits character array.
toSlice(self) Returns a slice type.
toSlice(self) Returns a slice type.
toString Returns a string type.
toUpper(self, CharacterSet) Returns a new String in upper case.
toUpper(string, CharacterSet) Returns a new String in lower case.
trim Removes all leading and trailing white-space characters from the current String.
trimEnd Remove whitespaces at the end of the String.
trimStart Remove whitespaces at the start of the String.

Special Functions

opAffect
opAssign(self, const [..] rune)
opAssign(self, const [..] string)
opAssign(self, const [..] u8)
opAssign(self, rune)
opAssign(self, string)
opAssign(self, u8)
opCast(self)
opCast(self)
opCast(self)
opCmp
opCount
opData
opDrop
opEquals
opIndex Returns the byte at the given index.
opIndexAffect
opIndexAssign
opPostCopy
opPostMove
opSlice
opVisit Default foreach, by bytes.
opVisitBytes Visit the String utf8 bytes.
opVisitRunes Visit the String runes See Utf8.visitRunes for aliases.

func IHash32.compute [src]

func compute(using const self)->u32

func String.append [src]

Append a byte to the String.

func append(using self, value: u8)

Append a rune to the String.

func append(using self, value: rune)

Append a string to the String.

func append(using self, value: string)

func String.appendFormat [src]

Append a formatted string.

func appendFormat(using self, format: string, values: ...)

func String.back [src]

Get the last byte.

func back(using self)->u8

func String.clear [src]

Set the length of the String to 0.

func clear(using self)

func String.contains [src]

Returns true if the string contains what.

func contains(using const self, what: u8)->bool func contains(using const self, what: rune)->bool func contains(using const self, what: string)->bool func contains(using const self, what: const [..] u8)->bool

func String.ensureNotNull [src]

Transform a null string in an empty one.

func ensureNotNull(using self)

func String.from [src]

Convert a literal string to a String.

func from(value: string)->String

func String.grow [src]

Ensure the String is big enough to store a given amount of bytes.

func grow(using self, wantedCapacity: u64)

func String.indexOf [src]

Find what, and returns the byte index of it.

func indexOf(using const self, what: string, startByteIndex = 0'u64, comparisonType = Utf8.ComparisonType.Latin1)->u64 func indexOf(using const self, what: rune, startByteIndex = 0'u64)->u64

func String.insert [src]

Insert an ascii byte at the given position.

func insert(using self, byteIndex: u64, value: u8)

Insert a substring at the given position.

func insert(using self, byteIndex: u64, value: string)

func String.isEmpty [src]

Returns true if the String has zero length.

func isEmpty(using const self)->bool

func String.isNull [src]

Returns true if the String is null (undefined).

func isNull(using const self)->bool

func String.isNullOrEmpty [src]

Returns true if the String is null or empty.

func isNullOrEmpty(using const self)->bool

func String.join [src]

Join a list of strings to make a unique one.

func join(values: string...)->String

func String.joinWith [src]

Join an list of strings to make a unique one, by using a given separator between them.

func joinWith(separator: string, values: string...)->String

func String.makeLower [src]

Convert the string inplace to lower case.

func makeLower(using self, set = CharacterSet.Latin1)

func String.makeUpper [src]

Convert the string inplace to upper case.

func makeUpper(using self, set = CharacterSet.Latin1)

func String.opAffect [src]

func opAffect(using self, value: string)

func String.opAssign [src]

func(op: string) opAssign(using self, value: const [..] string) func(op: string) opAssign(using self, value: const [..] rune) func(op: string) opAssign(using self, value: const [..] u8) func(op: string) opAssign(using self, value: string) func(op: string) opAssign(using self, value: rune) func(op: string) opAssign(using self, value: u8)

func String.opCast [src]

func opCast(using const self)->cstring func opCast(using const self)->string func opCast(using const self)->const [..] u8

func String.opCmp [src]

func opCmp(using const self, other: string)->s32

func String.opCount [src]

func opCount(using const self)->u64

func String.opData [src]

func opData(using const self)->const ^u8

func String.opDrop [src]

func opDrop(using self)

func String.opEquals [src]

func opEquals(using const self, other: string)->bool

func String.opIndex [src]

Returns the byte at the given index.

func opIndex(using const self, index: u64)->u8

func String.opIndexAffect [src]

func opIndexAffect(using self, index: u64, value: u8)

func String.opIndexAssign [src]

func(op: string) opIndexAssign(using self, index: u64, value: u8)

func String.opPostCopy [src]

func opPostCopy(using self)

func String.opPostMove [src]

func opPostMove(using self)

func String.opSlice [src]

func opSlice(using const self, lower, upper: u64)->string

func String.opVisit [src]

Default foreach, by bytes.

#[Swag.Macro] func(ptr: bool, back: bool) opVisit(using self, stmt: code)

func String.opVisitBytes [src]

Visit the String utf8 bytes.

#[Swag.Macro] func(ptr: bool, back: bool) opVisitBytes(using self, stmt: code)
  • #alias0 will contain the byte or the pointer to the byte
  • #alias1 will contain the byte index

func String.opVisitRunes [src]

Visit the String runes See Utf8.visitRunes for aliases.

#[Swag.Macro] func(ptr: bool, back: bool) opVisitRunes(using self, stmt: code)

func String.remove [src]

Remove some bytes at the given index.

func remove(using self, byteIndex: u64, byteCount: u64 = 1)

func String.removeBack [src]

Remove some bytes at the end.

func removeBack(using self, byteCount: u64 = 1)

func String.replace [src]

Replace all occurences of what with by.

func replace(using self, what: rune, by: string) func replace(using self, what, by: string, comparisonType = Utf8.ComparisonType.Latin1)

func String.reserve [src]

Reserve room for at least newCapacity bytes.

func reserve(using self, newCapacity: u64)

func String.startsWith [src]

Return true if the string starts with str.

func startsWith(using const self, str: string, comparisonType = Utf8.ComparisonType.Latin1)->bool

func String.toLower [src]

Returns a new String in lower case.

func toLower(using self, set = CharacterSet.Latin1)->String func toLower(str: string, set = CharacterSet.Latin1)->String

func String.toRuneArray [src]

Convert string to a 32 bits character array.

func toRuneArray(using const self)->Array'(rune)

func String.toSlice [src]

Returns a slice type.

func toSlice(using self)->[..] u8 func toSlice(using const self)->const [..] u8

func String.toString [src]

Returns a string type.

func toString(using const self)->string

func String.toUpper [src]

Returns a new String in upper case.

func toUpper(using self, set = CharacterSet.Latin1)->String

Returns a new String in lower case.

func toUpper(str: string, set = CharacterSet.Latin1)->String

func String.trim [src]

Removes all leading and trailing white-space characters from the current String.

func trim(using self)

func String.trimEnd [src]

Remove whitespaces at the end of the String.

func trimEnd(using self)

func String.trimStart [src]

Remove whitespaces at the start of the String.

func trimStart(using self)

namespace Core.Sync

Structs

Event
Mutex
RWLock

Functions

scopedLock
sharedLock

struct Sync.Event [src]

handle Win32.HANDLE

Functions

create Creates a new event.
init Initialize event.
isValid Returns true if the event is valid.
release Destroy an existing event.
reset Reset the event state.
signal Signal the event.
wait Wait for the event to be signaled.

Special Functions

opDrop

func Event.create [src]

Creates a new event.

func create()->Sync.Event

func Event.init [src]

Initialize event.

func init(using self, manual, initState = false)

func Event.isValid [src]

Returns true if the event is valid.

func isValid(using self)->bool

func Event.opDrop [src]

func opDrop(using self)

func Event.release [src]

Destroy an existing event.

func release(using self)

func Event.reset [src]

Reset the event state.

func reset(using self)

func Event.signal [src]

Signal the event.

func signal(using self)

func Event.wait [src]

Wait for the event to be signaled.

func wait(using self)

struct Sync.Mutex [src]

v Win32.SRWLOCK

Functions

lock Lock mutex.
tryLock Try to lock the mutex, and return true if it's the case.
unlock Unlock mutex.

func Mutex.lock [src]

Lock mutex.

func lock(using self)

func Mutex.tryLock [src]

Try to lock the mutex, and return true if it's the case.

func tryLock(using self)->bool

func Mutex.unlock [src]

Unlock mutex.

func unlock(using self)

struct Sync.RWLock [src]

v Win32.SRWLOCK

Functions

lock
lockExclusive Lock mutex.
lockShared Lock mutex.
tryLockExclusive Try to lock the mutex, and return true if it's the case.
tryLockShared Try to lock the mutex, and return true if it's the case.
unlock
unlockExclusive Unlock mutex.
unlockShared Unlock mutex.

func RWLock.lock [src]

func lock(using self)

func RWLock.lockExclusive [src]

Lock mutex.

func lockExclusive(using self)

func RWLock.lockShared [src]

Lock mutex.

func lockShared(using self)

func RWLock.tryLockExclusive [src]

Try to lock the mutex, and return true if it's the case.

func tryLockExclusive(using self)->bool

func RWLock.tryLockShared [src]

Try to lock the mutex, and return true if it's the case.

func tryLockShared(using self)->bool

func RWLock.unlock [src]

func unlock(using self)

func RWLock.unlockExclusive [src]

Unlock mutex.

func unlockExclusive(using self)

func RWLock.unlockShared [src]

Unlock mutex.

func unlockShared(using self)

func Sync.scopedLock [src]

#[Swag.Macro] func(T) scopedLock(syncObj: *T)

func Sync.sharedLock [src]

#[Swag.Macro] func(T) sharedLock(syncObj: *T)

namespace Core.System

Functions

pushContext Push a new execution context for the given block of code.

func System.pushContext [src]

Push a new execution context for the given block of code.

#[Swag.Macro] func pushContext(cxt: Swag.Context, stmt: code)

namespace Core.Threading

Structs

Thread

Enums

ThreadPriority

Functions

wait Wait multiple threads.

struct Threading.Thread [src]

userLambda func(Threading.Thread)
context Swag.Context
userParam *void
priority Threading.ThreadPriority
handle Threading.ThreadHandle
id u32
requestEnd bool

Functions

init Initialize a thread in pause state.
isDone Returns true if the thread has finished.
isValid Returns true if the thread is valid.
safeForceEnd Force the thread to safely exist User code needs to check for requestEnd.
setPriority Set the thread priority.
sleep Sleep the current thread for a given amount of milliseconds.
start Resume the given thread, if it was paused.
wait Wait for the given thread to be done, and close it After that call, isValid() will return false.
yield Sleep the current thread for a given amount of milliseconds.

Special Functions

opDrop

func Thread.init [src]

Initialize a thread in pause state.

func init(using self, lambda: func||(Thread), userParam: *void = null, priority = ThreadPriority.Normal, tempAllocSize: s32 = -1) throw

func Thread.isDone [src]

Returns true if the thread has finished.

func isDone(using self)->bool

func Thread.isValid [src]

Returns true if the thread is valid.

func isValid(using const self)->bool

func Thread.opDrop [src]

func opDrop(using self)

func Thread.safeForceEnd [src]

Force the thread to safely exist User code needs to check for requestEnd.

func safeForceEnd(using self)

func Thread.setPriority [src]

Set the thread priority.

func setPriority(using self, priority: ThreadPriority) throw

func Thread.sleep [src]

Sleep the current thread for a given amount of milliseconds.

func sleep(ms: Time.Duration)

func Thread.start [src]

Resume the given thread, if it was paused.

func start(using self) throw

func Thread.wait [src]

Wait for the given thread to be done, and close it After that call, isValid() will return false.

func wait(using self)

func Thread.yield [src]

Sleep the current thread for a given amount of milliseconds.

func yield()

enum Threading.ThreadPriority [src]

Lowest
BelowNormal
Normal
AboveNormal
Highest

func Threading.wait [src]

Wait multiple threads.

func wait(threads: *Thread...)

namespace Core.Time

Structs

DateTime Represents an instant in time, typically expressed as a date and time of day.
Duration Represents a delay, expressed in seconds.
FrameTiming
Stopwatch Provides a set of methods and properties that you can use to accurately measure elapsed time.
TimeSpan Represents an interval of time, stored as a 64 bits integer.
Timer

Enums

DateTimeFormat
DayOfWeek

Functions

dateToTicks Convert a date to a 64 bits value.
daysInMonth Returns the number of days of the given month, for the given year.
isLeapYear Returns true if the given year is a leap year.
nowMicroseconds Returns the current time expressed in microseconds.
nowMilliseconds Returns the current time expressed in milliseconds.
nowPrecise Get current time precise value.
preciseFrequency The frequency of the precise counter, in ticks per second.
ticksToDate Convert a 64 bits value to a date.
ticksToTime Convert a 64 bits tick value to a time.
timeToTicks Convert a time to a 64 bits value.

struct Time.DateTime [src]

Represents an instant in time, typically expressed as a date and time of day.

year u16
month u16
day u16
hour u16
minute u16
second u16
millisecond u16

Functions

dayOfWeek Returns the day of week of the current date.
dayOfWeekName Returns the day of week name.
isValid Returns true if this is a valid datatime.
monthName Returns the month name.
now Returns a DateTime containing the current date and time.
parse Convert a string to a DateTime with the given format.
setNow Initialize the structure with the current local date and time.
toString Convert to string.

Special Functions

opCmp
opEquals

func IConvert.convert [src]

Used when printing a date with Core.Format.toString.

func convert(using self, buf: *ConcatBuffer, convFormat: StrConv.ConvertFormat, strFormat: string)
a DateTimeFormat.DateTime
b DateTimeFormat.DateTimeMs
c DateTimeFormat.DateTimeIso
d DateTimeFormat.DateTimeIsoMs
e DateTimeFormat.DateTimeIsoHM
f DateTimeFormat.DateIso
g DateTimeFormat.TimeIso
h DateTimeFormat.TimeIsoMs
i DateTimeFormat.TimeIsoHM
j DateTimeFormat.Date'

'swag let myDate = DateTime.now() Console.print(Format.toString("%{a}", myDate))

See [[Core.Time.DateTimeFormat]]

func ISerialize.postRead [src]

func postRead(using self, data: *void, decoder: Serialization.IDecoder) throw

func ISerialize.read [src]

func read(using self, decoder: Serialization.IDecoder)->bool throw

func ISerialize.readElement [src]

func readElement(using self, type: Swag.TypeValue, data: *void, decoder: Serialization.IDecoder)->bool throw

func ISerialize.write [src]

func write(using self, encoder: Serialization.IEncoder)->bool throw

func ISerialize.writeElement [src]

func writeElement(using self, type: Swag.TypeValue, data: const *void, decoder: Serialization.IEncoder)->bool throw

func DateTime.dayOfWeek [src]

Returns the day of week of the current date.

func dayOfWeek(using const self)->Time.DayOfWeek

func DateTime.dayOfWeekName [src]

Returns the day of week name.

func dayOfWeekName(day: DayOfWeek)->string

func DateTime.isValid [src]

Returns true if this is a valid datatime.

func isValid(using const self)->bool

func DateTime.monthName [src]

Returns the month name.

func monthName(month: u16)->string

func DateTime.now [src]

Returns a DateTime containing the current date and time.

func now()->Time.DateTime

func DateTime.opCmp [src]

func opCmp(using const self, other: DateTime)->s32

func DateTime.opEquals [src]

func opEquals(using const self, other: Self)->bool

func DateTime.parse [src]

Convert a string to a DateTime with the given format.

func parse(str: string, checkDate = true)->{value:Time.DateTime,eat:u32} throw

func DateTime.setNow [src]

Initialize the structure with the current local date and time.

func setNow(using self)

func DateTime.toString [src]

Convert to string.

func toString(using self, fmt = DateTimeFormat.DateTime)->String

enum Time.DateTimeFormat [src]

DateIso YYYY-MM-DD.
TimeIso HH:MM:SS.
TimeIsoMs HH:MM:SS.ZZZ.
TimeIsoHM HH:MM.
Date DAYOFWEEK MONTH DAY YYYY.
DateTime DAYOFWEEK MONTH DAY YYYY HH:MM:SS.
DateTimeMs DAYOFWEEK MONTH DAY YYYY HH:MM:SS.ZZZ.
DateTimeIso YYYY-MM-DD HH:MM:SS.
DateTimeIsoMs YYYY-MM-DD HH:MM:SS.ZZZ.
DateTimeIsoHM YYYY-MM-DD HH:MM.

enum Time.DayOfWeek [src]

Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday

struct Time.Duration [src]

Represents a delay, expressed in seconds.

timeInSeconds f32 The duration in seconds.

Functions

fromMs Returns a duration initialized with milliseconds.
toMs Returns the value in milliseconds.

Special Functions

opAffect
opAffectLiteral

func Duration.fromMs [src]

Returns a duration initialized with milliseconds.

func fromMs(valueMs: u32)->Time.Duration

func Duration.opAffect [src]

func opAffect(using self, valueMs: s32)

func Duration.opAffectLiteral [src]

func(suffix: string) opAffectLiteral(using self, value: s32)

func Duration.toMs [src]

Returns the value in milliseconds.

func toMs(using const self)->u32

struct Time.FrameTiming [src]

dtMin f32
dtMax f32
dt f32 Current delta time, in seconds.
frameCount u32 Frame counter.
prevTick u64
paused bool

Functions

pause Pause frame timing & count.
unpause Unpause frame timing & count.
update Update frame timers.

func FrameTiming.pause [src]

Pause frame timing & count.

func pause(using self)

func FrameTiming.unpause [src]

Unpause frame timing & count.

func unpause(using self)

func FrameTiming.update [src]

Update frame timers.

func update(using self)

struct Time.Stopwatch [src]

Provides a set of methods and properties that you can use to accurately measure elapsed time.

isStarted bool
startTimeStamp u64
elapsedTicks u64

Functions

elapsedMicroseconds Gets the total elapsed time in microseconds, after a call to stop.
elapsedMicrosecondsNow Gets the current elapsed time in milliseconds since the start.
elapsedMilliseconds Gets the total elapsed time in milliseconds, after a call to stop.
elapsedMillisecondsNow Gets the current elapsed time in milliseconds since the start.
reset Stops time interval measurement and resets the elapsed time to zero.
restart Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.
scopeMeasure Measure until the end of the scope, and print the result in the console.
start Starts, or resumes, measuring elapsed time for an interval.
stop Stops measuring elapsed time for an interval.

func Stopwatch.elapsedMicroseconds [src]

Gets the total elapsed time in microseconds, after a call to stop.

func elapsedMicroseconds(using self)->u32

func Stopwatch.elapsedMicrosecondsNow [src]

Gets the current elapsed time in milliseconds since the start.

func elapsedMicrosecondsNow(using self)->u32

func Stopwatch.elapsedMilliseconds [src]

Gets the total elapsed time in milliseconds, after a call to stop.

func elapsedMilliseconds(using self)->u32

func Stopwatch.elapsedMillisecondsNow [src]

Gets the current elapsed time in milliseconds since the start.

func elapsedMillisecondsNow(using self)->u32

func Stopwatch.reset [src]

Stops time interval measurement and resets the elapsed time to zero.

func reset(using self)

func Stopwatch.restart [src]

Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.

func restart(using self)

func Stopwatch.scopeMeasure [src]

Measure until the end of the scope, and print the result in the console.

#[Swag.Macro] func scopeMeasure(name: string = "stopwatch")

func Stopwatch.start [src]

Starts, or resumes, measuring elapsed time for an interval.

func start(using self)

func Stopwatch.stop [src]

Stops measuring elapsed time for an interval.

func stop(using self)

struct Time.TimeSpan [src]

Represents an interval of time, stored as a 64 bits integer.

ticks Time.Ticks

Functions

addDays Add or remove the given amount of days to the TimeSpan.
addHours Add or remove the given amount of hours to the TimeSpan.
addMilliSeconds Add or remove the given amount of minutes to the TimeSpan.
addMinutes Add or remove the given amount of minutes to the TimeSpan.
addMonths Add or remove the given amount of months to the TimeSpan.
addSeconds Add or remove the given amount of minutes to the TimeSpan.
addYears Add or remove the given amount of years to the TimeSpan.
from Creates a TimeSpan with the given DateTime.
now Returns the current date and time.
setNow Initialize the TimeSpan with the current date and time.
toDateTime Converts a TimeSpan to a DateTime.
totalDays
totalHours
totalMilliSeconds
totalMinutes
totalSeconds

Special Functions

opCmp

func TimeSpan.addDays [src]

Add or remove the given amount of days to the TimeSpan.

func addDays(using self, days: s32)

func TimeSpan.addHours [src]

Add or remove the given amount of hours to the TimeSpan.

func addHours(using self, hours: s32)

func TimeSpan.addMilliSeconds [src]

Add or remove the given amount of minutes to the TimeSpan.

func addMilliSeconds(using self, milliSeconds: s32)

func TimeSpan.addMinutes [src]

Add or remove the given amount of minutes to the TimeSpan.

func addMinutes(using self, minutes: s32)

func TimeSpan.addMonths [src]

Add or remove the given amount of months to the TimeSpan.

func addMonths(using self, months: s32)

func TimeSpan.addSeconds [src]

Add or remove the given amount of minutes to the TimeSpan.

func addSeconds(using self, seconds: s32)

func TimeSpan.addYears [src]

Add or remove the given amount of years to the TimeSpan.

func addYears(using self, years: s32)

func TimeSpan.from [src]

Creates a TimeSpan with the given DateTime.

func from(dateTime: DateTime)->Time.TimeSpan

func TimeSpan.now [src]

Returns the current date and time.

func now()->Time.TimeSpan

func TimeSpan.opCmp [src]

func opCmp(using self, other: Self)->s32

func TimeSpan.setNow [src]

Initialize the TimeSpan with the current date and time.

func setNow(using self)

func TimeSpan.toDateTime [src]

Converts a TimeSpan to a DateTime.

func toDateTime(using self)->Time.DateTime

func TimeSpan.totalDays [src]

func totalDays(using self)->f64

func TimeSpan.totalHours [src]

func totalHours(using self)->f64

func TimeSpan.totalMilliSeconds [src]

func totalMilliSeconds(using self)->f64

func TimeSpan.totalMinutes [src]

func totalMinutes(using self)->f64

func TimeSpan.totalSeconds [src]

func totalSeconds(using self)->f64

struct Time.Timer [src]

userLambda func(Time.Timer)
handle Time.TimerHandle
context Swag.Context

Functions

create Creates a new timer.
init Initialize timer.
release Release the timer.

func Timer.create [src]

Creates a new timer.

func create(elapsedTimeMs: u32, lambda: func(Timer), periodic = false)->Time.Timer throw

func Timer.init [src]

Initialize timer.

func init(using self, elapsedTimeMs: u32, lambda: func(Timer), periodic = false) throw

func Timer.release [src]

Release the timer.

func release(using self)

func Time.dateToTicks [src]

Convert a date to a 64 bits value.

func dateToTicks(year, month, day: u16)->Time.Ticks

func Time.daysInMonth [src]

Returns the number of days of the given month, for the given year.

func daysInMonth(year, month: u16)->u16

func Time.isLeapYear [src]

Returns true if the given year is a leap year.

func isLeapYear(year: u16)->bool

func Time.nowMicroseconds [src]

Returns the current time expressed in microseconds.

func nowMicroseconds()->u32

func Time.nowMilliseconds [src]

Returns the current time expressed in milliseconds.

func nowMilliseconds()->u32

func Time.nowPrecise [src]

Get current time precise value.

func nowPrecise()->u64

func Time.preciseFrequency [src]

The frequency of the precise counter, in ticks per second.

func preciseFrequency()->u64

func Time.ticksToDate [src]

Convert a 64 bits value to a date.

func ticksToDate(ticks: Ticks)->{year:u16,month:u16,day:u16}

func Time.ticksToTime [src]

Convert a 64 bits tick value to a time.

func ticksToTime(ticks: Ticks)->{hour:u16,minute:u16,second:u16,millisecond:u16}

func Time.timeToTicks [src]

Convert a time to a 64 bits value.

func timeToTicks(hour, minute, second, millisecond: u16)->Time.Ticks

namespace Core.Tokenize

Functions

eatCount Eat count bytes, and returns the remaining string.
eatQuotes Remove "".
eatSpaces Eat all spaces, and returns the remaining string (trim left).
getTo Returns a sub string starting at startByteIndex and ending with delimiter.
getToSpace Returns the first substring of str stopping at the first blank character.
getWhileAlnum Returns the first substring of str containing only digits and letters.
split(string, rune, u32, bool) Split string into sub strings, given a rune separator Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.
split(string, string, u32, bool) Split string into sub strings, given a string separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
split(string, u8, u32, bool) Split string into sub strings, given a byte separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
splitAny Split string into sub strings, given an array of rune separators Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
splitLines Split the string into an array of lines Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.

func Tokenize.eatCount [src]

Eat count bytes, and returns the remaining string.

func eatCount(str: string, count: u64)->string

func Tokenize.eatQuotes [src]

Remove "".

func eatQuotes(str: string)->string

func Tokenize.eatSpaces [src]

Eat all spaces, and returns the remaining string (trim left).

func eatSpaces(str: string)->string

func Tokenize.getTo [src]

Returns a sub string starting at startByteIndex and ending with delimiter.

func getTo(src: string, delimiter: u8, startByteIndex = 0'u64, includeDelimiter = true)->string

func Tokenize.getToSpace [src]

Returns the first substring of str stopping at the first blank character.

func getToSpace(str: string)->string

func Tokenize.getWhileAlnum [src]

Returns the first substring of str containing only digits and letters.

func getWhileAlnum(str: string)->string

func Tokenize.split [src]

Split string into sub strings, given a byte separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.

func split(src: string, separator: u8, maxSplit: u32 = 0, removeEmpty = true)->Array'(string)

Split string into sub strings, given a string separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.

func split(src: string, separator: string, maxSplit: u32 = 0, removeEmpty = true)->Array'(string)

Split string into sub strings, given a rune separator Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.

func split(src: string, separator: rune, maxSplit: u32 = 0, removeEmpty = true)->Array'(string)

func Tokenize.splitAny [src]

Split string into sub strings, given an array of rune separators Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.

func splitAny(src: string, separators: const [..] rune, maxSplit: u32 = 0, removeEmpty = true)->Array'(string)

func Tokenize.splitLines [src]

Split the string into an array of lines Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.

func splitLines(src: string)->Array'(string)

struct Core.UUID [src]

using uuid {val8:[16] u8,val64:[2] u64}

Functions

clear Clear id.
getRandom Get a version 4 UUID (random).
toString(self) Convert uuid to a string.
toString(self, [..] u8) Convert uuid to a string of the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx.

Special Functions

opEquals

func IConvert.convert [src]

func convert(using self, buf: *ConcatBuffer, convFmt: StrConv.ConvertFormat, strFormat: string)

func IHash32.compute [src]

func compute(using const self)->u32

func UUID.clear [src]

Clear id.

func clear(using self)

func UUID.getRandom [src]

Get a version 4 UUID (random).

func getRandom()->UUID

func UUID.opEquals [src]

func opEquals(using self, other: Self)->bool

func UUID.toString [src]

Convert uuid to a string of the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx.

func toString(using self, result: [..] u8)

Convert uuid to a string.

func toString(using self)->String

namespace Core.Unicode

Functions

fromUtf8([..] rune, const [..] u8) Convert an utf8 buffer to a character sequence, and returns the number of valid elements in the destination buffer.
fromUtf8(const [..] u8) Convert an utf8 buffer to a character sequence.
isAscii
isControl
isDigit
isLatin1
isLetter
isLetterOrDigit
isLower
isNumber
isSpace
isSymbol
isSymbolMath
isTitle
isUpper
isWord
makeLower Make a rune buffer lower case.
makeUpper Make a rune buffer upper case.
toLower
toTitle
toUpper

func Unicode.fromUtf8 [src]

Convert an utf8 buffer to a character sequence, and returns the number of valid elements in the destination buffer.

func fromUtf8(dest: [..] rune, src: const [..] u8)->u32

Convert an utf8 buffer to a character sequence.

func fromUtf8(src: const [..] u8)->Array'(rune)

func Unicode.isAscii [src]

func isAscii(c: rune)->bool

func Unicode.isControl [src]

func isControl(c: rune)->bool

func Unicode.isDigit [src]

func isDigit(c: rune)->bool

func Unicode.isLatin1 [src]

func isLatin1(c: rune)->bool

func Unicode.isLetter [src]

func isLetter(c: rune)->bool

func Unicode.isLetterOrDigit [src]

func isLetterOrDigit(c: rune)->bool

func Unicode.isLower [src]

func isLower(c: rune)->bool

func Unicode.isNumber [src]

func isNumber(c: rune)->bool

func Unicode.isSpace [src]

func isSpace(c: rune)->bool

func Unicode.isSymbol [src]

func isSymbol(c: rune)->bool

func Unicode.isSymbolMath [src]

func isSymbolMath(c: rune)->bool

func Unicode.isTitle [src]

func isTitle(c: rune)->bool

func Unicode.isUpper [src]

func isUpper(c: rune)->bool

func Unicode.isWord [src]

func isWord(c: rune)->bool

func Unicode.makeLower [src]

Make a rune buffer lower case.

func makeLower(buffer: [..] rune)

func Unicode.makeUpper [src]

Make a rune buffer upper case.

func makeUpper(buffer: [..] rune)

func Unicode.toLower [src]

func toLower(c: rune)->rune

func Unicode.toTitle [src]

func toTitle(c: rune)->rune

func Unicode.toUpper [src]

func toUpper(c: rune)->rune

namespace Core.Utf16

Functions

decodeRune Get the unicode character pointed by buffer, and the number of u16 to encode it Will return RuneError for an invalid utf16 sequence.
encodeRune Convert unicode character src to an utf16 sequence, and returns the number of u16 that were needed to make the conversion. dest must be at least 2 u16 long.
fromUnicode([..] u16, const [..] rune) Convert a character array (32 bits unicode) to an utf16 buffer Returns the number of bytes written in the destination buffer dest must be at least 2 bytes long.
fromUnicode(const [..] rune) Convert a character array (32 bits unicode) to an utf16 sequence.
fromUtf8([..] u16, const [..] u8) Convert an utf8 buffer to a utf16 buffer, and returns the number of valid elements in the destination buffer.
fromUtf8(const [..] u8) Convert an utf8 buffer to an utf16 sequence.
lengthZeroTerminated Compute the string length of a zero terminated utf16 buffer.
toZeroTerminated Convert string to an utf16 array, zero terminated.

func Utf16.decodeRune [src]

Get the unicode character pointed by buffer, and the number of u16 to encode it Will return RuneError for an invalid utf16 sequence.

func decodeRune(buffer: const [..] u16)->{c:rune,eat:u32}

func Utf16.encodeRune [src]

Convert unicode character src to an utf16 sequence, and returns the number of u16 that were needed to make the conversion. dest must be at least 2 u16 long.

func encodeRune(dest: [..] u16, src: rune)->u32

func Utf16.fromUnicode [src]

Convert a character array (32 bits unicode) to an utf16 buffer Returns the number of bytes written in the destination buffer dest must be at least 2 bytes long.

func fromUnicode(dest: [..] u16, src: const [..] rune)->u64

Convert a character array (32 bits unicode) to an utf16 sequence.

func fromUnicode(src: const [..] rune)->Array'(u16)

func Utf16.fromUtf8 [src]

Convert an utf8 buffer to a utf16 buffer, and returns the number of valid elements in the destination buffer.

func fromUtf8(dest: [..] u16, src: const [..] u8)->u64

Convert an utf8 buffer to an utf16 sequence.

func fromUtf8(src: const [..] u8)->Array'(u16)

func Utf16.lengthZeroTerminated [src]

Compute the string length of a zero terminated utf16 buffer.

func lengthZeroTerminated(buf: const ^u16)->u64

func Utf16.toZeroTerminated [src]

Convert string to an utf16 array, zero terminated.

func toZeroTerminated(src: string)->Array'(u16)

namespace Core.Utf8

Enums

ComparisonType

Functions

beautifyName
byteIndex Returns the byte index of the given rune index.
compare Compare two utf8 buffers with the given algorithm.
contains(const [..] u8, const [..] u8) Returns true if src contains the slice what.
contains(const [..] u8, rune) Returns true if src contains the string what.
contains(const [..] u8, string) Returns true if src contains the string what.
contains(const [..] u8, u8) Returns true if src contains the string what.
countBytesAt Returns the number of bytes to encode the first rune of the utf8 buffer.
countRunes Returns the number of runes in an utf8 buffer.
decodeLastRune Get the last unicode rune of the utf8 slice, and the number of bytes to encode it.
decodeRune Get the unicode rune pointed by buffer, and the number of bytes to encode it.
encodeRune Convert rune src to an utf8 sequence, and returns the number of bytes that were needed to make the conversion.
endsWith Return true if the string ends with str.
firstRune Returns the first rune of the slice.
fromUnicode([..] u8, const [..] rune) Convert a rune array to an utf8 buffer.
fromUnicode(const [..] rune) Convert an unicode buffer to a String.
fromUtf16([..] u8, const [..] u16) Convert an utf16 array to an utf8 buffer.
fromUtf16(const [..] u16) Convert an utf16 buffer to a String.
indexOf(const [..] u8, rune, u64) Find the first occurence of rune what, and returns the byte index of it.
indexOf(const [..] u8, string, u64, ComparisonType) Find the given string, and returns the byte index of it.
indexOfAny(const [..] u8, const [..] rune, u64) Find one of the runes in what, and returns the byte index of it.
indexOfAny(const [..] u8, const [..] u8, u64) Find one of the runes in what, and returns the byte index of it.
isValid Returns true if the utf8 sequence is valid.
isValidRune Returns true if the given unicode rune can be encoded in utf8.
lastIndexOf(const [..] u8, rune) Find the last rune occurence of what, and returns the byte index of it.
lastIndexOf(const [..] u8, string, ComparisonType) Returns the last index (in bytes) of a string.
lastIndexOfAny(const [..] u8, const [..] rune) Returns the last index (in bytes) of a any of the runes in what.
lastIndexOfAny(const [..] u8, const [..] u8) Returns the last index (in bytes) of a any of the bytes in what.
lastRune Returns the last rune of the slice.
startsWith Return true if the string starts with str.
visitRunes Macro to foreach the unicode characters of the utf8 sequence.

enum Utf8.ComparisonType [src]

Latin1
Latin1NoCase
Unicode
UnicodeNoCase

func Utf8.beautifyName [src]

func beautifyName(name: const [..] u8)->String

func Utf8.byteIndex [src]

Returns the byte index of the given rune index.

func byteIndex(buffer: const [..] u8, charIndex: u64)->{index:u64,success:bool}

func Utf8.compare [src]

Compare two utf8 buffers with the given algorithm.

func compare(src, dst: const [..] u8, comparisonType = ComparisonType.Latin1)->s32

func Utf8.contains [src]

Returns true if src contains the string what.

func contains(src: const [..] u8, what: string)->bool func contains(src: const [..] u8, what: rune)->bool func contains(src: const [..] u8, what: u8)->bool

Returns true if src contains the slice what.

func contains(src, what: const [..] u8)->bool

func Utf8.countBytesAt [src]

Returns the number of bytes to encode the first rune of the utf8 buffer.

func countBytesAt(buffer: const [..] u8)->u32

If it's an invalid encoding, returns 1.

func Utf8.countRunes [src]

Returns the number of runes in an utf8 buffer.

func countRunes(buffer: const [..] u8)->u64

func Utf8.decodeLastRune [src]

Get the last unicode rune of the utf8 slice, and the number of bytes to encode it.

func decodeLastRune(buffer: const [..] u8)->{c:rune,eat:u32}

func Utf8.decodeRune [src]

Get the unicode rune pointed by buffer, and the number of bytes to encode it.

func decodeRune(buffer: const [..] u8)->{c:rune,eat:u32}

Will return RuneError for an invalid utf8 sequence

func Utf8.encodeRune [src]

Convert rune src to an utf8 sequence, and returns the number of bytes that were needed to make the conversion.

func encodeRune(dest: [..] u8, src: rune)->u32

dest must be at least 4 bytes long

func Utf8.endsWith [src]

Return true if the string ends with str.

func endsWith(src: const [..] u8, str: string, comparisonType = ComparisonType.Latin1)->bool

func Utf8.firstRune [src]

Returns the first rune of the slice.

func firstRune(src: const [..] u8)->rune

func Utf8.fromUnicode [src]

Convert a rune array to an utf8 buffer.

func fromUnicode(dest: [..] u8, src: const [..] rune)->u64

Returns the number of bytes written in the destination buffer dest must be at least 4 bytes long

Convert an unicode buffer to a String.

func fromUnicode(src: const [..] rune)->String

func Utf8.fromUtf16 [src]

Convert an utf16 array to an utf8 buffer.

func fromUtf16(dest: [..] u8, src: const [..] u16)->u64

Returns the number of bytes written in the destination buffer. dest must be at least 4 bytes long

Convert an utf16 buffer to a String.

func fromUtf16(src: const [..] u16)->String

func Utf8.indexOf [src]

Find the first occurence of rune what, and returns the byte index of it.

func indexOf(src: const [..] u8, what: rune, startByteIndex = 0'u64)->u64

Returns Swag.U64.Max if not found

Find the given string, and returns the byte index of it.

func indexOf(src: const [..] u8, what: string, startByteIndex = 0'u64, comparisonType = ComparisonType.Latin1)->u64

func Utf8.indexOfAny [src]

Find one of the runes in what, and returns the byte index of it.

func indexOfAny(src: const [..] u8, what: const [..] u8, startByteIndex = 0'u64)->u64

Returns Swag.U64.Max if not found

Find one of the runes in what, and returns the byte index of it.

func indexOfAny(src: const [..] u8, what: const [..] rune, startByteIndex = 0'u64)->u64

func Utf8.isValid [src]

Returns true if the utf8 sequence is valid.

func isValid(buffer: const [..] u8)->bool

func Utf8.isValidRune [src]

Returns true if the given unicode rune can be encoded in utf8.

func isValidRune(c: rune)->bool

func Utf8.lastIndexOf [src]

Find the last rune occurence of what, and returns the byte index of it.

func lastIndexOf(src: const [..] u8, what: rune)->u64

Returns Swag.U64.Max if not found

Returns the last index (in bytes) of a string.

func lastIndexOf(src: const [..] u8, what: string, comparisonType = ComparisonType.Latin1)->u64

Returns Swag.U64.Max if not found

func Utf8.lastIndexOfAny [src]

Returns the last index (in bytes) of a any of the runes in what.

func lastIndexOfAny(src: const [..] u8, what: const [..] rune)->u64

Returns Swag.U64.Max if not found

Returns the last index (in bytes) of a any of the bytes in what.

func lastIndexOfAny(src: const [..] u8, what: const [..] u8)->u64

Returns Swag.U64.Max if not found

func Utf8.lastRune [src]

Returns the last rune of the slice.

func lastRune(src: const [..] u8)->rune

func Utf8.startsWith [src]

Return true if the string starts with str.

func startsWith(src: const [..] u8, str: string, comparisonType = ComparisonType.Latin1)->bool

func Utf8.visitRunes [src]

Macro to foreach the unicode characters of the utf8 sequence.

#[Swag.Macro] func visitRunes(buffer: const [..] u8, stmt: code)
  • #alias0 will contain the character
  • #alias1 will contain the character index
  • #alias2 will contain the byte index of that character within the utf8 sequence

func Core.add [src]

func(T) add(flags: &T, value: T)

func Core.equals [src]

func(T) equals(flags, value: T)->bool

func Core.has [src]

func(T) has(flags, value: T)->bool

func Core.orderMaxMin [src]

Be sure that a is geater or equal than b.

func(T) orderMaxMin(x, y: *T)

func Core.orderMinMax [src]

Be sure that a is lower or equal than b.

func(T) orderMinMax(x, y: *T)

func Core.remove [src]

func(T) remove(flags: &T, value: T)

func Core.set [src]

func(T) set(flags: &T, value: T)

func Core.swap [src]

Swap two values.

func(T) swap(x, y: *T)

func Core.toggle [src]

func(T) toggle(flags: &T, value: T)
Generated on 08-09-2024 with swag 0.40.0