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.
const Core.Constants | [src] |
ASSERT | bool | |
BIG_ENDIAN | bool | |
EndLine | string | |
CharProperties | const [256] Latin1.CharAttribute | |
AltDirectorySeparatorChar | u8 | Alternate directory separator character. |
DirectorySeparatorChar | u8 | Default directory separator character. |
VolumeSeparatorChar | u8 | Volume separator character (e.g., C:). |
NN | s32 | |
TagBinVersion | u32 | |
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 | |
Buffer | Serialization.Read.Buffer | |
ThreadHandle | Threading.ThreadHandle | |
Ticks | Time.Ticks | |
TimerHandle | Time.TimerHandle |
struct Core.Array | [src] |
A generic, dynamic array that can hold elements of any type.
allocator | Swag.IAllocator | The allocator used for memory operations. |
buffer | [*] Array.T | Pointer to the contiguous memory block holding the elements. |
count | u64 | The number of valid elements currently in the array. |
capacity | u64 | The total number of elements that can be stored in the allocated me.buffer. |
It automatically manages memory and grows as needed.
add(me, &&T) | Moves an element to the end of the array. |
add(me, T) | Adds a copy of an element to the end of the array. |
add(me, const [..] T) | Appends all elements from a slice to the end of the array. |
addOnce | Adds an element to the end of the array, but only if it's not already present. |
back | Returns a copy of the last element of the array. |
backPtr | Returns a pointer to the last element of the array. |
clear | Removes all elements from the array, setting its me.count to 0. |
contains | Returns true if the array contains the given value. |
createBuffer | Creates a new byte array of a given size. |
createTemp | Creates a new array that uses the temporary allocator. |
emplaceAddress | Reserves space for num elements at the end of the array and returns a pointer to the start of the new space. |
emplaceAt | Moves elements from a slice at a specific index, shifting existing elements to the right. |
emplaceInitAddress | Reserves space for num elements at the end of the array and returns a pointer to the start of the new space. |
fill | Fills the entire array with the given value. |
free | Frees the array's memory and resets its state. |
front | Returns a copy of the first element of the array. |
frontPtr | Returns a pointer to the first element of the array. |
grow | Ensures the array has enough capacity to store at least newCount elements. |
growResize | Ensures the array contains at least newCount elements. |
insertAt(me, u64, &&T) | Inserts a moved value at a specific index, shifting existing elements to the right. |
insertAt(me, u64, T) | Inserts a copy of a value at a specific index, shifting existing elements to the right. |
insertAt(me, u64, const [..] T) | Inserts elements from a slice at a specific index, shifting existing elements to the right. |
isEmpty | Returns true if the array contains no elements. |
popBack | Removes the last element from the array and returns it. |
realloc | Reallocates the internal me.buffer to a new capacity. |
ref1 | Returns a mutable reference to an element using a single coordinate. |
ref2 | Returns a mutable reference to an element using 2D coordinates and a width. |
remove(me, V) | Removes the first occurrence of a given value from the array. |
remove(me, u64, u64) | Removes a specified number of elements starting from a given index. |
removeAt | Removes the element at a given index by swapping it with the last element. |
removeAtOrdered | Removes one or more elements at a given index, shifting subsequent elements to the left. |
removeBack | Removes the last element from the array. |
removeOrdered | Removes the first occurrence of a given value, preserving the order of remaining elements. |
reserve | Sets the array's capacity to at least newCapacity. |
resize | Changes the number of elements in the array to newCount. |
sort(me) | Sorts the array in ascending order using the default comparison operator. |
sort(me, func(*void, T, T)->s32) | Sorts the array using a custom comparison function. |
sortReverse | Sorts the array in descending order. |
swap | Swaps two elements in the array by their indices. |
toSlice(me) | Returns a mutable slice containing all elements of the array. |
toSlice(me) | Returns an immutable slice containing all elements of the array. |
opAffect | Replaces the content of the array with elements copied from a slice. |
opCast(me) | Allows the array to be implicitly cast to a mutable slice. |
opCast(me) | Allows the array to be implicitly cast to an immutable slice. |
opCount | Returns the number of elements in the array. |
opData | Returns a raw, constant pointer to the array's me.buffer. |
opDrop | Ensures the allocated memory is freed when the array goes out of scope. |
opIndex(me, u64) | Returns a mutable reference to the element at the specified index. |
opIndex(me, u64) | Returns a constant reference to the element at the specified index. |
opIndexAffect | Assigns a new value to the element at the specified index. |
opIndexAssign | Handles compound assignment operators (e.g., +=, -=) for elements. |
opPostCopy | Handles the deep copy of the array when it is copied. |
opSlice | Creates a slice from a sub-part of the array. |
opVisit | Provides a way to iterate over each element in the array. |
func IConvert.convert | [src] |
func Array.add | [src] |
Adds a copy of an element to the end of the array.
Moves an element to the end of the array.
Appends all elements from a slice to the end of the array.
func Array.addOnce | [src] |
Adds an element to the end of the array, but only if it's not already present.
This is slower than add due to the containment check.
func Array.back | [src] |
Returns a copy of the last element of the array.
Asserts if the array is empty.
func Array.backPtr | [src] |
Returns a pointer to the last element of the array.
Asserts if the array is empty.
func Array.clear | [src] |
Removes all elements from the array, setting its me.count to 0.
This calls the destructor for each element if one exists, but does not deallocate memory.
func Array.contains | [src] |
Returns true if the array contains the given value.
func Array.createBuffer | [src] |
Creates a new byte array of a given size.
Often used for raw memory me.buffers.
func Array.createTemp | [src] |
Creates a new array that uses the temporary allocator.
Useful for short-lived arrays to avoid heap fragmentation.
func Array.emplaceAddress | [src] |
Reserves space for num elements at the end of the array and returns a pointer to the start of the new space.
The new memory is not initialized.
func Array.emplaceAt | [src] |
Moves elements from a slice at a specific index, shifting existing elements to the right.
Order is preserved.
func Array.emplaceInitAddress | [src] |
Reserves space for num elements at the end of the array and returns a pointer to the start of the new space.
The new memory is default-initialized.
func Array.fill | [src] |
Fills the entire array with the given value.
All existing elements are overwritten.
func Array.free | [src] |
Frees the array's memory and resets its state.
If elements have destructors, they are called.
func Array.front | [src] |
Returns a copy of the first element of the array.
Asserts if the array is empty.
func Array.frontPtr | [src] |
Returns a pointer to the first element of the array.
Asserts if the array is empty.
func Array.grow | [src] |
Ensures the array has enough capacity to store at least newCount elements.
If the current capacity is insufficient, it will be increased. The element me.count remains unchanged. See also [[reserve]].
func Array.growResize | [src] |
Ensures the array contains at least newCount elements.
If the current me.count is less than newCount, new elements are added and default-initialized.
func Array.insertAt | [src] |
Inserts a copy of a value at a specific index, shifting existing elements to the right.
Order is preserved.
Inserts a moved value at a specific index, shifting existing elements to the right.
Order is preserved.
Inserts elements from a slice at a specific index, shifting existing elements to the right.
Order is preserved.
func Array.isEmpty | [src] |
Returns true if the array contains no elements.
func Array.opAffect | [src] |
Replaces the content of the array with elements copied from a slice.
func Array.opCast | [src] |
Allows the array to be implicitly cast to a mutable slice.
Allows the array to be implicitly cast to an immutable slice.
func Array.opCount | [src] |
Returns the number of elements in the array.
func Array.opData | [src] |
Returns a raw, constant pointer to the array's me.buffer.
func Array.opDrop | [src] |
Ensures the allocated memory is freed when the array goes out of scope.
func Array.opIndex | [src] |
Returns a constant reference to the element at the specified index.
Returns a mutable reference to the element at the specified index.
func Array.opIndexAffect | [src] |
Assigns a new value to the element at the specified index.
func Array.opIndexAssign | [src] |
Handles compound assignment operators (e.g., +=, -=) for elements.
func Array.opPostCopy | [src] |
Handles the deep copy of the array when it is copied.
A new me.buffer is allocated and the content is copied over.
func Array.opSlice | [src] |
Creates a slice from a sub-part of the array.
func Array.opVisit | [src] |
Provides a way to iterate over each element in the array.
This is a macro that accepts a code block to execute for each element. Visiting by address and in reverse order is supported via parameters. Aliases: #alias0 for the element or a pointer to it, #alias1 for the index.
func Array.popBack | [src] |
Removes the last element from the array and returns it.
Asserts if the array is empty.
func Array.realloc | [src] |
Reallocates the internal me.buffer to a new capacity.
This is a low-level memory operation that handles moving existing elements.
func Array.ref1 | [src] |
Returns a mutable reference to an element using a single coordinate.
This can be used to treat the array as a 1D grid.
func Array.ref2 | [src] |
Returns a mutable reference to an element using 2D coordinates and a width.
This can be used to treat the array as a 2D grid.
func Array.remove | [src] |
Removes a specified number of elements starting from a given index.
This is an unstable remove; the order of remaining elements is not preserved.
Removes the first occurrence of a given value from the array.
This is an unstable remove; order is not preserved. Does nothing if the value is not found.
func Array.removeAt | [src] |
Removes the element at a given index by swapping it with the last element.
This is very fast, but the order of elements is not preserved.
func Array.removeAtOrdered | [src] |
Removes one or more elements at a given index, shifting subsequent elements to the left.
This is slower than removeAt, but preserves the order of the remaining elements.
func Array.removeBack | [src] |
Removes the last element from the array.
Asserts if the array is empty.
func Array.removeOrdered | [src] |
Removes the first occurrence of a given value, preserving the order of remaining elements.
Does nothing if the value is not found.
func Array.reserve | [src] |
Sets the array's capacity to at least newCapacity.
This does not change the number of elements in the array.
func Array.resize | [src] |
Changes the number of elements in the array to newCount.
If newCount is greater than the current me.count, new elements are default-initialized. If newCount is smaller, excess elements are dropped.
func Array.sort | [src] |
Sorts the array in ascending order using the default comparison operator.
Sorts the array using a custom comparison function.
func Array.sortReverse | [src] |
Sorts the array in descending order.
func Array.swap | [src] |
Swaps two elements in the array by their indices.
func Array.toSlice | [src] |
Returns a mutable slice containing all elements of the array.
Returns an immutable slice containing all elements of the array.
struct Core.ArrayPtr | [src] |
A specialized dynamic array for holding and owning pointers.
using base | Array'(*ArrayPtr.T) |
This struct extends the base Array to correctly manage the lifecycle (allocation and deallocation) of the pointed-to objects.
addNewPtr | Allocates a new object, adds its pointer to the end of the array, and returns the pointer. |
clear | Deallocates all objects pointed to by the elements in the array and clears the array. |
deletePtr | Deallocates the memory for a single given pointer. |
newPtr | Allocates memory for a new object of type T using the array's allocator. |
opDrop | Ensures that all pointed-to objects are deallocated when the array goes out of scope. |
opPostCopy | Handles the deep copy of the array and the objects it points to. |
func ArrayPtr.addNewPtr | [src] |
Allocates a new object, adds its pointer to the end of the array, and returns the pointer.
func ArrayPtr.clear | [src] |
Deallocates all objects pointed to by the elements in the array and clears the array.
The array's count is set to 0, but the capacity is not changed.
func ArrayPtr.deletePtr | [src] |
Deallocates the memory for a single given pointer.
The pointer is expected to have been allocated using this array's allocator.
func ArrayPtr.newPtr | [src] |
Allocates memory for a new object of type T using the array's allocator.
Returns a pointer to the newly allocated memory.
func ArrayPtr.opDrop | [src] |
Ensures that all pointed-to objects are deallocated when the array goes out of scope.
func ArrayPtr.opPostCopy | [src] |
Handles the deep copy of the array and the objects it points to.
When the array is copied, new memory is allocated for each element, and the content is copied over, ensuring the new array owns its own set of objects.
namespace Core.Atomic |
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 Atomic.compareExchange | [src] |
func Atomic.exchange | [src] |
func Atomic.get | [src] |
func Atomic.logicAnd | [src] |
func Atomic.logicOr | [src] |
func Atomic.logicXor | [src] |
struct Core.BitArray | [src] |
Manages a compact array of bit values.
buffer | [*] u32 | Internal buffer storing the bits packed into 32-bit integers. |
allocator | Swag.IAllocator | The allocator used for memory operations. |
count | u64 | The number of bits in the array. |
capacity | u64 | The total allocated capacity in bytes. |
Bits are represented as booleans, where true indicates the bit is on (1) and false indicates the bit is off (0). This structure is memory-efficient for storing a large number of boolean flags.
andWith | Performs a bitwise AND operation between this array and another. |
get | Returns the boolean value of the bit at a specific position. |
invert(me) | Inverts all bit values in the array. |
invert(me, u64) | Inverts the value of the bit at a specific position. |
orWith | Performs a bitwise OR operation between this array and another. |
reserve(me, u64) | Reserves capacity for a given number of bits. |
reserve(me, u64, bool) | Reserves capacity for a given number of bits and initializes them to a specific value. |
set | Sets the bit at a specific position to the specified value. |
setAll | Sets all bits in the array to the specified boolean value. |
xorWith | Performs a bitwise XOR operation between this array and another. |
opAffect | Replaces the content of the bit array with values from a slice of booleans. |
opCount | Returns the number of bits in the array. |
opDrop | Ensures the allocated memory is freed when the array goes out of scope. |
opEquals | Compares this bit array with another one for equality. |
opIndex | Returns the boolean value of the bit at a specific position. |
opIndexAffect | Sets the value of the bit at a specific position. |
opPostCopy | Handles the deep copy of the array when it is copied. |
opVisit | Provides a way to iterate over each bit in the array. |
func BitArray.andWith | [src] |
Performs a bitwise AND operation between this array and another.
The current array is modified to store the result. Asserts that arrays are of the same size.
func BitArray.get | [src] |
Returns the boolean value of the bit at a specific position.
func BitArray.invert | [src] |
Inverts the value of the bit at a specific position.
Changes a true bit to false and a false bit to true.
Inverts all bit values in the array.
Bits set to true are changed to false, and vice versa.
func BitArray.opAffect | [src] |
Replaces the content of the bit array with values from a slice of booleans.
func BitArray.opCount | [src] |
Returns the number of bits in the array.
func BitArray.opDrop | [src] |
Ensures the allocated memory is freed when the array goes out of scope.
func BitArray.opEquals | [src] |
Compares this bit array with another one for equality.
Returns true if both arrays have the same bit count and all bits are identical.
func BitArray.opIndex | [src] |
Returns the boolean value of the bit at a specific position.
func BitArray.opIndexAffect | [src] |
Sets the value of the bit at a specific position.
func BitArray.opPostCopy | [src] |
Handles the deep copy of the array when it is copied.
A new buffer is allocated and the content is copied over.
func BitArray.opVisit | [src] |
Provides a way to iterate over each bit in the array.
This is a macro that accepts a code block to execute for each bit. Aliases: #alias0 for the boolean value, #alias1 for the index.
func BitArray.orWith | [src] |
Performs a bitwise OR operation between this array and another.
The current array is modified to store the result. Asserts that arrays are of the same size.
func BitArray.reserve | [src] |
Reserves capacity for a given number of bits.
The allocated memory is not initialized.
Reserves capacity for a given number of bits and initializes them to a specific value.
func BitArray.set | [src] |
Sets the bit at a specific position to the specified value.
func BitArray.setAll | [src] |
Sets all bits in the array to the specified boolean value.
func BitArray.xorWith | [src] |
Performs a bitwise XOR operation between this array and another.
The current array is modified to store the result. Asserts that arrays are of the same size.
struct Core.ByteStream | [src] |
A stream for reading from or writing to a byte buffer.
readBuffer | const [..] u8 | Buffer used for reading. |
writeBuffer | *Array'(u8) | Buffer used for writing. |
seek | u64 | Current read/write position. |
eof | bool | End-of-file flag for reads. |
getSeek | Returns the current seek position. |
isEof | Returns true if the end of the buffer was reached during reading. |
length | Returns the total length of the buffer (read or write). |
moveSeek | Advances the seek by a specified offset (default is 1). |
openRead | Creates a byte stream for reading from a buffer. |
openWrite | Creates a byte stream for writing to a buffer. |
peekU8 | Peeks at a single byte without consuming it. |
readBytes | Reads count bytes from the stream into dest. |
readData | Returns a pointer to the underlying read or write buffer. |
readNative | Reads a native value of type T from the stream. |
readU8 | Reads and consumes a single byte. |
remainReadToSlice | Returns a slice of unread bytes from the current seek to the end. |
remainReadToString | Returns a string of unread bytes from the current seek to the end. |
setSeek | Sets the seek to a specific offset. |
writeBytes | Writes a slice of bytes to the stream. |
writeNative | Writes a native value of type T to the stream. |
func ByteStream.getSeek | [src] |
Returns the current seek position.
func ByteStream.isEof | [src] |
Returns true if the end of the buffer was reached during reading.
func ByteStream.length | [src] |
Returns the total length of the buffer (read or write).
func ByteStream.moveSeek | [src] |
Advances the seek by a specified offset (default is 1).
func ByteStream.openRead | [src] |
Creates a byte stream for reading from a buffer.
func ByteStream.openWrite | [src] |
Creates a byte stream for writing to a buffer.
func ByteStream.peekU8 | [src] |
Peeks at a single byte without consuming it.
func ByteStream.readBytes | [src] |
Reads count bytes from the stream into dest.
func ByteStream.readData | [src] |
Returns a pointer to the underlying read or write buffer.
func ByteStream.readNative | [src] |
Reads a native value of type T from the stream.
func ByteStream.readU8 | [src] |
Reads and consumes a single byte.
func ByteStream.remainReadToSlice | [src] |
Returns a slice of unread bytes from the current seek to the end.
func ByteStream.remainReadToString | [src] |
Returns a string of unread bytes from the current seek to the end.
func ByteStream.setSeek | [src] |
Sets the seek to a specific offset.
func ByteStream.writeBytes | [src] |
Writes a slice of bytes to the stream.
func ByteStream.writeNative | [src] |
Writes a native value of type T to the stream.
enum Core.CharacterSet | [src] |
Latin1 | |
Unicode |
namespace Core.CommandLine |
IsSet | The IsSet generic struct is a mirror of the user input struct. |
ParseOptions | |
Result | Result of the [parse] function. |
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. |
ArgParams |
attr CommandLine.ArgParams | [src] |
struct CommandLine.IsSet | [src] |
The IsSet generic struct is a mirror of the user input struct.
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.
isSet | CommandLine.IsSet'(CommandLine.IsSet.T) |
func CommandLine.getField | [src] |
func CommandLine.isOption | [src] |
Returns true if oneArg is a valid option (starting with a delimiter).
func CommandLine.parse | [src] |
Parse all the arguments and fill the result.
func parse.checkNext | [src] |
func CommandLine.splitArguments | [src] |
Clean and split a list of arguments -option:value or -option=value => -option value.
namespace Core.Compress |
BitStream | A structure for reading a bit stream, useful for decompressors or parsers. |
Deflate | Main structure representing a Deflate compression context. |
Inflate | |
ZLib |
struct Compress.BitStream | [src] |
A structure for reading a bit stream, useful for decompressors or parsers.
stream | const [..] u8 | Input byte stream. |
curByte | u64 | Index of current byte being processed. |
codeBuffer | u32 | Bit buffer holding bits to be consumed. |
numBits | u8 | Number of bits currently in the buffer. |
eof | bool | Flag to signal end-of-stream. |
consumeBits | Consumes width bits from the buffer (advances the bit position). |
curPtr | Returns a pointer to the current byte in the stream. |
discardToNextByte | Discards bits to align to the next byte boundary. |
init | Initializes the bit stream with an input buffer. |
peek32 | Peeks 4 bytes (little-endian) into dest. |
peek32Be | Peeks 4 bytes (big-endian) into dest, auto-switches based on platform. |
peekBits | Returns next width bits without consuming them (refills if needed). |
peekBitsNoRefill | Like peekBits, but assumes enough bits are already available. |
peekBytes | Peeks width bytes into dest, consuming bits after each byte. |
readBits | Reads and consumes width bits from the buffer. |
readBitsNoRefill | Reads and consumes width bits without checking buffer availability. |
refill | Refills the bit buffer until at least width bits are available. |
revert | Reverts stream to last byte-aligned state (undo partial read). |
size | Returns the total size of the stream. |
startPtr | Returns a pointer to the beginning of the stream. |
func BitStream.consumeBits | [src] |
Consumes width bits from the buffer (advances the bit position).
func BitStream.curPtr | [src] |
Returns a pointer to the current byte in the stream.
func BitStream.discardToNextByte | [src] |
Discards bits to align to the next byte boundary.
func BitStream.init | [src] |
Initializes the bit stream with an input buffer.
func BitStream.peek32 | [src] |
Peeks 4 bytes (little-endian) into dest.
func BitStream.peek32Be | [src] |
Peeks 4 bytes (big-endian) into dest, auto-switches based on platform.
func BitStream.peekBits | [src] |
Returns next width bits without consuming them (refills if needed).
func BitStream.peekBitsNoRefill | [src] |
Like peekBits, but assumes enough bits are already available.
func BitStream.peekBytes | [src] |
Peeks width bytes into dest, consuming bits after each byte.
func BitStream.readBits | [src] |
Reads and consumes width bits from the buffer.
func BitStream.readBitsNoRefill | [src] |
Reads and consumes width bits without checking buffer availability.
func BitStream.refill | [src] |
Refills the bit buffer until at least width bits are available.
func BitStream.revert | [src] |
Reverts stream to last byte-aligned state (undo partial read).
func BitStream.size | [src] |
Returns the total size of the stream.
func BitStream.startPtr | [src] |
Returns a pointer to the beginning of the stream.
struct Compress.Deflate | [src] |
Main structure representing a Deflate compression context.
compress | Compress the source buffer. |
init | Initialize the compressor Can be called multiple times. |
opDrop |
enum Deflate.CompressionFlags | [src] |
Flags controlling compression behavior.
Zero | No compression flags. |
ComputeAdler32 | Compute Adler-32 checksum after compression. |
Default | Default flag: computes Adler-32. |
enum Deflate.CompressionLevel | [src] |
Compression level to use (mapped to number of probes and strategies).
NoCompression | Disables compression (raw storage). |
BestSpeed | Fastest compression, less effective. |
Default | Balanced default compression. |
BestCompression | High compression ratio, slower. |
UberCompression | Maximum compression effort. |
enum Deflate.CompressionStrategy | [src] |
Strategy for compression to influence algorithm behavior.
Default | Default compression strategy. |
Filtered | Filter out potentially poor matches. |
HuffmanOnly | Use only Huffman coding, no match search. |
Rle | Run-length encoding. |
Fixed | Use fixed Huffman codes. |
func Deflate.compress | [src] |
Compress the source buffer.
func Deflate.init | [src] |
Initialize the compressor Can be called multiple times.
func Deflate.opDrop | [src] |
struct Compress.Inflate | [src] |
decompress | Decompress the associated stream. |
func Inflate.decompress | [src] |
Decompress the associated stream.
struct Compress.ZLib | [src] |
compress | Decompress stream. |
decompress | Decompress stream. |
func ZLib.compress | [src] |
Decompress stream.
func ZLib.decompress | [src] |
Decompress stream.
struct Core.ConcatBuffer | [src] |
Represents a growable buffer that is divided into buckets (chunks of memory).
allocator | Swag.IAllocator | The allocator to use for all memory operations. |
firstBucket | *ConcatBufferBucket | The first bucket in the chain. |
curBucket | *ConcatBufferBucket | The bucket where the current seek pointer is located. |
lastBucket | *ConcatBufferBucket | The last bucket in the chain. |
currentSP | [*] u8 | The current read/write pointer in the curBucket. |
granularity | u64 | The default size for newly allocated buckets. |
isAtEnd | bool | true if the seek pointer is at the very end of the buffer. |
viewFirstBucket | ConcatBufferBucket | A pre-allocated bucket used for views, to avoid a separate allocation. |
This structure avoids large reallocations and copies when the buffer needs to grow, making it efficient for building data piece by piece.
addBytes | Appends a slice of bytes to the buffer. |
addNative | Appends a native type (like u8, s32, f64) to the buffer. |
addStruct | Appends the raw byte content of a struct to the buffer. |
clear | Clears the buffer's content without deallocating memory. |
count | Returns the total number of bytes currently stored in the buffer. |
getOffset | Calculates the absolute byte offset of a given seek position. |
getSeek | Returns a ConcatBufferSeek representing the current position in the buffer. |
grow | Ensures that there is enough room to store at least numBytes more bytes. |
makeLinear | Merges all buckets into a single, contiguous memory block. |
moveSeek | Moves the current seek pointer forward by num bytes. |
moveToString | Moves the buffer's content into a new String, invalidating the buffer. |
release | Frees all memory associated with the buffer, including all buckets. |
setAllocator | Associates a specific allocator with the buffer. |
setBucketSize | Sets the minimum size for new buckets allocated by the buffer. |
setEndSeek | Sets the end of the buffer to a given seek position, effectively truncating it. |
setFirstBucket | Initializes the buffer to use an external, existing slice of data as its first bucket. |
setSeek | Sets the current read/write position to a given seek. |
toSlice | Returns the buffer's content as a slice, but only if the buffer is linear. |
toString | Converts the buffer to a String by copying all its content. |
opCount | Returns the total number of bytes in the buffer. |
opDrop | Ensures all allocated memory is freed when the buffer goes out of scope. |
opVisit | Provides a way to iterate over each bucket in the buffer. |
func ConcatBuffer.addBytes | [src] |
Appends a slice of bytes to the buffer.
If contiguous is false, the slice can be split across multiple buckets if necessary.
func ConcatBuffer.addNative | [src] |
Appends a native type (like u8, s32, f64) to the buffer.
func ConcatBuffer.addStruct | [src] |
Appends the raw byte content of a struct to the buffer.
func ConcatBuffer.clear | [src] |
Clears the buffer's content without deallocating memory.
This resets the buffer to be empty, allowing its allocated buckets to be reused.
func ConcatBuffer.count | [src] |
Returns the total number of bytes currently stored in the buffer.
func ConcatBuffer.getOffset | [src] |
Calculates the absolute byte offset of a given seek position.
func ConcatBuffer.getSeek | [src] |
Returns a ConcatBufferSeek representing the current position in the buffer.
func ConcatBuffer.grow | [src] |
Ensures that there is enough room to store at least numBytes more bytes.
If the current bucket is full, a new one is allocated.
func ConcatBuffer.makeLinear | [src] |
Merges all buckets into a single, contiguous memory block.
After this call, the buffer is guaranteed to be linear.
func ConcatBuffer.moveSeek | [src] |
Moves the current seek pointer forward by num bytes.
func ConcatBuffer.moveToString | [src] |
Moves the buffer's content into a new String, invalidating the buffer.
If the buffer is linear (one bucket), this is a fast operation that avoids copying. Otherwise, it falls back to copying the data.
func ConcatBuffer.opCount | [src] |
Returns the total number of bytes in the buffer.
func ConcatBuffer.opDrop | [src] |
Ensures all allocated memory is freed when the buffer goes out of scope.
func ConcatBuffer.opVisit | [src] |
Provides a way to iterate over each bucket in the buffer.
This is a macro that accepts a code block to execute for each bucket. Alias: #alias0 for the bucket pointer.
func ConcatBuffer.release | [src] |
Frees all memory associated with the buffer, including all buckets.
func ConcatBuffer.setAllocator | [src] |
Associates a specific allocator with the buffer.
This can only be called when the buffer is empty.
func ConcatBuffer.setBucketSize | [src] |
Sets the minimum size for new buckets allocated by the buffer.
func ConcatBuffer.setEndSeek | [src] |
Sets the end of the buffer to a given seek position, effectively truncating it.
func ConcatBuffer.setFirstBucket | [src] |
Initializes the buffer to use an external, existing slice of data as its first bucket.
This is a "view" mode; the buffer does not own or free this data.
func ConcatBuffer.setSeek | [src] |
Sets the current read/write position to a given seek.
func ConcatBuffer.toSlice | [src] |
Returns the buffer's content as a slice, but only if the buffer is linear.
A buffer is linear if it consists of a single bucket. Returns null otherwise. See [[makeLinear]].
func ConcatBuffer.toString | [src] |
Converts the buffer to a String by copying all its content.
The buffer remains valid after this call. See [[moveToString]] for a more efficient version that avoids copying when possible.
struct Core.ConcatBufferBucket | [src] |
Represents a single memory block (a bucket) within a ConcatBuffer.
datas | [*] u8 | Pointer to the raw memory of the bucket. |
next | *ConcatBufferBucket | Pointer to the next bucket in the chain. |
count | u64 | Number of bytes used in this bucket. |
size | u64 | Total allocated size of this bucket in bytes. |
countBefore | u64 | Total number of bytes in all preceding buckets. |
struct Core.ConcatBufferSeek | [src] |
Represents a position (seek) within a ConcatBuffer.
bucket | *ConcatBufferBucket | The bucket where the position is located. |
sp | [*] u8 | The exact memory address of the position. |
It holds both the bucket and the specific pointer within that bucket.
namespace Core.Console |
Color |
fatal | Fatal error Exit the process with code -1. |
lock | Use to access console with multiple threads. |
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 Console.lock | [src] |
Use to access console with multiple threads.
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 Console.printf | [src] |
Write a formatted message to the console.
func Console.println | [src] |
Write a line to the console.
func Console.prompt | [src] |
Wait for using input, and returns the corresponding string.
func Console.resetColor | [src] |
Restore the console colors to their default values.
func Console.setBackColor | [src] |
Set the console background color.
func Console.setTextColor | [src] |
Set the console foreground 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 Console.unlock | [src] |
namespace Core.Debug |
assert | |
safety | |
safetyBoundCheck |
func Debug.assert | [src] |
func Debug.safety | [src] |
func Debug.safetyBoundCheck | [src] |
namespace Core.Debugger |
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 Debugger.debugBreak | [src] |
Trigger a breakpoint.
func Debugger.isAttached | [src] |
Returns true if a debugger is attached to the current process.
func Debugger.log | [src] |
Debug log.
namespace Core.Directory |
EnumerationOptions | Options for customizing file and directory enumeration. |
create | |
enumerate | Enumerate a directory. |
enumerateDirectories | Gets all directories in the specified directory. |
enumerateFiles | Gets all files in the specified 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] |
Options for customizing file and directory enumeration.
matchExtension | string | Optional extension to match (e.g. ".txt"). |
matchFileName | string | Optional file name pattern to match. |
skipAttributes | File.FileAttributes | Attributes to skip during enumeration. |
recurse | bool | Whether to recurse into subdirectories. |
wantFiles | bool | Whether to include files in the results. |
wantDirectories | bool | Whether to include directories in the results. |
wantSpecialDirectories | bool | Whether to include "." and ".." in the results. |
filterLambda | func(File.FileInfo)->bool | Optional lambda to filter results. |
func Directory.create | [src] |
func Directory.enumerate | [src] |
Enumerate a directory.
func Directory.enumerateDirectories | [src] |
Gets all directories in the specified directory.
func Directory.enumerateFiles | [src] |
Gets all files in the specified directory.
func Directory.exists | [src] |
Returns true if the given directory exists.
func Directory.getCurrent | [src] |
Returns the current directory.
func Directory.getDrives | [src] |
Get the list of logical drives.
func Directory.getVolumes | [src] |
Get the list of volumes.
func Directory.setCurrent | [src] |
Set the current directory.
namespace Core.Env |
Monitor | Describes a physical monitor. |
Process | |
StartInfo |
Metrics | |
SpecialDirectory |
associateFileExtension | Associate an extension to an executable. |
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. |
getDPIScale | Returns the DPI scale. |
getExe | Get current executable. |
getMetric | Return system metrics. |
getMonitorForPoint | Returns the monitor that contains pt Returns the nearest one if none contain it. |
getMonitorForRect | Returns the monitor corresponding to the surface position. |
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. |
registerApplication | Register an application in the system. |
startProcess(const &StartInfo) | Starts a new process with arguments. |
startProcess(string, string) | Starts a new process with arguments. |
enum Env.Metrics | [src] |
DesktopX | Left position of the full desktop. |
DesktopY | Top position of the full desktop. |
DesktopWidth | With of the full desktop. |
DesktopHeight | Height of the full desktop. |
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 |
getProcessId | Get current process ID. |
getThreadId | Get current thread ID. |
waitForExit | Wait for the process to be done. |
func Process.getProcessId | [src] |
Get current process ID.
func Process.getThreadId | [src] |
Get current thread ID.
func Process.waitForExit | [src] |
Wait for the process to be done.
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.associateFileExtension | [src] |
Associate an extension to an executable.
func Env.doSyncProcess | [src] |
Starts a new process with arguments, and wait for it to be done.
func Env.exit | [src] |
Exit the current process.
func Env.getArg | [src] |
Get a given argument, or null.
func Env.getArgs | [src] |
Get the program command line arguments as a [..] string.
func Env.getDPIScale | [src] |
Returns the DPI scale.
func Env.getExe | [src] |
Get current executable.
func Env.getMetric | [src] |
Return system metrics.
func Env.getMonitorForPoint | [src] |
Returns the monitor that contains pt Returns the nearest one if none contain it.
func Env.getMonitorForRect | [src] |
Returns the monitor corresponding to the surface position.
func Env.getMonitors | [src] |
Get the list of all monitors.
func Env.getSpecialDirectory | [src] |
The system font directory.
func Env.hasArg | [src] |
Get a given argument, or null.
func Env.locateInExplorer | [src] |
Locate file in the file explorer.
func Env.locateUrl | [src] |
Locate file in the internet explorer.
func Env.registerApplication | [src] |
Register an application in the system.
func Env.startProcess | [src] |
Starts a new process with arguments.
namespace Core.Errors |
BadParameterError | |
FileNotFoundError | |
InvalidFileNameError | |
InvalidFormatError | |
InvalidVersion | |
OverflowError | |
ParseIncompleteError | |
SerializationError | |
SyntaxError | |
UnsupportedFormatError |
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.
That kind of string can be stored in an error struct.
namespace Core.File |
FileInfo | Represents metadata and properties of a file or directory. |
FileStream | Represents an open file stream for reading, writing, or seeking. |
Folder | Represents a folder mapping to a specific structure type with its data. |
TextReader | TextReader reads a text file from a FileStream with buffering and encoding support. |
TweakFile | Represents a tweak file parser that can load configuration into registered folders. |
FileAccess | File access permissions. |
FileAttributes | Attributes that define file or directory characteristics. |
FileMode | File creation and opening behaviors. |
FileShare | File sharing options. |
SeekOrigin | Origin from which to calculate seek offset in a file stream. |
TextEncoding | Text encoding formats supported for reading text files. |
delete | Delete the specified file. |
duplicate | Creates a duplicate of an existing file. |
exists | Returns true if the given file exists. |
getAttributes | Returns attributes associated to the given filename. |
getFileInfo | Retrieves information about a specific 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 | Reads the entire content of a file into an array of bytes. |
readAllLines | Reads all lines from a file into an array of strings. |
readAllText | Reads the entire content of a file into a UTF-8 string. |
readEachLines | Executes user code for each line read from a file. |
touch | Change the file write date/time. |
writeAllBytes(string, const &ConcatBuffer) | Writes the content of a ConcatBuffer to a file. |
writeAllBytes(string, const [..] u8) | Writes the content of a byte slice to a file. |
writeAllLines | Writes an array of strings to a file, one string per line. |
enum File.FileAccess | [src] |
File access permissions.
Read | Read access. |
Write | Write access. |
ReadWrite | Read and write access. |
enum File.FileAttributes | [src] |
Attributes that define file or directory characteristics.
Zero | No attributes set. |
ReadOnly | File is read-only. |
Hidden | File is hidden. |
System | File is part of the operating system. |
Directory | Entry is a directory. |
Archive | File is marked for backup or removal. |
Device | Reserved for system use (rarely used). |
Normal | File has no other attributes set. |
Temporary | File is used for temporary storage. |
SparseFile | File is a sparse file. |
ReparsePoint | File contains a reparse point (e.g., symbolic link). |
Compressed | File is compressed. |
Offline | File data is not available immediately (e.g., archived). |
NotContentIndexed | File is excluded from content indexing. |
Encrypted | File is encrypted. |
struct File.FileInfo | [src] |
Represents metadata and properties of a file or directory.
fullname | String | Full path of the file or directory. |
attributes | File.FileAttributes | Attributes describing the file (e.g., read-only, hidden). |
creationTime | Time.DateTime | Time the file or directory was created. |
lastAccessTime | Time.DateTime | Time the file or directory was last accessed. |
lastWriteTime | Time.DateTime | Time the file or directory was last modified. |
size | u64 | Size of the file in bytes (0 for directories). |
isDirectory | Returns true if the file info represents a directory. |
func FileInfo.isDirectory | [src] |
Returns true if the file info represents a directory.
enum File.FileMode | [src] |
File creation and opening behaviors.
Append | Opens the file if it exists and moves the seek to the end, or creates a new file. |
Create | Creates a new file, overwriting if it already exists. |
CreateNew | Creates a new file, throws if the file already exists. |
Open | Opens an existing file. |
OpenOrCreate | Opens the file if it exists, otherwise creates a new one. |
Truncate | Opens an existing file and truncates its content to zero length. |
[src] |
File sharing options.
Zero | No sharing. |
Delete | Allows the file to be deleted by others. |
Inheritable | File handle is inheritable. |
Read | Allows shared read access. |
Write | Allows shared write access. |
ReadWrite | Allows shared read and write access. |
struct File.FileStream | [src] |
Represents an open file stream for reading, writing, or seeking.
name | String | File name associated with the stream. |
handle | File.FileHandle | Platform-specific file handle. |
canRead | bool | True if the stream supports reading. |
canSeek | bool | True if the stream supports seeking. |
canWrite | bool | True if the stream supports writing. |
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 currently open and valid. |
read | Read from the given file stream, and returns the number of bytes. |
readValue | Reads a value of type T from the stream into buffer; returns true if read was successful. |
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. |
opDrop |
func FileStream.close | [src] |
Close the given file stream.
func FileStream.getPosition | [src] |
Returns the current seek position of the given file stream.
func FileStream.getSize | [src] |
Returns the given file stream length on disk.
func FileStream.isOpen | [src] |
Returns true if the stream is currently open and valid.
func FileStream.opDrop | [src] |
func FileStream.read | [src] |
Read from the given file stream, and returns the number of bytes.
func FileStream.readValue | [src] |
Reads a value of type T from the stream into buffer; returns true if read was successful.
func FileStream.setPosition | [src] |
Set the current seek position of the given file stream.
func FileStream.skipPosition | [src] |
Skip bytes from current position.
func FileStream.write | [src] |
Write to the given file stream, and returns the number of written bytes.
struct File.Folder | [src] |
Represents a folder mapping to a specific structure type with its data.
type | const *Swag.TypeInfo | Type information of the structure. |
data | [*] void | Pointer to the actual structure instance. |
enum File.SeekOrigin | [src] |
Origin from which to calculate seek offset in a file stream.
Begin | Seek from the beginning of the file. |
Current | Seek from the current position. |
End | Seek from the end of the file. |
enum File.TextEncoding | [src] |
Text encoding formats supported for reading text files.
Ascii | ASCII encoding. |
Utf8 | UTF-8 encoding. |
struct File.TextReader | [src] |
TextReader reads a text file from a FileStream with buffering and encoding support.
stream | File.FileStream | File stream used to read from disk. |
buffer | Array'(u8) | Internal byte buffer used for reading data. |
encodingType | File.TextEncoding | Text encoding type (default is UTF-8). |
byteSeek | u64 | Current byte offset in the buffer. |
bufferSize | u64 | Size of the buffer. |
checkPreamble | bool | Indicates whether to check for a UTF-8 BOM on first read. |
close | Closes the reader and the associated stream. |
open | Opens the reader with the specified text encoding (default is UTF-8). |
readLine | Reads one line of text into the result string Returns false if the end of the stream has been reached. |
readToEnd | Reads from the current position to the end of the stream and returns the content as a UTF-8 string. |
func TextReader.close | [src] |
Closes the reader and the associated stream.
func TextReader.open | [src] |
Opens the reader with the specified text encoding (default is UTF-8).
func TextReader.readLine | [src] |
Reads one line of text into the result string Returns false if the end of the stream has been reached.
func TextReader.readToEnd | [src] |
Reads from the current position to the end of the stream and returns the content as a UTF-8 string.
struct File.TweakFile | [src] |
Represents a tweak file parser that can load configuration into registered folders.
folders | Array'(File.Folder) | List of registered folders (structure instances) to fill. |
parse(me, const &Array'(string)) | Parses tweak content from an array of lines. |
parse(me, string) | Parses tweak content from a string. |
parseFile | Reads and parses a tweak file from disk. |
registerFolder | Registers a new structure to be parsed as a folder. |
func TweakFile.parse | [src] |
Parses tweak content from a string.
Parses tweak content from an array of lines.
func TweakFile.parseFile | [src] |
Reads and parses a tweak file from disk.
func TweakFile.registerFolder | [src] |
Registers a new structure to be parsed as a folder.
func File.delete | [src] |
Delete the specified file.
func File.duplicate | [src] |
Creates a duplicate of an existing file.
func File.exists | [src] |
Returns true if the given file exists.
func File.getAttributes | [src] |
Returns attributes associated to the given filename.
func File.getFileInfo | [src] |
Retrieves information about a specific file.
func File.getInfo | [src] |
Returns various file informations.
func File.open | [src] |
Open a new file stream.
func File.openRead | [src] |
Creates a new file stream for reading.
func File.openWrite | [src] |
Creates a new file stream for writing.
func File.readAllBytes | [src] |
Reads the entire content of a file into an array of bytes.
func File.readAllLines | [src] |
Reads all lines from a file into an array of strings.
func File.readAllText | [src] |
Reads the entire content of a file into a UTF-8 string.
func File.readEachLines | [src] |
Executes user code for each line read from a file.
func File.touch | [src] |
Change the file write date/time.
func File.writeAllBytes | [src] |
Writes the content of a byte slice to a file.
Writes the content of a ConcatBuffer to a file.
func File.writeAllLines | [src] |
Writes an array of strings to a file, one string per line.
namespace Core.Format |
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 Format.checkFormat | [src] |
Check if this is a valid fmt/values pair, coherent with format specification.
func Format.countPercent | [src] |
Count the number of valid % placeholders in the string format.
Note that %% will not be counted, as this represents the % character
func Format.replaceString | [src] |
Format a string in dest.
Can be a lot faster than the convenient version which returns a String.
func Format.toInterp | [src] |
String interpolation.
Format is {<value to interpolate>:format}
String interpolation.
func Format.toString | [src] |
Format a string and returns the result as a String.
Use % as a place holder for a value.
% can be followed by a format option between {}.
func Format.toStringTemp | [src] |
Returns a formatted string stored in the temporary allocator.
struct Core.GUID128 | [src] |
A 128-bit Globally Unique Identifier structure.
using guid | {val8:[16] u8,val64:[2] u64} |
Provides RFC 4122 compliant UUID generation and manipulation.
clear | Clear id. |
getRandom | Get a version 4 GUID128 (random). |
getString | Convert guid to a string. |
toString | Convert guid to a string of the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx. |
opEquals | Compare two GUID128 instances for equality. |
func IConvert.convert | [src] |
Convert the GUID to its string representation for display.
Uses the standard UUID format with hyphens.
func IHash32.compute | [src] |
Compute a 32-bit hash value for the GUID.
Uses CRC32 algorithm on the entire 16-byte GUID data.
func GUID128.clear | [src] |
Clear id.
func GUID128.getRandom | [src] |
Get a version 4 GUID128 (random).
func GUID128.getString | [src] |
Convert guid to a string.
func GUID128.opEquals | [src] |
Compare two GUID128 instances for equality.
Returns true if both GUIDs have identical values.
func GUID128.toString | [src] |
Convert guid to a string of the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx.
struct Core.GUID64 | [src] |
A 64-bit Globally Unique Identifier structure.
guid | u64 | 64-bit unique identifier value. |
Provides compact GUID generation with multiple entropy strategies for different use cases.
clear | Clear GUID. |
getHighEntropy | Get a high-entropy GUID64 using multiple entropy sources. |
getRandom | Get a fully random GUID64 using MT64. |
getString | Convert guid to a string. |
getTimestamp | Get a timestamp-based GUID64 with minimal collision risk Structure: 32-bit timestamp + 16-bit microseconds + 12-bit counter + 4-bit random. |
isNull | Check if GUID is null/empty. |
parse | Parse GUID64 from hex string (with or without 0x prefix). |
toString | Convert GUID64 to hexadecimal string. |
opEquals | Compare two GUID64 instances for equality. |
func IConvert.convert | [src] |
Convert the GUID to its hexadecimal string representation.
Produces a 16-character uppercase hex string without separators.
func IHash32.compute | [src] |
Compute a 32-bit hash value for the GUID.
Uses CRC32 algorithm on the 8-byte GUID data for consistent hashing.
func GUID64.clear | [src] |
Clear GUID.
func GUID64.getHighEntropy | [src] |
Get a high-entropy GUID64 using multiple entropy sources.
func GUID64.getRandom | [src] |
Get a fully random GUID64 using MT64.
func GUID64.getString | [src] |
Convert guid to a string.
func GUID64.getTimestamp | [src] |
Get a timestamp-based GUID64 with minimal collision risk Structure: 32-bit timestamp + 16-bit microseconds + 12-bit counter + 4-bit random.
func GUID64.isNull | [src] |
Check if GUID is null/empty.
func GUID64.opEquals | [src] |
Compare two GUID64 instances for equality.
Returns true if both GUIDs have identical values.
func GUID64.parse | [src] |
Parse GUID64 from hex string (with or without 0x prefix).
func GUID64.toString | [src] |
Convert GUID64 to hexadecimal string.
namespace Core.Globalization |
CultureInfo | |
NumberFormatInfo | Provides culture-specific information for formatting and parsing numeric values. |
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.
namespace Core.Hardware |
getMacAddress | Max address. |
getProcessorCount | Number of processors. |
func Hardware.getMacAddress | [src] |
Max address.
func Hardware.getProcessorCount | [src] |
Number of processors.
namespace Core.Hash |
Adler32 | |
City32 | |
Crc32 | |
Crc64 | CRC-64 implementation as described in ECMA-182, Annex B. |
Md5 | |
Sha1 | A SHA-1 cryptographic hash function implementation. |
Sha256 |
Crc64Kind |
hash32 | Hash the given value and returns the corresponding u32. |
hash64 | Hash the given value and returns the corresponding u64. |
jenkins(u32) | |
jenkins(u64) | |
murmur3(const [*] u8, u64, u64) | |
murmur3(u32) | |
murmur3(u32, u32) | |
murmur3(u64) | |
murmur3(u64, u64) |
struct Hash.Adler32 | [src] |
adler | u32 |
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 Adler32.init | [src] |
Initialize the hashing sequence.
func Adler32.update | [src] |
Update the hash value with buffer content.
struct Hash.City32 | [src] |
crc | u32 |
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 City32.init | [src] |
Initialize the hashing sequence.
func City32.update | [src] |
Update the hash value with buffer content.
struct Hash.Crc32 | [src] |
crc | u32 |
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 Crc32.init | [src] |
Initialize the hashing sequence.
func Crc32.update | [src] |
Update the hash value with buffer content.
struct Hash.Crc64 | [src] |
CRC-64 implementation as described in ECMA-182, Annex B.
crc | u64 |
compute | Returns the hash value for the given buffer. |
update | Computes the CRC-64 hash of the provided data. |
func Crc64.compute | [src] |
Returns the hash value for the given buffer.
func Crc64.update | [src] |
Computes the CRC-64 hash of the provided data.
enum Hash.Crc64Kind | [src] |
ECMA182 | |
ISO | |
ISOXZ |
interface Hash.IHash32 | [src] |
compute | func(const *Hash.IHash32)->u32 |
interface Hash.IHash64 | [src] |
compute | func(const *Hash.IHash64)->u64 |
struct Hash.Md5 | [src] |
padding | [64] u8 | |
state | [4] u32 | |
count | [2] u32 | |
buffer | [64] u8 |
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 Md5.final | [src] |
Finalize the computation.
func Md5.init | [src] |
Initialize the hashing sequence.
func Md5.toString | [src] |
Convert a MD5 result to a string.
func Md5.update | [src] |
Update the hash value with buffer content.
struct Hash.Sha1 | [src] |
A SHA-1 cryptographic hash function implementation.
data | [64] u8 | Internal data buffer for processing 512-bit blocks. |
state | [5] u32 | Five 32-bit hash state values (A, B, C, D, E). |
datalen | u32 | Current number of bytes in the data buffer. |
bitlen | u64 | Total number of bits processed so far. |
Provides methods to compute 160-bit SHA-1 hash values from arbitrary data streams. Supports incremental hashing through init, update, and final operations.
compute | Returns the SHA-1 hash value for the given buffer. |
final | Finalize the computation and produce the final hash digest. |
init | Initialize the hashing sequence with standard SHA-1 constants. |
update | Update the hash value with buffer content. |
func Sha1.compute | [src] |
Returns the SHA-1 hash value for the given buffer.
Convenience function that performs the complete hash operation in a single call.
func Sha1.final | [src] |
Finalize the computation and produce the final hash digest.
Applies padding and length encoding, then stores the result in result.
func Sha1.init | [src] |
Initialize the hashing sequence with standard SHA-1 constants.
Sets up the initial state values and resets all counters to zero.
func Sha1.update | [src] |
Update the hash value with buffer content.
Processes the input data in 512-bit blocks, buffering incomplete blocks for later processing.
struct Hash.Sha256 | [src] |
data | [64] u8 | |
state | [8] u32 | |
datalen | u32 | |
bitlen | u64 |
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 Sha256.final | [src] |
Finalize the computation.
func Sha256.init | [src] |
Initialize the hashing sequence.
func Sha256.update | [src] |
Update the hash value with buffer content.
func Hash.hash32 | [src] |
Hash the given value and returns the corresponding u32.
func Hash.hash64 | [src] |
Hash the given value and returns the corresponding u64.
func Hash.jenkins | [src] |
func Hash.murmur3 | [src] |
struct Core.HashSet | [src] |
A hash set implemented with an open-addressing hash me.table.
HASH_FREE | s32 | The slot is empty and has never been used. |
HASH_DELETED | s32 | The slot was previously occupied but has been me.deleted. |
HASH_FIRST | s32 | The first possible valid hash value. |
HASH_MASK | s32 | A mask to ensure that valid hashes are >= HASH_FIRST. |
allocator | Swag.IAllocator | The me.allocator used for memory operations. |
table | [*] HashSetEntry'(HashSetEntry.K) | Pointer to the contiguous memory block for the hash me.table. |
count | u64 | The number of valid elements currently in the set. |
capacity | u64 | The total number of slots in the hash me.table. |
deleted | u64 | The number of slots marked as deleted. |
It stores a collection of unique keys, providing fast lookups, additions, and removals.
add(me, &&K) | Adds a new key to the set by moving it. |
add(me, K) | Adds a new key to the set by copying it. |
clear | Removes all elements from the set without deallocating the me.table memory. |
contains | Returns true if the set contains the given key. |
emplaceInternal | Internal helper to add a new element with a pre-computed hash. |
free | Frees the hash set's memory and resets its state. |
getNewIndex | Finds the correct index for a new key, handling collisions and me.deleted slots. |
grow | Checks if the me.table needs to be resized and triggers it if necessary. |
hashKey | Computes the hash for a given key. |
remove | Removes a key from the set. |
reserve | Resizes the hash me.table to a new me.capacity, rehashing all existing elements. |
opAffect | Replaces the content of the set with elements from a slice. |
opCount | Returns the number of elements in the set. |
opDrop | Ensures the allocated memory is freed when the set goes out of scope. |
opPostCopy | Handles the deep copy of the set when it is copied. |
opVisit | Provides a way to iterate over each key in the set. |
func IConvert.convert | [src] |
func HashSet.add | [src] |
Adds a new key to the set by copying it.
If the key already exists, does nothing. Returns a pointer to the entry.
Adds a new key to the set by moving it.
If the key already exists, does nothing. Returns a pointer to the entry.
func HashSet.clear | [src] |
Removes all elements from the set without deallocating the me.table memory.
All slots are marked as FREE.
func HashSet.contains | [src] |
Returns true if the set contains the given key.
func HashSet.emplaceInternal | [src] |
Internal helper to add a new element with a pre-computed hash.
func HashSet.free | [src] |
Frees the hash set's memory and resets its state.
If keys have destructors, they are called.
func HashSet.getNewIndex | [src] |
Finds the correct index for a new key, handling collisions and me.deleted slots.
Uses linear probing to find the next available slot.
func HashSet.grow | [src] |
Checks if the me.table needs to be resized and triggers it if necessary.
Growth happens when the load factor (including me.deleted slots) exceeds 75%.
func HashSet.hashKey | [src] |
Computes the hash for a given key.
Ensures the resulting hash is not one of the reserved values (FREE, me.deleted).
func HashSet.opAffect | [src] |
Replaces the content of the set with elements from a slice.
func HashSet.opCount | [src] |
Returns the number of elements in the set.
func HashSet.opDrop | [src] |
Ensures the allocated memory is freed when the set goes out of scope.
func HashSet.opPostCopy | [src] |
Handles the deep copy of the set when it is copied.
A new me.table is allocated and all entries are copied over.
func HashSet.opVisit | [src] |
Provides a way to iterate over each key in the set.
This is a macro that accepts a code block to execute for each key. Alias: #alias0 for the key or a pointer to it.
func HashSet.remove | [src] |
Removes a key from the set.
If the key exists, its slot is marked as DELETED. Does nothing if the key is not found.
func HashSet.reserve | [src] |
Resizes the hash me.table to a new me.capacity, rehashing all existing elements.
struct Core.HashSetEntry | [src] |
Represents a single entry within a HashSet.
hash | u32 | The cached hash of the key. |
key | HashSetEntry.K | The key itself. |
struct Core.HashTable | [src] |
A hash me.table implemented with open-addressing that maps keys to values.
HASH_FREE | s32 | The slot is empty and has never been used. |
HASH_DELETED | s32 | The slot was previously occupied but has been me.deleted. |
HASH_FIRST | s32 | The first possible valid hash value. |
HASH_MASK | s32 | A mask to ensure that valid hashes are >= HASH_FIRST. |
allocator | Swag.IAllocator | The me.allocator used for memory operations. |
table | [*] HashTableEntry'(HashTableEntry.K, HashTableEntry.V) | Pointer to the contiguous memory block for the hash me.table. |
count | u64 | The number of valid key-value pairs currently in the me.table. |
capacity | u64 | The total number of slots in the hash me.table. |
deleted | u64 | The number of slots marked as me.deleted. |
It provides fast lookups, additions, and removals of key-value pairs.
add(me, K, &&V, bool) | Adds a new key-value pair to the me.table, moving the value. |
add(me, K, V, bool) | Adds a new key-value pair to the me.table by copying them. |
clear | Removes all elements from the me.table without deallocating the me.table memory. |
contains | Returns true if the me.table contains the given key. |
emplaceInternal | Internal helper to add a new element with a pre-computed hash. Use with care. |
find | Finds the entry for a given key. |
findOrAdd | Finds the entry for a key, or adds a new entry with a default-initialized value if not found. |
free | Frees the hash me.table's memory and resets its state. |
get | Gets the value associated with a key. |
getNewIndex | Finds the correct index for a new key, handling collisions and me.deleted slots. |
grow | Checks if the me.table needs to be resized and triggers it if necessary. |
hashKey | Computes the hash for a given key. |
remove | Removes a key-value pair from the me.table by key. |
reserve | Resizes the hash me.table to a new me.capacity, rehashing all existing elements. |
tryFind | Tries to find the entry for a given key. |
opAffect | Replaces the content of the me.table with key-value pairs from a slice. |
opCount | Returns the number of key-value pairs in the me.table. |
opDrop | Ensures the allocated memory is freed when the me.table goes out of scope. |
opIndex(me, K) | Provides mutable access to the value associated with a key. |
opIndex(me, K) | Provides read-only access to the value associated with a key. |
opIndexAffect | Assigns a value to a key, updating it if it exists or adding it if it doesn't. |
opPostCopy | Handles the deep copy of the me.table when it is copied. |
opVisit | Provides a way to iterate over each key-value pair in the me.table. |
func IConvert.convert | [src] |
func HashTable.add | [src] |
Adds a new key-value pair to the me.table by copying them.
If the key already exists, the value is updated if updateValue is true.
Adds a new key-value pair to the me.table, moving the value.
If the key already exists, the value is updated if updateValue is true.
func HashTable.clear | [src] |
Removes all elements from the me.table without deallocating the me.table memory.
All slots are marked as FREE.
func HashTable.contains | [src] |
Returns true if the me.table contains the given key.
func HashTable.emplaceInternal | [src] |
Internal helper to add a new element with a pre-computed hash. Use with care.
func HashTable.find | [src] |
Finds the entry for a given key.
Asserts and will likely crash if the key is not found. Use [[tryFind]] for safe searching.
func HashTable.findOrAdd | [src] |
Finds the entry for a key, or adds a new entry with a default-initialized value if not found.
Returns a pointer to the existing or new entry.
func HashTable.free | [src] |
Frees the hash me.table's memory and resets its state.
If keys or values have destructors, they are called.
func HashTable.get | [src] |
Gets the value associated with a key.
If the key does not exist, returns the provided default value val instead.
func HashTable.getNewIndex | [src] |
Finds the correct index for a new key, handling collisions and me.deleted slots.
Uses linear probing to find the next available slot.
func HashTable.grow | [src] |
Checks if the me.table needs to be resized and triggers it if necessary.
Growth happens when the load factor (including me.deleted slots) exceeds 75%.
func HashTable.hashKey | [src] |
Computes the hash for a given key.
Ensures the resulting hash is not one of the reserved values (FREE, me.deleted).
func HashTable.opAffect | [src] |
Replaces the content of the me.table with key-value pairs from a slice.
func HashTable.opCount | [src] |
Returns the number of key-value pairs in the me.table.
func HashTable.opDrop | [src] |
Ensures the allocated memory is freed when the me.table goes out of scope.
func HashTable.opIndex | [src] |
Provides read-only access to the value associated with a key.
Asserts if the key is not found.
Provides mutable access to the value associated with a key.
If the key does not exist, this will exhibit undefined behavior. Use with caution. See [[opIndexAffect]] for safe insertion/update.
func HashTable.opIndexAffect | [src] |
Assigns a value to a key, updating it if it exists or adding it if it doesn't.
func HashTable.opPostCopy | [src] |
Handles the deep copy of the me.table when it is copied.
A new me.table is allocated and all entries are copied over.
func HashTable.opVisit | [src] |
Provides a way to iterate over each key-value pair in the me.table.
This is a macro that accepts a code block to execute for each pair. Aliases: #alias0 for the key, #alias1 for the value.
func HashTable.remove | [src] |
Removes a key-value pair from the me.table by key.
If the key exists, its slot is marked as DELETED. Does nothing if the key is not found.
func HashTable.reserve | [src] |
Resizes the hash me.table to a new me.capacity, rehashing all existing elements.
func HashTable.tryFind | [src] |
Tries to find the entry for a given key.
Returns a pointer to the HashTableEntry if found, otherwise returns null.
struct Core.HashTableEntry | [src] |
Represents a single key-value pair entry within a HashTable.
hash | u32 | The cached hash of the key. |
key | HashTableEntry.K | The key. |
value | HashTableEntry.V | The value associated with the key. |
interface Core.ILogWriter | [src] |
Interface for writing log output.
func(*ILogWriter, string) |
namespace Core.Input |
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. |
GamePadButton | Enumerates gamepad buttons. |
Key | Defines the keys on a keyboard. |
KeyModifiers | |
MouseButton |
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 |
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(me, 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 GamePad.getPosition | [src] |
Get the analog position of the given button.
func GamePad.isButtonJustPressed | [src] |
Determines whether specified input device button has just been pressed.
func GamePad.isButtonJustReleased | [src] |
Determines whether specified input device button has just been released.
func GamePad.isButtonPressed | [src] |
Determines whether specified input device button is pressed.
func GamePad.isButtonReleased | [src] |
Determines whether specified input device button is released (not pressed).
func GamePad.isConnected | [src] |
Returns true if the corresponding padIndex is connected.
func GamePad.setVibration | [src] |
Set the left and right vibration of the given padIndex.
Set the vibration motor speeds.
func GamePad.update | [src] |
Update the GamePad current state.
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 |
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 GamePadState.update | [src] |
Compute the current state of the given pad index.
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 | |
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 |
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(me, 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 Keyboard.getPressedModifiers | [src] |
Returns the currently pressed key modifiers.
func Keyboard.isKeyJustPressed | [src] |
Determines whether given key has just been pressed.
func Keyboard.isKeyJustReleased | [src] |
Determines whether given key has just been released.
func Keyboard.isKeyPressed | [src] |
Determines whether given key is currently being pressed.
Returns true if the given key is pressed.
func Keyboard.isKeyReleased | [src] |
Determines whether given key is currently being released.
func Keyboard.keyToRune | [src] |
Try to transform the given key to the corresponding rune.
func Keyboard.keyToVirtualKey | [src] |
func Keyboard.update | [src] |
Compute current state of the keyboard (all keys).
func Keyboard.virtualKeyToKey | [src] |
struct Input.KeyboardState | [src] |
Represents one keyboard state.
using native | Input.KeyboardStateNative | |
pressed | [188] bool |
clear | Reset keyboard state. |
update | Compute current keyboard state. |
func KeyboardState.clear | [src] |
Reset keyboard state.
func KeyboardState.update | [src] |
Compute current keyboard state.
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 |
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(me, 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 Mouse.getMove | [src] |
Returns the move between the current position and the previous one.
func Mouse.getPosition | [src] |
Returns the mouse position.
func Mouse.getPreviousPos | [src] |
Returns the previous mouse position, before the last update.
func Mouse.isButtonDoubleClick | [src] |
func Mouse.isButtonJustPressed | [src] |
Determines whether the specified mouse button has just been pressed.
func Mouse.isButtonJustReleased | [src] |
Determines whether the specified mouse button has just been released.
func Mouse.isButtonPressed | [src] |
Determins if one given mouse button is pressed or not.
Determines whether the specified mouse button is pressed.
func Mouse.isButtonReleased | [src] |
Determines whether the specified mouse button is released.
func Mouse.update | [src] |
Compute the current state of the mouse.
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 |
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 MouseState.update | [src] |
Compute the actual state of the mouse.
func Input.getKeyName | [src] |
Returns a "shortcut" display name.
func Input.getMousePos | [src] |
Returns the current mouse position.
func Input.setMousePos | [src] |
Set the current mouse position.
func Input.showMouseCursor | [src] |
Shoud or hide the mouse cursor.
namespace Core.Jobs |
ForJob | |
Job | |
SliceJob |
JobState |
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] |
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 Jobs.isSynchrone | [src] |
Returns true is the job system has been initialized.
func Jobs.parallelFor | [src] |
Do a for for in parallel chunks.
Exposed variables: - #alias0: current for index - #alias1: userData as passed to the macro
func Jobs.parallelVisit | [src] |
Operate on a range in parallel chunks.
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 Jobs.setNumWorkers | [src] |
Set the number of worker threads. Must be done once.
func Jobs.waitDone | [src] |
Wait for all registered jobs to be finished.
func Jobs.waitJob | [src] |
Wait for a given job to be finished.
namespace Core.Latin1 |
CharAttribute |
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 Latin1.compareNatural | [src] |
Compare two utf8 strings in a natural way, dealing only with latin1 table Returns -1, 0 or 1.
: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 Latin1.isBinDigit | [src] |
func Latin1.isControl | [src] |
func Latin1.isDigit | [src] |
func Latin1.isHexDigit | [src] |
func Latin1.isLetter | [src] |
func Latin1.isLetterOrDigit | [src] |
func Latin1.isLower | [src] |
func Latin1.isNumber | [src] |
func Latin1.isPunctuation | [src] |
func Latin1.isSpace | [src] |
func Latin1.isSymbol | [src] |
func Latin1.isUpper | [src] |
func Latin1.isWord | [src] |
func Latin1.makeLower | [src] |
Make an utf8 buffer lower case, dealing only with latin1 table.
func Latin1.makeUpper | [src] |
Make an utf8 buffer upper case, dealing only with latin1 table.
func Latin1.toLower | [src] |
func Latin1.toUpper | [src] |
func Latin1.trim | [src] |
Trim the string.
struct Core.List | [src] |
A generic, doubly-linked list.
head | *ListEntry'(ListEntry.T) | Pointer to the first node in the list. |
tail | *ListEntry'(ListEntry.T) | Pointer to the last node in the list. |
count | u64 | The total number of elements in the list. |
Provides efficient insertion and deletion of elements.
addBack(me, &&T) | Adds a new element to the back of the list by moving the value. |
addBack(me, T) | Adds a new element to the back of the list by copying the value. |
addFront(me, &&T) | Adds a new element to the front of the list by moving the value. |
addFront(me, T) | Adds a new element to the front of the list by copying the value. |
clear | Removes and deallocates all elements from the list. |
insertAfter(me, *ListEntry'(T), &&T) | Inserts a new element after a specified node by moving the value. |
insertAfter(me, *ListEntry'(T), T) | Inserts a new element after a specified node by copying the value. |
insertBefore(me, *ListEntry'(T), &&T) | Inserts a new element before a specified node by moving the value. |
insertBefore(me, *ListEntry'(T), T) | Inserts a new element before a specified node by copying the value. |
opDrop | Ensures all nodes are deallocated when the list goes out of scope. |
opVisit | Provides a way to iterate over each element in the list. |
func List.addBack | [src] |
Adds a new element to the back of the list by copying the value.
Returns a pointer to the newly created list node.
Adds a new element to the back of the list by moving the value.
Returns a pointer to the newly created list node.
func List.addFront | [src] |
Adds a new element to the front of the list by copying the value.
Returns a pointer to the newly created list node.
Adds a new element to the front of the list by moving the value.
Returns a pointer to the newly created list node.
func List.clear | [src] |
Removes and deallocates all elements from the list.
func List.insertAfter | [src] |
Inserts a new element after a specified node by copying the value.
Returns a pointer to the newly created list node.
Inserts a new element after a specified node by moving the value.
Returns a pointer to the newly created list node.
func List.insertBefore | [src] |
Inserts a new element before a specified node by copying the value.
Returns a pointer to the newly created list node.
Inserts a new element before a specified node by moving the value.
Returns a pointer to the newly created list node.
func List.opDrop | [src] |
Ensures all nodes are deallocated when the list goes out of scope.
func List.opVisit | [src] |
Provides a way to iterate over each element in the list.
This is a macro that accepts a code block to execute for each element. Visiting by pointer and in reverse order is supported. Aliases: - #alias0: The value of the element. - #alias1: A pointer to the list node (ListEntry). - #alias2: The index of the element.
struct Core.ListEntry | [src] |
Represents a single node in a doubly-linked List.
prev | *ListEntry'(ListEntry.T) | Pointer to the previous node in the list. |
next | *ListEntry'(ListEntry.T) | Pointer to the next node in the list. |
value | ListEntry.T | The value stored in the node. |
struct Core.Log | [src] |
A thread-safe logger that supports multiple output writers and customizable formatting.
lock | Sync.Mutex | Lock for thread-safe access. |
buf | StrConv.StringBuilder | Internal buffer for building log messages. |
dt | Time.DateTime | Cached date/time at the moment of log call. |
writers | Array'(ILogWriter) | Registered writer interfaces. |
prefix | string | Optional prefix added to each log line. |
flags | LogFlags | Bitwise flags controlling output format. |
addWriter | Register a new writer interface. |
clearWriters | Remove all registered writers. |
create | Create a new log instance. |
getFlags | Get the logger flags. |
getPrefix | Get the logger prefix. |
Print a message to the log with an optional source location. | |
setFlags | Set the logger flags. |
setPrefix | Set the logger prefix. |
func Log.addWriter | [src] |
Register a new writer interface.
func Log.clearWriters | [src] |
Remove all registered writers.
func Log.create | [src] |
Create a new log instance.
func Log.getFlags | [src] |
Get the logger flags.
func Log.getPrefix | [src] |
Get the logger prefix.
func Log.print | [src] |
Print a message to the log with an optional source location.
func Log.setFlags | [src] |
Set the logger flags.
func Log.setPrefix | [src] |
Set the logger prefix.
enum Core.LogFlags | [src] |
Flags to control the format of log output.
Zero | No flags set. |
Prefix | Include custom prefix in log output. |
Date | Include date (YYYY/MM/DD). |
Time | Include time (HH:MM:SS:ms). |
ShortFileName | Include only the file name (exclusive with LongFileName). |
LongFileName | Include full file path (exclusive with ShortFileName). |
Line | Include only the start line number (exclusive with FullLoc). |
FullLoc | Include full location (line/col start and end). |
Default | Default logging configuration. |
namespace Core.Math |
Angle | An angle representation struct that stores angles in radians. |
Const | Structure containing mathematical constants of type T. |
Int128 | |
Matrix3x3 | |
Matrix4x4 | |
NumericArray | |
Point | A simple 2D point struct with X and Y coordinates. |
Rectangle | A simple rectangle struct with position and dimensions. |
Transform2 | 2D transformation matrix structure. |
Vector2 | A 2D vector struct representing a point or direction in 2D space. |
Vector3 | A 3D vector struct representing a point or direction in 3D space. |
Vector4 | A 4D vector struct representing a point or direction in 4D space. |
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 the current architecture's native format. |
byteswap(u16) | Reverse the byte order of the value. |
byteswap(u32) | |
byteswap(u64) | |
ceil(f32) | |
ceil(f64) | |
ceilS32 | |
ceilS64 | |
clamp | Clamp a value between a lower and upper bound. |
cos(f32) | |
cos(f64) | |
cosh(f32) | |
cosh(f64) | |
countOnes(u16) | |
countOnes(u32) | |
countOnes(u64) | |
countOnes(u8) | Returns the total number of bits set to 1 in the value. |
cubicLerp(f32, f32, f32, f32, f32) | Cubic interpolation between a, b, c, and d based on t. |
cubicLerp(f64, f64, f64, f64, f64) | |
exp(f32) | |
exp(f64) | |
exp2(f32) | |
exp2(f64) | |
floor(f32) | |
floor(f64) | |
floorS32 | |
floorS64 | |
fract(f32) | Get the fractional part. |
fract(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) | Hermite interpolation function. |
interpHermite(f64) | |
interpQuintic(f32) | Quintic interpolation function. |
interpQuintic(f64) | |
isEqualEpsilon(f32, f32, f32) | Check if x and y are approximately equal within an epsilon threshold. |
isEqualEpsilon(f64, f64, f64) | |
isFinite(f32) | Returns true if the value is finite (not infinite and not NaN). |
isFinite(f64) | Returns true if the value is finite (not infinite and not NaN). |
isNaN(f32) | Check if x is NaN (not a number). |
isNaN(f64) | |
isPowerOf2(u16) | |
isPowerOf2(u32) | |
isPowerOf2(u64) | |
isPowerOf2(u8) | |
isZeroEpsilon(f32, f32) | Check if x is approximately zero within an epsilon threshold. |
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 leading zero bits from the most significant bit. |
lerp(f32, f32, f32) | Linear interpolation between x and y based on factor. |
lerp(f64, f64, f64) | |
littleEndianToNative | Convert a little-endian integer to the current architecture's 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) | Maps val from the range [minSrc, maxSrc] to [minDst, maxDst]. |
map(f64, f64, f64, f64, f64) | |
max(T, T) | Return the larger of two values. |
max(T, T, T) | Return the largest of three values. |
max(T, T, T, T) | Return the largest of four values. |
max(f32, f32) | |
max(f64, f64) | |
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) | Return the smaller of two values. |
min(T, T, T) | Return the smallest of three values. |
min(T, T, T, T) | Return the smallest of four values. |
min(f32, f32) | |
min(f64, f64) | |
min(s16, s16) | |
min(s32, s32) | |
min(s64, s64) | |
min(s8, s8) | |
min(u16, u16) | |
min(u32, u32) | |
min(u64, u64) | |
min(u8, u8) | |
moveTowards(f32, f32, f32) | Interpolation at constant speed - moves a fixed distance per step. |
moveTowards(f64, f64, f64) | |
mulAdd(f32, f32, f32) | |
mulAdd(f64, f64, f64) | |
mulU64 | |
nativeToBigEndian | Convert a native architecture integer to big-endian format. |
pow(f32, f32) | |
pow(f64, f64) | |
powerOf10(f32) | Calculates the smallest power of 10 greater than or equal to the given number val. |
powerOf10(f64) | |
reverse(u16) | Reverse all bits in a 16-bit value. |
reverse(u32) | Reverse all bits in a 32-bit value using bit manipulation. |
reverse(u64) | Reverse all bits in a 64-bit value using bit manipulation. |
reverse(u8) | Reverse all bits in an 8-bit value using lookup table. |
rol(u16, u8) | |
rol(u32, u8) | |
rol(u64, u8) | |
rol(u8, u8) | Rotate bits left by y positions. |
ror(u16, u8) | |
ror(u32, u8) | |
ror(u64, u8) | |
ror(u8, u8) | Rotate bits right by y positions. |
round(f32) | |
round(f64) | |
roundDownToPowerOf2(u32) | |
roundDownToPowerOf2(u64) | |
roundS32 | |
roundS64 | |
roundUpToPowerOf2(u32) | |
roundUpToPowerOf2(u64) | |
saturate(f32) | Clamps x between 0 and 1. |
saturate(f64) | |
sign(f32) | Returns the sign of x (-1 for negative, 1 for positive). |
sign(f64) | |
sign(s16) | |
sign(s32) | |
sign(s64) | |
sign(s8) | |
sin(f32) | |
sin(f64) | |
sinh(f32) | |
sinh(f64) | |
smoothDamp | Perform smooth damping interpolation towards target. |
smoothstep(f32, f32, f32) | Smoothstep interpolation between edge0 and edge1. |
smoothstep(f64, f64, f64) | |
sqrt(f32) | |
sqrt(f64) | |
tan(f32) | |
tan(f64) | |
tanh(f32) | |
tanh(f64) | |
toDegrees(f32) | Convert radians to degrees. |
toDegrees(f64) | |
toRadians(f32) | |
toRadians(f64) | |
trailingZeros(u16) | |
trailingZeros(u32) | |
trailingZeros(u64) | |
trailingZeros(u8) | Returns the number of trailing zero bits from the least significant bit. |
trunc(f32) | |
trunc(f64) | |
truncS32 | |
truncS64 |
struct Math.Angle | [src] |
An angle representation struct that stores angles in radians.
rad | f32 | The angle value stored in radians. |
Provides convenient conversion between radians and degrees with literal suffix support.
toDegrees | Convert the angle from radians to degrees. |
opAffect | Assign a radian value directly to the angle. |
opAffectLiteral | Assign angle values with unit suffixes (rad or deg). |
func Angle.opAffect | [src] |
Assign a radian value directly to the angle.
Allows implicit conversion from floating-point values representing radians.
func Angle.opAffectLiteral | [src] |
Assign angle values with unit suffixes (rad or deg).
Supports literal syntax like 90deg' or 1.57rad' for convenient angle creation.
func Angle.toDegrees | [src] |
Convert the angle from radians to degrees.
Returns the angle value in degrees as a floating-point number.
struct Math.Const | [src] |
Structure containing mathematical constants of type T.
Pi | Math.Const.T | Pi constant. |
E | Math.Const.T | Euler's number. |
TwoPi | Math.Const.T | 2 times Pi. |
PiBy2 | Math.Const.T | Pi divided by 2. |
PiBy3 | Math.Const.T | Pi divided by 3. |
PiBy4 | Math.Const.T | Pi divided by 4. |
PiBy6 | Math.Const.T | Pi divided by 6. |
PiBy8 | Math.Const.T | Pi divided by 8. |
ThreePiBy4 | Math.Const.T | 3 times Pi divided by 4. |
OneByPi | Math.Const.T | Reciprocal of Pi. |
TwoByPi | Math.Const.T | 2 divided by Pi. |
Sqrt2 | Math.Const.T | Square root of 2. |
OneBySqrt2 | Math.Const.T | Reciprocal of square root of 2. |
Ln2 | Math.Const.T | Natural logarithm of 2. |
Ln10 | Math.Const.T | Natural logarithm of 10. |
Log2E | Math.Const.T | Log base 2 of Euler's number. |
Log10E | Math.Const.T | Log base 10 of Euler's number. |
Epsilon | Math.Const.T | Smallest value for floating-point precision comparisons. |
namespace Core.Math.Curve |
evaluateBezier(const &Vector2, const &Vector2, const &Vector2, const &Vector2, f32) | Evaluate a cubic Bézier curve at parameter t. |
evaluateBezier(const &Vector2, const &Vector2, const &Vector2, f32) | Evaluate a quadratic Bézier curve at parameter t. |
evaluatePolynomial | Evaluate a cubic polynomial at parameter t. |
getBezierBoundingBox(const &Vector2, const &Vector2, const &Vector2) | Calculate the axis-aligned bounding box of a quadratic Bézier curve. |
getBezierBoundingBox(const &Vector2, const &Vector2, const &Vector2, const &Vector2) | Calculate the axis-aligned bounding box of a cubic Bézier curve. |
func Curve.evaluateBezier | [src] |
Evaluate a quadratic Bézier curve at parameter t.
Formula: (1-t)²start + 2t(1-t)ctrl + t²end where t ranges from 0.0 to 1.0.
Evaluate a cubic Bézier curve at parameter t.
Formula: (1-t)³start + 3t(1-t)²ctrl1 + 3t²(1-t)ctrl2 + t³end where t ranges from 0.0 to 1.0.
func Curve.evaluatePolynomial | [src] |
Evaluate a cubic polynomial at parameter t.
Uses Horner's method for efficient computation: P(t) = ((p0t + p1)t + p2)t + p3.
func Curve.getBezierBoundingBox | [src] |
Calculate the axis-aligned bounding box of a cubic Bézier curve.
Finds extrema by solving the derivative equation and evaluating the curve at critical points.
Calculate the axis-aligned bounding box of a quadratic Bézier curve.
Finds extrema by solving the linear derivative equation for critical points.
namespace Core.Math.Geometry |
distanceToLine | Calculate the perpendicular distance from a point to an infinite line. |
distanceToSegment | Calculate the shortest distance from a point to a line segment. |
isInEllipse | Test if a point is inside an ellipse. |
isInTriangle | Test if a point is inside a triangle using cross product method. |
lineLineIntersect | Find the intersection point of two infinite lines. |
nearestPointsSegSeg | Find the closest points between two line segments and their distance. |
polyContains | Test if a point is inside a polygon using ray casting algorithm. |
segSegIntersect | Find the intersection point of two line segments. |
func Geometry.distanceToLine | [src] |
Calculate the perpendicular distance from a point to an infinite line.
Projects the point onto the line and returns the distance to the projection.
func Geometry.distanceToSegment | [src] |
Calculate the shortest distance from a point to a line segment.
Handles endpoints by clamping the projection to the segment bounds.
func Geometry.isInEllipse | [src] |
Test if a point is inside an ellipse.
Uses the standard ellipse equation: (x-cx)²/rx² + (y-cy)²/ry² ≤ 1.
func Geometry.isInTriangle | [src] |
Test if a point is inside a triangle using cross product method.
Uses barycentric coordinates by checking if all cross products have the same sign.
func Geometry.lineLineIntersect | [src] |
Find the intersection point of two infinite lines.
Returns the intersection point if lines are not parallel, otherwise returns failure.
func Geometry.nearestPointsSegSeg | [src] |
Find the closest points between two line segments and their distance.
Implementation based on David Eberly's Geometric Tools library algorithm.
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/Documentation/DistanceSegments3D.pdf https://www.geometrictools.com/GTE/Mathematics/DistSegmentSegment.h
func Geometry.polyContains | [src] |
Test if a point is inside a polygon using ray casting algorithm.
Implementation of the PNPoly algorithm by W. Randolph Franklin.
func Geometry.segSegIntersect | [src] |
Find the intersection point of two line segments.
Returns the intersection point only if it lies within both segment bounds.
struct Math.Int128 | [src] |
lo | u64 | |
hi | s64 |
mul |
opCast | |
opCmp |
func Int128.mul | [src] |
func Int128.opCast | [src] |
func Int128.opCmp | [src] |
struct Math.Matrix3x3 | [src] |
m | [3,3] f32 |
setIdentity |
func Matrix3x3.setIdentity | [src] |
struct Math.Matrix4x4 | [src] |
m | [4,4] f32 |
setIdentity |
func Matrix4x4.setIdentity | [src] |
struct Math.NumericArray | [src] |
buf | [?] Math.NumericArray.T |
from | |
mulAdd(me, T, T) | Multiply & add. |
mulAdd(me, const &NumericArray'(T, N), const &NumericArray'(T, N)) | Multiply & Add. |
set | Set all values. |
opAffect(me, T) | |
opAffect(me, const [..] T) | |
opAssign(me, T) | |
opAssign(me, const &NumericArray'(T, N)) | |
opBinary | |
opEquals | |
opIndex |
func NumericArray.from | [src] |
func NumericArray.mulAdd | [src] |
Multiply & add.
Multiply & Add.
func NumericArray.opAffect | [src] |
func NumericArray.opAssign | [src] |
func NumericArray.opBinary | [src] |
func NumericArray.opEquals | [src] |
func NumericArray.opIndex | [src] |
func NumericArray.set | [src] |
Set all values.
struct Math.Point | [src] |
A simple 2D point struct with X and Y coordinates.
x | f32 | X coordinate of the point. |
y | f32 | Y coordinate of the point. |
Contains x and y components as 32-bit floating point values for representing positions in 2D space.
ceil | Round both coordinates up to the next integer values. |
clear | Set both coordinates to zero. |
isEqualEpsilon | Returns true if this point is equal to other within an epsilon tolerance. |
isZero | Returns true if this point is exactly at the origin. |
isZeroEpsilon | Returns true if this point is at the origin within an epsilon tolerance. |
offset(me, f32) | Offset both coordinates by the same scalar value. |
offset(me, f32, f32) | Offset this point by separate x and y values. |
round | Round both coordinates to the nearest integer values. |
trunc | Truncate both coordinates to integer values. |
opAffect | Set both coordinates to the same scalar value. |
opAssign(me, const &Point) | Compound assignment operators for point-point operations (+=, -=, =, /=). |
opAssign(me, f32) | Compound assignment operators for point-scalar operations (+=, -=, =, /=). |
opBinary(me, const &Point) | Binary operators for point-point operations (+, -, , /). |
opBinary(me, f32) | Binary operators for point-scalar operations (+, -, , /). |
opUnary | Apply unary operations to the point. |
func Point.ceil | [src] |
Round both coordinates up to the next integer values.
Applies Math.ceil function to both x and y coordinates in-place.
func Point.clear | [src] |
Set both coordinates to zero.
Equivalent to assigning the Zero constant but modifies the current instance.
func Point.isEqualEpsilon | [src] |
Returns true if this point is equal to other within an epsilon tolerance.
Compares each coordinate separately using the specified eps tolerance.
func Point.isZero | [src] |
Returns true if this point is exactly at the origin.
Performs exact floating-point comparison, which may not work well with computed values.
func Point.isZeroEpsilon | [src] |
Returns true if this point is at the origin within an epsilon tolerance.
Uses eps parameter to handle floating-point precision issues.
func Point.offset | [src] |
Offset both coordinates by the same scalar value.
Adds value to both x and y coordinates of this point.
Offset this point by separate x and y values.
Adds the specified x and y offsets to the corresponding coordinates.
func Point.opAffect | [src] |
Set both coordinates to the same scalar value.
This allows assignment like 'point = 5.0' to set both coordinates to 5.0.
func Point.opAssign | [src] |
Compound assignment operators for point-point operations (+=, -=, =, /=).
Performs component-wise operations with another point.
Compound assignment operators for point-scalar operations (+=, -=, =, /=).
Applies the scalar value to both coordinates of the point.
func Point.opBinary | [src] |
Binary operators for point-point operations (+, -, , /).
Performs component-wise operations between two points and returns the result.
Binary operators for point-scalar operations (+, -, , /).
Applies the scalar value to both coordinates and returns the result.
func Point.opUnary | [src] |
Apply unary operations to the point.
Currently supports negation (-) to return a point with both coordinates negated.
func Point.round | [src] |
Round both coordinates to the nearest integer values.
Applies Math.round function to both x and y coordinates in-place.
func Point.trunc | [src] |
Truncate both coordinates to integer values.
Applies Math.trunc function to both x and y coordinates, removing fractional parts.
struct Math.Rectangle | [src] |
A simple rectangle struct with position and dimensions.
x | f32 | Left position. |
y | f32 | Top position. |
width | f32 | Rectangle width. |
height | f32 | Rectangle height. |
Represents an axis-aligned rectangle using top-left position and width/height dimensions.
applyPadding | Apply padding to all sides of the rectangle. |
area | Get the area of the rectangle. |
aspectRatio | Get the aspect ratio of the rectangle. |
bottom | Get the bottom edge coordinate. |
bottomLeft | Get the bottom-left corner point. |
bottomRight | Get the bottom-right corner point. |
ceil | Round all rectangle components up to the next integer values. |
center | Get the center point of the rectangle. |
clampPoint | Clamp a point to be within the rectangle bounds. |
clear | Set all rectangle components to zero. |
contains(me, const &Point) | Test if the specified point is contained within the rectangle. |
contains(me, const &Rectangle) | Test if the specified rectangle is entirely contained within this rectangle. |
contains(me, f32, f32) | Test if the specified coordinates are contained within the rectangle. |
createFittedWithin | Create a rectangle that fits within bounds while maintaining aspect ratio. |
distanceToPoint | Get the distance from a point to the rectangle. |
expandToInclude(me, const &Point) | Expand the rectangle to include a point. |
expandToInclude(me, const &Rectangle) | Expand the rectangle to include another rectangle. |
fitWithin | Fit this rectangle within bounds while maintaining aspect ratio. |
getUnion | Create a rectangle representing the union of two rectangles. |
horzCenter | Get the horizontal center coordinate. |
inflate(me, f32) | Inflate the rectangle uniformly in all directions. |
inflate(me, f32, f32) | Inflate the rectangle by different amounts horizontally and vertically. |
intersect(me, const &Rectangle) | Intersect this rectangle with another rectangle in-place. |
intersect(const &Rectangle, const &Rectangle) | Create a rectangle representing the intersection of two rectangles. |
intersectWith | Test if this rectangle intersects with another rectangle. |
isEmpty | Returns true if the rectangle has zero area. |
isEmptyEpsilon | Returns true if the rectangle has zero area within epsilon tolerance. |
isEqualEpsilon | Returns true if this rectangle equals other within epsilon tolerance. |
isNormalized | Returns true if the rectangle has non-negative dimensions. |
isZero | Returns true if all rectangle components are exactly zero. |
isZeroEpsilon | Returns true if all rectangle components are zero within epsilon tolerance. |
moveBottom | Extend the bottom edge downward by the specified amount. |
moveLeft | Move the left edge inward by the specified amount. |
moveRight | Extend the right edge outward by the specified amount. |
moveTop | Move the top edge downward by the specified amount. |
normalize | Normalize the rectangle to ensure positive width and height. |
offset(me, const &Point) | Offset the rectangle position by a point vector. |
offset(me, f32) | Offset the rectangle position by the same amount in both directions. |
offset(me, f32, f32) | Offset the rectangle position by separate x and y amounts. |
perimeter | Get the perimeter of the rectangle. |
right | Get the right edge coordinate. |
round | Round all rectangle components to the nearest integer values. |
scale(me, f32) | Scale the rectangle dimensions uniformly. |
scale(me, f32, f32) | Scale the rectangle dimensions independently. |
set | Initialize the rectangle using two corner points. |
setBottom | Set the bottom edge coordinate by adjusting the height. |
setRight | Set the right edge coordinate by adjusting the width. |
setSize | Set the size of the rectangle. |
setUnion | Set this rectangle to the union with another rectangle. |
size | Get the size of the rectangle as a point. |
toNormalized | Get a normalized copy of the rectangle. |
topLeft | Get the top-left corner point. |
topRight | Get the top-right corner point. |
trunc | Truncate all rectangle components to integer values. |
vertCenter | Get the vertical center coordinate. |
opBinary | Scale the rectangle by a scalar value. |
opEquals | Check if this rectangle is exactly equal to another rectangle. |
func Rectangle.applyPadding | [src] |
Apply padding to all sides of the rectangle.
Uses Vector4 components as left, top, right, bottom padding values respectively.
func Rectangle.area | [src] |
Get the area of the rectangle.
Calculated as width × height, may be negative for non-normalized rectangles.
func Rectangle.aspectRatio | [src] |
Get the aspect ratio of the rectangle.
Returns width / height, or 0 if height is zero.
func Rectangle.bottom | [src] |
Get the bottom edge coordinate.
Calculated as y + height.
func Rectangle.bottomLeft | [src] |
Get the bottom-left corner point.
Returns a Point at (x, y + height).
func Rectangle.bottomRight | [src] |
Get the bottom-right corner point.
Returns a Point at (x + width, y + height).
func Rectangle.ceil | [src] |
Round all rectangle components up to the next integer values.
Applies Math.ceil function to all components in-place.
func Rectangle.center | [src] |
Get the center point of the rectangle.
Returns a Point containing the horizontal and vertical center coordinates.
func Rectangle.clampPoint | [src] |
Clamp a point to be within the rectangle bounds.
Returns the closest point inside or on the rectangle boundary.
func Rectangle.clear | [src] |
Set all rectangle components to zero.
Equivalent to assigning the Zero constant but modifies the current instance.
func Rectangle.contains | [src] |
Test if the specified coordinates are contained within the rectangle.
Uses half-open interval [x, x+width) × [y, y+height) for containment test.
Test if the specified point is contained within the rectangle.
Delegates to the coordinate-based contains method.
Test if the specified rectangle is entirely contained within this rectangle.
Returns true only if rect is completely inside the bounds of this rectangle.
func Rectangle.createFittedWithin | [src] |
Create a rectangle that fits within bounds while maintaining aspect ratio.
Returns a new rectangle scaled to fit inside bounds without distortion.
func Rectangle.distanceToPoint | [src] |
Get the distance from a point to the rectangle.
Returns 0 if the point is inside the rectangle, otherwise returns the shortest distance to the boundary.
func Rectangle.expandToInclude | [src] |
Expand the rectangle to include a point.
Grows the rectangle if necessary to contain the specified point.
Expand the rectangle to include another rectangle.
Grows the rectangle if necessary to contain the entire specified rectangle.
func Rectangle.fitWithin | [src] |
Fit this rectangle within bounds while maintaining aspect ratio.
Scales the rectangle to fit inside bounds without distortion.
func Rectangle.getUnion | [src] |
Create a rectangle representing the union of two rectangles.
Returns the smallest rectangle that completely contains both a and b.
func Rectangle.horzCenter | [src] |
Get the horizontal center coordinate.
Calculated as x + width / 2.
func Rectangle.inflate | [src] |
Inflate the rectangle uniformly in all directions.
Expands the rectangle by value on all sides, moving position and increasing dimensions.
Inflate the rectangle by different amounts horizontally and vertically.
Expands by x horizontally and y vertically on all sides.
func Rectangle.intersect | [src] |
Intersect this rectangle with another rectangle in-place.
Modifies this rectangle to contain only the overlapping area with other.
Create a rectangle representing the intersection of two rectangles.
Returns the overlapping area between a and b, or Zero if no intersection exists.
func Rectangle.intersectWith | [src] |
Test if this rectangle intersects with another rectangle.
Returns true if there is any overlap between the two rectangles.
func Rectangle.isEmpty | [src] |
Returns true if the rectangle has zero area.
A rectangle is empty if either width or height is zero.
func Rectangle.isEmptyEpsilon | [src] |
Returns true if the rectangle has zero area within epsilon tolerance.
Checks if both width and height are zero within the specified tolerance.
func Rectangle.isEqualEpsilon | [src] |
Returns true if this rectangle equals other within epsilon tolerance.
Compares all four components separately using the specified eps tolerance.
func Rectangle.isNormalized | [src] |
Returns true if the rectangle has non-negative dimensions.
A normalized rectangle has width and height greater than or equal to zero.
func Rectangle.isZero | [src] |
Returns true if all rectangle components are exactly zero.
Performs exact floating-point comparison, which may not work well with computed values.
func Rectangle.isZeroEpsilon | [src] |
Returns true if all rectangle components are zero within epsilon tolerance.
Uses eps parameter to handle floating-point precision issues.
func Rectangle.moveBottom | [src] |
Extend the bottom edge downward by the specified amount.
Increases height by value, extending the rectangle downward.
func Rectangle.moveLeft | [src] |
Move the left edge inward by the specified amount.
Increases x and decreases width by value, effectively shrinking from the left.
func Rectangle.moveRight | [src] |
Extend the right edge outward by the specified amount.
Increases width by value, extending the rectangle to the right.
func Rectangle.moveTop | [src] |
Move the top edge downward by the specified amount.
Increases y and decreases height by value, effectively shrinking from the top.
func Rectangle.normalize | [src] |
Normalize the rectangle to ensure positive width and height.
Adjusts position and dimensions if width or height are negative.
func Rectangle.offset | [src] |
Offset the rectangle position by the same amount in both directions.
Adds offsetXY to both x and y coordinates without changing dimensions.
Offset the rectangle position by separate x and y amounts.
Adds offsetX to x coordinate and offsetY to y coordinate.
Offset the rectangle position by a point vector.
Adds the point's x and y components to the rectangle's position.
func Rectangle.opBinary | [src] |
Scale the rectangle by a scalar value.
Multiplies all components (position and dimensions) by the given value.
func Rectangle.opEquals | [src] |
Check if this rectangle is exactly equal to another rectangle.
Performs exact floating-point comparison of all four components.
func Rectangle.perimeter | [src] |
Get the perimeter of the rectangle.
Calculated as 2 × (width + height).
func Rectangle.right | [src] |
Get the right edge coordinate.
Calculated as x + width.
func Rectangle.round | [src] |
Round all rectangle components to the nearest integer values.
Applies Math.round function to position and dimension components in-place.
func Rectangle.scale | [src] |
Scale the rectangle dimensions uniformly.
Multiplies both width and height by value without changing position.
Scale the rectangle dimensions independently.
Multiplies width by x and height by y without changing position.
func Rectangle.set | [src] |
Initialize the rectangle using two corner points.
Automatically handles the case where points are not in top-left/bottom-right order.
func Rectangle.setBottom | [src] |
Set the bottom edge coordinate by adjusting the height.
Modifies height to make the bottom edge equal to value.
func Rectangle.setRight | [src] |
Set the right edge coordinate by adjusting the width.
Modifies width to make the right edge equal to value.
func Rectangle.setSize | [src] |
Set the size of the rectangle.
Modifies width and height without changing position.
func Rectangle.setUnion | [src] |
Set this rectangle to the union with another rectangle.
Modifies this rectangle to be the smallest rectangle containing both this and other.
func Rectangle.size | [src] |
Get the size of the rectangle as a point.
Returns a Point containing width and height values.
func Rectangle.toNormalized | [src] |
Get a normalized copy of the rectangle.
Returns a new rectangle with positive width and height without modifying the original.
func Rectangle.topLeft | [src] |
Get the top-left corner point.
Returns a Point containing the x and y coordinates.
func Rectangle.topRight | [src] |
Get the top-right corner point.
Returns a Point at (x + width, y).
func Rectangle.trunc | [src] |
Truncate all rectangle components to integer values.
Applies Math.trunc function to all components, removing fractional parts.
func Rectangle.vertCenter | [src] |
Get the vertical center coordinate.
Calculated as y + height / 2.
struct Math.Transform2 | [src] |
2D transformation matrix structure.
m11 | f32 | First row of the 2D transformation matrix. |
m12 | f32 | |
m21 | f32 | Second row of the 2D transformation matrix. |
m22 | f32 | |
m31 | f32 | Translation components of the transformation. |
m32 | f32 | |
m | [2,2] f32 | 2x2 matrix view for rotation/scale components. |
tx | f32 | Translation component along X-axis. |
ty | f32 | Translation component along Y-axis. |
createRotation | Creates a rotation matrix, with a given center of rotation. |
createScale | Creates a scale matrix, with a given center. |
createTranslation | Creates a translation matrix. |
getTranslation | Gets the translation components. |
isIdentity | Checks if the transform is the identity matrix. |
multiply | Multiplies the current transform by another transformation matrix. |
setIdentity | Set transform to identity. |
setTranslation | Sets the translation components directly. |
transformPoint | Applies the transform to a 2D point. |
func Transform2.createRotation | [src] |
Creates a rotation matrix, with a given center of rotation.
func Transform2.createScale | [src] |
Creates a scale matrix, with a given center.
func Transform2.createTranslation | [src] |
Creates a translation matrix.
func Transform2.getTranslation | [src] |
Gets the translation components.
func Transform2.isIdentity | [src] |
Checks if the transform is the identity matrix.
func Transform2.multiply | [src] |
Multiplies the current transform by another transformation matrix.
func Transform2.setIdentity | [src] |
Set transform to identity.
func Transform2.setTranslation | [src] |
Sets the translation components directly.
func Transform2.transformPoint | [src] |
Applies the transform to a 2D point.
struct Math.Vector2 | [src] |
A 2D vector struct representing a point or direction in 2D space.
x | f32 | X and Y components of the vector. |
y | f32 |
Contains x and y components as 32-bit floating point values.
angle0To2Pi | Returns the angle between this vector and other in the range [0, 2π]. |
angleTo | Returns the angle between this vector and other in radians. |
ceil | Apply ceiling function to both components in-place. |
clamp | Clamp this vector's components between min and max values. |
clampLength | Clamp this vector's length to be within minLength and maxLength. |
clampedLength | Returns a new vector with length clamped between minLength and maxLength. |
cosAngleTo | Returns the cosine of the angle between this vector and other. |
cross(me, const &Vector2) | Returns the Z component of the cross product (scalar cross product in 2D). |
cross(me, f32) | Returns the perpendicular vector in the 2D plane scaled by axis. |
distanceTo | Returns the Euclidean distance between this vector and dest. |
distanceToSquared | Returns the squared distance between this vector and dest. |
dot | Returns the dot product between this vector and other. |
floor | Apply floor function to both components in-place. |
fromPolar | Create a vector from polar coordinates. |
isEqualEpsilon | Returns true if this vector is equal to other within an epsilon tolerance. |
isFinite | Returns true if all components are finite (not infinite or NaN). |
isNaN | Returns true if any component is NaN (Not a Number). |
isZero | Returns true if this vector is exactly zero. |
isZeroEpsilon | Returns true if this vector is zero within an epsilon tolerance. |
length | Returns the length (magnitude) of the vector. |
lengthSquared | Returns the squared length of the vector. |
lerpTo | Perform linear interpolation between two vectors. |
makeAbs | Apply absolute value to both components in-place. |
max | Returns a vector containing the maximum components of two vectors. |
min | Returns a vector containing the minimum components of two vectors. |
moveTowards | Move this vector towards target by a maximum distance of maxDistance. |
negate | Negate the vector in-place. |
normalize | Normalize this vector in-place to unit length. |
normalizeSafe | Normalize this vector in-place safely. |
rotateBy | Rotate the vector by a given angle around the origin. |
round | Apply rounding function to both components in-place. |
set | Set both components of the vector. |
setAngle | Rotate this vector to face the specified angle in radians. |
setLength | Set the vector to the specified length. |
setLengthSafe | Set the vector to the specified length safely. |
setZero | Set both vector components to zero. |
smoothDamp | Perform smooth damping interpolation towards target. |
toAbs | Returns the absolute value of each component. |
toAngle | Returns the angle of this vector in radians. |
toClamped | Returns a new vector with components clamped between min and max values. |
toMovedTowards | Returns a vector moved towards target by a maximum distance of maxDistance. |
toNormalized | Returns this vector normalized to unit length without modifying the original. |
toNormalizedSafe | Returns this vector normalized safely without modifying the original. |
toPerp | Returns a vector perpendicular to this one (rotated 90 degrees counter-clockwise). |
toPerpCW | Returns a vector perpendicular to this one (rotated 90 degrees clockwise). |
toPolar | Convert this vector to polar coordinates. |
toProject | Project this vector onto other vector. |
toReflect | Reflect this vector across a surface with the given normal. |
toSign | Returns the component-wise sign of the vector (-1, 0, or 1 for each component). |
opAffect | Set both components to the same scalar value. |
opAssign(me, const &Vector2) | Compound assignment operators for vector-vector operations (+=, -=, =, /=). |
opAssign(me, f32) | Compound assignment operators for vector-scalar operations (+=, -=, =, /=). |
opBinary(me, const &Vector2) | Binary operators for vector-vector operations (+, -, , /). |
opBinary(me, f32) | Binary operators for vector-scalar operations (+, -, , /). |
opUnary | Apply unary operations to the vector. |
func Vector2.angle0To2Pi | [src] |
Returns the angle between this vector and other in the range [0, 2π].
Uses the cross product to determine the sign and adjust the angle accordingly.
func Vector2.angleTo | [src] |
Returns the angle between this vector and other in radians.
The result is in the range [0, π] using the arc cosine of the normalized dot product.
func Vector2.ceil | [src] |
Apply ceiling function to both components in-place.
Rounds each component up to the nearest integer value.
func Vector2.clamp | [src] |
Clamp this vector's components between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector2.clampLength | [src] |
Clamp this vector's length to be within minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector2.clampedLength | [src] |
Returns a new vector with length clamped between minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector2.cosAngleTo | [src] |
Returns the cosine of the angle between this vector and other.
Calculated using the dot product formula: dot(a,b) / (|a| * |b|).
func Vector2.cross | [src] |
Returns the perpendicular vector in the 2D plane scaled by axis.
The axis parameter determines the sign and scale of the result.
Returns the Z component of the cross product (scalar cross product in 2D).
Calculates the determinant of the 2x2 matrix formed by the two vectors.
func Vector2.distanceTo | [src] |
Returns the Euclidean distance between this vector and dest.
Calculated as the length of the difference vector between the two positions.
func Vector2.distanceToSquared | [src] |
Returns the squared distance between this vector and dest.
Faster than distance() when only comparing distances since it avoids the square root operation.
func Vector2.dot | [src] |
Returns the dot product between this vector and other.
The dot product is calculated as: (x₁ × x₂) + (y₁ × y₂).
func Vector2.floor | [src] |
Apply floor function to both components in-place.
Rounds each component down to the nearest integer value.
func Vector2.fromPolar | [src] |
Create a vector from polar coordinates.
angle is in radians, radius is the distance from origin.
func Vector2.isEqualEpsilon | [src] |
Returns true if this vector is equal to other within an epsilon tolerance.
Compares each component separately using the specified eps tolerance.
func Vector2.isFinite | [src] |
Returns true if all components are finite (not infinite or NaN).
Useful for validating vector values after calculations.
func Vector2.isNaN | [src] |
Returns true if any component is NaN (Not a Number).
Useful for detecting invalid vector values after calculations.
func Vector2.isZero | [src] |
Returns true if this vector is exactly zero.
Performs exact floating-point comparison, which may not work well with computed values.
func Vector2.isZeroEpsilon | [src] |
Returns true if this vector is zero within an epsilon tolerance.
Uses eps parameter to handle floating-point precision issues.
func Vector2.length | [src] |
Returns the length (magnitude) of the vector.
Calculated using the Euclidean distance formula: sqrt(x² + y²).
func Vector2.lengthSquared | [src] |
Returns the squared length of the vector.
Faster than length() when only comparing magnitudes since it avoids the square root operation.
func Vector2.lerpTo | [src] |
Perform linear interpolation between two vectors.
Interpolates each component separately using the given factor (0.0 to 1.0). When factor is 0.0, returns src; when 1.0, returns dst.
func Vector2.makeAbs | [src] |
Apply absolute value to both components in-place.
Makes both components positive by removing their sign.
func Vector2.max | [src] |
Returns a vector containing the maximum components of two vectors.
Each component of the result is the larger of the corresponding components in a and b.
func Vector2.min | [src] |
Returns a vector containing the minimum components of two vectors.
Each component of the result is the smaller of the corresponding components in a and b.
func Vector2.moveTowards | [src] |
Move this vector towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, moves directly to target.
func Vector2.negate | [src] |
Negate the vector in-place.
Multiplies both components by -1, effectively reversing the vector direction.
func Vector2.normalize | [src] |
Normalize this vector in-place to unit length.
Sets the vector's length to 1 while preserving its direction. Asserts that the vector is not zero.
func Vector2.normalizeSafe | [src] |
Normalize this vector in-place safely.
Sets the vector to unit length, or to zero if the original length is near zero.
func Vector2.opAffect | [src] |
Set both components to the same scalar value.
This allows assignment like 'vec = 5.0' to set both components to 5.0.
func Vector2.opAssign | [src] |
Compound assignment operators for vector-vector operations (+=, -=, =, /=).
Performs component-wise operations with another vector.
Compound assignment operators for vector-scalar operations (+=, -=, =, /=).
Applies the scalar value to both components of the vector.
func Vector2.opBinary | [src] |
Binary operators for vector-vector operations (+, -, , /).
Performs component-wise operations between two vectors and returns the result.
Binary operators for vector-scalar operations (+, -, , /).
Applies the scalar value to both components and returns the result.
func Vector2.opUnary | [src] |
Apply unary operations to the vector.
Currently supports negation (-) to return a vector with both components negated.
func Vector2.rotateBy | [src] |
Rotate the vector by a given angle around the origin.
Uses standard 2D rotation matrix transformation with the specified angle.
func Vector2.round | [src] |
Apply rounding function to both components in-place.
Rounds each component to the nearest integer value.
func Vector2.set | [src] |
Set both components of the vector.
Parameters x and y specify the new component values.
func Vector2.setAngle | [src] |
Rotate this vector to face the specified angle in radians.
Preserves the vector's magnitude while changing its direction.
func Vector2.setLength | [src] |
Set the vector to the specified length.
First normalizes the vector, then scales it to newLength. Assumes the vector is not zero.
func Vector2.setLengthSafe | [src] |
Set the vector to the specified length safely.
First normalizes the vector safely, then scales it to newLength. Handles zero-length vectors.
func Vector2.setZero | [src] |
Set both vector components to zero.
Equivalent to assigning the Zero constant but modifies the current instance.
func Vector2.smoothDamp | [src] |
Perform smooth damping interpolation towards target.
Uses smoothTime and deltaTime for frame-rate independent smooth movement. currentVelocity is modified to track the current rate of change.
func Vector2.toAbs | [src] |
Returns the absolute value of each component.
Creates a new vector where each component is its absolute value.
func Vector2.toAngle | [src] |
Returns the angle of this vector in radians.
The angle is measured from the positive X-axis, counter-clockwise.
func Vector2.toClamped | [src] |
Returns a new vector with components clamped between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector2.toMovedTowards | [src] |
Returns a vector moved towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, returns the target directly.
func Vector2.toNormalized | [src] |
Returns this vector normalized to unit length without modifying the original.
Creates a new vector with length 1 in the same direction. Asserts that the vector is not zero.
func Vector2.toNormalizedSafe | [src] |
Returns this vector normalized safely without modifying the original.
Returns a unit vector in the same direction, or the zero vector if length is near zero.
func Vector2.toPerp | [src] |
Returns a vector perpendicular to this one (rotated 90 degrees counter-clockwise).
The perpendicular vector has the same length but is rotated 90° CCW.
func Vector2.toPerpCW | [src] |
Returns a vector perpendicular to this one (rotated 90 degrees clockwise).
The perpendicular vector has the same length but is rotated 90° CW.
func Vector2.toPolar | [src] |
Convert this vector to polar coordinates.
Returns angle in radians and radius (magnitude) as a tuple-like struct.
func Vector2.toProject | [src] |
Project this vector onto other vector.
Returns the component of this vector in the direction of other.
func Vector2.toReflect | [src] |
Reflect this vector across a surface with the given normal.
The normal should be a unit vector pointing away from the surface.
func Vector2.toSign | [src] |
Returns the component-wise sign of the vector (-1, 0, or 1 for each component).
Each component becomes -1 if negative, 0 if zero, or 1 if positive.
struct Math.Vector3 | [src] |
A 3D vector struct representing a point or direction in 3D space.
x | f32 | X, Y, and Z components of the vector. |
y | f32 | |
z | f32 |
Contains x, y, and z components as 32-bit floating point values.
angleTo | Returns the angle between this vector and other in radians. |
ceil | Apply ceiling function to all components in-place. |
clamp | Clamp this vector's components between min and max values. |
clampLength | Clamp this vector's length to be within minLength and maxLength. |
clampedLength | Returns a new vector with length clamped between minLength and maxLength. |
cosAngleTo | Returns the cosine of the angle between this vector and other. |
cross | Returns the cross product between this vector and other. |
distanceTo | Returns the Euclidean distance between this vector and dest. |
distanceToSquared | Returns the squared distance between this vector and dest. |
dot | Returns the dot product between this vector and other. |
floor | Apply floor function to all components in-place. |
fromCylindrical | Create a vector from cylindrical coordinates. |
fromSpherical | Create a vector from spherical coordinates. |
isEqualEpsilon | Returns true if this vector is equal to other within an epsilon tolerance. |
isFinite | Returns true if all components are finite (not infinite or NaN). |
isNaN | Returns true if any component is NaN (Not a Number). |
isZero | Returns true if this vector is exactly zero. |
isZeroEpsilon | Returns true if this vector is zero within an epsilon tolerance. |
length | Returns the length (magnitude) of the vector. |
lengthSquared | Returns the squared length of the vector. |
lerpTo | Perform linear interpolation between two vectors. |
makeAbs | Apply absolute value to all components in-place. |
max | Returns a vector containing the maximum components of two vectors. |
min | Returns a vector containing the minimum components of two vectors. |
moveTowards | Move this vector towards target by a maximum distance of maxDistance. |
negate | Negate the vector in-place. |
normalize | Normalize this vector in-place to unit length. |
normalizeSafe | Normalize this vector in-place safely. |
round | Apply rounding function to all components in-place. |
set | Set all three components of the vector. |
setLength | Set the vector to the specified length. |
setLengthSafe | Set the vector to the specified length safely. |
setZero | Set all vector components to zero. |
smoothDamp | Perform smooth damping interpolation towards target. |
toAbs | Returns the absolute value of each component. |
toClamped | Returns a new vector with components clamped between min and max values. |
toCylindrical | Convert this vector to cylindrical coordinates. |
toMovedTowards | Returns a vector moved towards target by a maximum distance of maxDistance. |
toNormalized | Returns this vector normalized to unit length without modifying the original. |
toNormalizedSafe | Returns this vector normalized safely without modifying the original. |
toProject | Project this vector onto other vector. |
toReflect | Reflect this vector across a surface with the given normal. |
toSign | Returns the component-wise sign of the vector (-1, 0, or 1 for each component). |
toSpherical | Convert this vector to spherical coordinates. |
opAffect | Set all components to the same scalar value. |
opAssign(me, const &Vector3) | Compound assignment operators for vector-vector operations (+=, -=, =, /=). |
opAssign(me, f32) | Compound assignment operators for vector-scalar operations (+=, -=, =, /=). |
opBinary(me, const &Vector3) | Binary operators for vector-vector operations (+, -, , /). |
opBinary(me, f32) | Binary operators for vector-scalar operations (+, -, , /). |
opUnary | Apply unary operations to the vector. |
func Vector3.angleTo | [src] |
Returns the angle between this vector and other in radians.
The result is in the range [0, π] using the arc cosine of the normalized dot product.
func Vector3.ceil | [src] |
Apply ceiling function to all components in-place.
Rounds each component up to the nearest integer value.
func Vector3.clamp | [src] |
Clamp this vector's components between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector3.clampLength | [src] |
Clamp this vector's length to be within minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector3.clampedLength | [src] |
Returns a new vector with length clamped between minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector3.cosAngleTo | [src] |
Returns the cosine of the angle between this vector and other.
Calculated using the dot product formula: dot(a,b) / (|a| * |b|).
func Vector3.cross | [src] |
Returns the cross product between this vector and other.
The cross product produces a vector perpendicular to both input vectors.
func Vector3.distanceTo | [src] |
Returns the Euclidean distance between this vector and dest.
Calculated as the length of the difference vector between the two positions.
func Vector3.distanceToSquared | [src] |
Returns the squared distance between this vector and dest.
Faster than distance() when only comparing distances since it avoids the square root operation.
func Vector3.dot | [src] |
Returns the dot product between this vector and other.
The dot product is calculated as: (x₁ × x₂) + (y₁ × y₂) + (z₁ × z₂).
func Vector3.floor | [src] |
Apply floor function to all components in-place.
Rounds each component down to the nearest integer value.
func Vector3.fromCylindrical | [src] |
Create a vector from cylindrical coordinates.
theta is the angle in radians, radius is the distance from the z-axis, height is the z-component.
func Vector3.fromSpherical | [src] |
Create a vector from spherical coordinates.
theta is azimuthal angle in radians, phi is polar angle in radians, radius is the distance from origin.
func Vector3.isEqualEpsilon | [src] |
Returns true if this vector is equal to other within an epsilon tolerance.
Compares each component separately using the specified eps tolerance.
func Vector3.isFinite | [src] |
Returns true if all components are finite (not infinite or NaN).
Useful for validating vector values after calculations.
func Vector3.isNaN | [src] |
Returns true if any component is NaN (Not a Number).
Useful for detecting invalid vector values after calculations.
func Vector3.isZero | [src] |
Returns true if this vector is exactly zero.
Performs exact floating-point comparison, which may not work well with computed values.
func Vector3.isZeroEpsilon | [src] |
Returns true if this vector is zero within an epsilon tolerance.
Uses eps parameter to handle floating-point precision issues.
func Vector3.length | [src] |
Returns the length (magnitude) of the vector.
Calculated using the Euclidean distance formula: sqrt(x² + y² + z²).
func Vector3.lengthSquared | [src] |
Returns the squared length of the vector.
Faster than length() when only comparing magnitudes since it avoids the square root operation.
func Vector3.lerpTo | [src] |
Perform linear interpolation between two vectors.
Interpolates each component separately using the given factor (0.0 to 1.0). When factor is 0.0, returns src; when 1.0, returns dst.
func Vector3.makeAbs | [src] |
Apply absolute value to all components in-place.
Makes all components positive by removing their sign.
func Vector3.max | [src] |
Returns a vector containing the maximum components of two vectors.
Each component of the result is the larger of the corresponding components in a and b.
func Vector3.min | [src] |
Returns a vector containing the minimum components of two vectors.
Each component of the result is the smaller of the corresponding components in a and b.
func Vector3.moveTowards | [src] |
Move this vector towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, moves directly to target.
func Vector3.negate | [src] |
Negate the vector in-place.
Multiplies all components by -1, effectively reversing the vector direction.
func Vector3.normalize | [src] |
Normalize this vector in-place to unit length.
Sets the vector's length to 1 while preserving its direction. Asserts that the vector is not zero.
func Vector3.normalizeSafe | [src] |
Normalize this vector in-place safely.
Sets the vector to unit length, or to zero if the original length is near zero.
func Vector3.opAffect | [src] |
Set all components to the same scalar value.
This allows assignment like 'vec = 5.0' to set all components to 5.0.
func Vector3.opAssign | [src] |
Compound assignment operators for vector-vector operations (+=, -=, =, /=).
Performs component-wise operations with another vector.
Compound assignment operators for vector-scalar operations (+=, -=, =, /=).
Applies the scalar value to all components of the vector.
func Vector3.opBinary | [src] |
Binary operators for vector-vector operations (+, -, , /).
Performs component-wise operations between two vectors and returns the result.
Binary operators for vector-scalar operations (+, -, , /).
Applies the scalar value to all components and returns the result.
func Vector3.opUnary | [src] |
Apply unary operations to the vector.
Currently supports negation (-) to return a vector with all components negated.
func Vector3.round | [src] |
Apply rounding function to all components in-place.
Rounds each component to the nearest integer value.
func Vector3.set | [src] |
Set all three components of the vector.
Parameters x, y, and z specify the new component values.
func Vector3.setLength | [src] |
Set the vector to the specified length.
First normalizes the vector, then scales it to newLength. Assumes the vector is not zero.
func Vector3.setLengthSafe | [src] |
Set the vector to the specified length safely.
First normalizes the vector safely, then scales it to newLength. Handles zero-length vectors.
func Vector3.setZero | [src] |
Set all vector components to zero.
Equivalent to assigning the Zero constant but modifies the current instance.
func Vector3.smoothDamp | [src] |
Perform smooth damping interpolation towards target.
Uses smoothTime and deltaTime for frame-rate independent smooth movement. currentVelocity is modified to track the current rate of change.
func Vector3.toAbs | [src] |
Returns the absolute value of each component.
Creates a new vector where each component is its absolute value.
func Vector3.toClamped | [src] |
Returns a new vector with components clamped between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector3.toCylindrical | [src] |
Convert this vector to cylindrical coordinates.
Returns theta (angle in radians), radius (distance from z-axis) and height (z-component) as a tuple-like struct.
func Vector3.toMovedTowards | [src] |
Returns a vector moved towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, returns the target directly.
func Vector3.toNormalized | [src] |
Returns this vector normalized to unit length without modifying the original.
Creates a new vector with length 1 in the same direction. Asserts that the vector is not zero.
func Vector3.toNormalizedSafe | [src] |
Returns this vector normalized safely without modifying the original.
Returns a unit vector in the same direction, or the zero vector if length is near zero.
func Vector3.toProject | [src] |
Project this vector onto other vector.
Returns the component of this vector in the direction of other.
func Vector3.toReflect | [src] |
Reflect this vector across a surface with the given normal.
The normal should be a unit vector pointing away from the surface.
func Vector3.toSign | [src] |
Returns the component-wise sign of the vector (-1, 0, or 1 for each component).
Each component becomes -1 if negative, 0 if zero, or 1 if positive.
func Vector3.toSpherical | [src] |
Convert this vector to spherical coordinates.
Returns theta (azimuthal angle), phi (polar angle) in radians and radius (magnitude) as a tuple-like struct.
struct Math.Vector4 | [src] |
A 4D vector struct representing a point or direction in 4D space.
x | f32 | X, Y, Z, and W components of the vector. |
y | f32 | |
z | f32 | |
w | f32 |
Contains x, y, z, and w components as 32-bit floating point values. Commonly used for homogeneous coordinates in 3D graphics or RGBA color values.
angleTo | Returns the angle between this vector and other in radians. |
ceil | Apply ceiling function to all components in-place. |
clamp | Clamp this vector's components between min and max values. |
clampLength | Clamp this vector's length to be within minLength and maxLength. |
clampedLength | Returns a new vector with length clamped between minLength and maxLength. |
cosAngleTo | Returns the cosine of the angle between this vector and other. |
distanceTo | Returns the Euclidean distance between this vector and dest. |
distanceToSquared | Returns the squared distance between this vector and dest. |
dot | Returns the dot product between this vector and other. |
floor | Apply floor function to all components in-place. |
fromVector2 | Create a Vector4 from Vector2 with specified Z and W components. |
fromVector3 | Create a Vector4 from Vector3 with specified W component. |
isEqualEpsilon | Returns true if this vector is equal to other within an epsilon tolerance. |
isFinite | Returns true if all components are finite (not infinite or NaN). |
isNaN | Returns true if any component is NaN (Not a Number). |
isZero | Returns true if this vector is exactly zero. |
isZeroEpsilon | Returns true if this vector is zero within an epsilon tolerance. |
length | Returns the length (magnitude) of the vector. |
lengthSquared | Returns the squared length of the vector. |
lerpTo | Perform linear interpolation between two vectors. |
makeAbs | Apply absolute value to all components in-place. |
max | Returns a vector containing the maximum components of two vectors. |
min | Returns a vector containing the minimum components of two vectors. |
moveTowards | Move this vector towards target by a maximum distance of maxDistance. |
negate | Negate the vector in-place. |
normalize | Normalize this vector in-place to unit length. |
normalizeSafe | Normalize this vector in-place safely. |
round | Apply rounding function to all components in-place. |
set | Set all four components of the vector. |
setLength | Set the vector to the specified length. |
setLengthSafe | Set the vector to the specified length safely. |
setZero | Set all vector components to zero. |
smoothDamp | Perform smooth damping interpolation towards target. |
toAbs | Returns the absolute value of each component. |
toClamped | Returns a new vector with components clamped between min and max values. |
toMovedTowards | Returns a vector moved towards target by a maximum distance of maxDistance. |
toNormalized | Returns this vector normalized to unit length without modifying the original. |
toNormalizedSafe | Returns this vector normalized safely without modifying the original. |
toProject | Project this vector onto other vector. |
toReflect | Reflect this vector across a surface with the given normal. |
toSign | Returns the component-wise sign of the vector (-1, 0, or 1 for each component). |
toVector3 | Convert homogeneous coordinates to 3D by dividing x, y, z by w. |
xy | Extract the XY components as a Vector2, ignoring Z and W components. |
xyz | Extract the XYZ components as a Vector3, ignoring the W component. |
opAffect | Set all components to the same scalar value. |
opAssign(me, const &Vector4) | Compound assignment operators for vector-vector operations (+=, -=, =, /=). |
opAssign(me, f32) | Compound assignment operators for vector-scalar operations (+=, -=, =, /=). |
opBinary(me, const &Vector4) | Binary operators for vector-vector operations (+, -, , /). |
opBinary(me, f32) | Binary operators for vector-scalar operations (+, -, , /). |
opUnary | Apply unary operations to the vector. |
func Vector4.angleTo | [src] |
Returns the angle between this vector and other in radians.
The result is in the range [0, π] using the arc cosine of the normalized dot product.
func Vector4.ceil | [src] |
Apply ceiling function to all components in-place.
Rounds each component up to the nearest integer value.
func Vector4.clamp | [src] |
Clamp this vector's components between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector4.clampLength | [src] |
Clamp this vector's length to be within minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector4.clampedLength | [src] |
Returns a new vector with length clamped between minLength and maxLength.
Preserves the vector's direction while constraining its magnitude.
func Vector4.cosAngleTo | [src] |
Returns the cosine of the angle between this vector and other.
Calculated using the dot product formula: dot(a,b) / (|a| * |b|).
func Vector4.distanceTo | [src] |
Returns the Euclidean distance between this vector and dest.
Calculated as the length of the difference vector between the two positions.
func Vector4.distanceToSquared | [src] |
Returns the squared distance between this vector and dest.
Faster than distance() when only comparing distances since it avoids the square root operation.
func Vector4.dot | [src] |
Returns the dot product between this vector and other.
The dot product is calculated as: (x₁ × x₂) + (y₁ × y₂) + (z₁ × z₂) + (w₁ × w₂).
func Vector4.floor | [src] |
Apply floor function to all components in-place.
Rounds each component down to the nearest integer value.
func Vector4.fromVector2 | [src] |
Create a Vector4 from Vector2 with specified Z and W components.
Useful for extending 2D coordinates to 4D space.
func Vector4.fromVector3 | [src] |
Create a Vector4 from Vector3 with specified W component.
Commonly used for creating homogeneous coordinates from 3D positions.
func Vector4.isEqualEpsilon | [src] |
Returns true if this vector is equal to other within an epsilon tolerance.
Compares each component separately using the specified eps tolerance.
func Vector4.isFinite | [src] |
Returns true if all components are finite (not infinite or NaN).
Useful for validating vector values after calculations.
func Vector4.isNaN | [src] |
Returns true if any component is NaN (Not a Number).
Useful for detecting invalid vector values after calculations.
func Vector4.isZero | [src] |
Returns true if this vector is exactly zero.
Performs exact floating-point comparison, which may not work well with computed values.
func Vector4.isZeroEpsilon | [src] |
Returns true if this vector is zero within an epsilon tolerance.
Uses eps parameter to handle floating-point precision issues.
func Vector4.length | [src] |
Returns the length (magnitude) of the vector.
Calculated using the Euclidean distance formula: sqrt(x² + y² + z² + w²).
func Vector4.lengthSquared | [src] |
Returns the squared length of the vector.
Faster than length() when only comparing magnitudes since it avoids the square root operation.
func Vector4.lerpTo | [src] |
Perform linear interpolation between two vectors.
Interpolates each component separately using the given factor (0.0 to 1.0). When factor is 0.0, returns src; when 1.0, returns dst.
func Vector4.makeAbs | [src] |
Apply absolute value to all components in-place.
Makes all components positive by removing their sign.
func Vector4.max | [src] |
Returns a vector containing the maximum components of two vectors.
Each component of the result is the larger of the corresponding components in a and b.
func Vector4.min | [src] |
Returns a vector containing the minimum components of two vectors.
Each component of the result is the smaller of the corresponding components in a and b.
func Vector4.moveTowards | [src] |
Move this vector towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, moves directly to target.
func Vector4.negate | [src] |
Negate the vector in-place.
Multiplies all components by -1, effectively reversing the vector direction.
func Vector4.normalize | [src] |
Normalize this vector in-place to unit length.
Sets the vector's length to 1 while preserving its direction. Asserts that the vector is not zero.
func Vector4.normalizeSafe | [src] |
Normalize this vector in-place safely.
Sets the vector to unit length, or to zero if the original length is near zero.
func Vector4.opAffect | [src] |
Set all components to the same scalar value.
This allows assignment like 'vec = 5.0' to set all components to 5.0.
func Vector4.opAssign | [src] |
Compound assignment operators for vector-vector operations (+=, -=, =, /=).
Performs component-wise operations with another vector.
Compound assignment operators for vector-scalar operations (+=, -=, =, /=).
Applies the scalar value to all components of the vector.
func Vector4.opBinary | [src] |
Binary operators for vector-vector operations (+, -, , /).
Performs component-wise operations between two vectors and returns the result.
Binary operators for vector-scalar operations (+, -, , /).
Applies the scalar value to all components and returns the result.
func Vector4.opUnary | [src] |
Apply unary operations to the vector.
Currently supports negation (-) to return a vector with all components negated.
func Vector4.round | [src] |
Apply rounding function to all components in-place.
Rounds each component to the nearest integer value.
func Vector4.set | [src] |
Set all four components of the vector.
Parameters x, y, z, and w specify the new component values.
func Vector4.setLength | [src] |
Set the vector to the specified length.
First normalizes the vector, then scales it to newLength. Assumes the vector is not zero.
func Vector4.setLengthSafe | [src] |
Set the vector to the specified length safely.
First normalizes the vector safely, then scales it to newLength. Handles zero-length vectors.
func Vector4.setZero | [src] |
Set all vector components to zero.
Equivalent to assigning the Zero constant but modifies the current instance.
func Vector4.smoothDamp | [src] |
Perform smooth damping interpolation towards target.
Uses smoothTime and deltaTime for frame-rate independent smooth movement. currentVelocity is modified to track the current rate of change.
func Vector4.toAbs | [src] |
Returns the absolute value of each component.
Creates a new vector where each component is its absolute value.
func Vector4.toClamped | [src] |
Returns a new vector with components clamped between min and max values.
Each component is independently clamped to stay within the specified range.
func Vector4.toMovedTowards | [src] |
Returns a vector moved towards target by a maximum distance of maxDistance.
If the distance to target is less than maxDistance, returns the target directly.
func Vector4.toNormalized | [src] |
Returns this vector normalized to unit length without modifying the original.
Creates a new vector with length 1 in the same direction. Asserts that the vector is not zero.
func Vector4.toNormalizedSafe | [src] |
Returns this vector normalized safely without modifying the original.
Returns a unit vector in the same direction, or the zero vector if length is near zero.
func Vector4.toProject | [src] |
Project this vector onto other vector.
Returns the component of this vector in the direction of other.
func Vector4.toReflect | [src] |
Reflect this vector across a surface with the given normal.
The normal should be a unit vector pointing away from the surface.
func Vector4.toSign | [src] |
Returns the component-wise sign of the vector (-1, 0, or 1 for each component).
Each component becomes -1 if negative, 0 if zero, or 1 if positive.
func Vector4.toVector3 | [src] |
Convert homogeneous coordinates to 3D by dividing x, y, z by w.
Returns a Vector3 representing the 3D position when w != 0. Handles w = 0 case safely.
func Vector4.xy | [src] |
Extract the XY components as a Vector2, ignoring Z and W components.
Useful for 2D projections or when using Vector4 for padding.
func Vector4.xyz | [src] |
Extract the XYZ components as a Vector3, ignoring the W component.
Useful when Vector4 is used for color (RGBA) and you need just RGB.
func Math.abs | [src] |
func Math.acos | [src] |
func Math.asin | [src] |
func Math.atan | [src] |
func Math.atan2 | [src] |
func Math.bigEndianToNative | [src] |
Convert a big-endian integer to the current architecture's native format.
On big-endian systems returns x unchanged, on little-endian systems performs byte swap.
func Math.byteswap | [src] |
Reverse the byte order of the value.
Converts between little-endian and big-endian representations.
func Math.ceil | [src] |
func Math.ceilS32 | [src] |
func Math.ceilS64 | [src] |
func Math.clamp | [src] |
Clamp a value between a lower and upper bound.
Returns low if x < low, up if x > up, otherwise returns x.
func Math.cos | [src] |
func Math.cosh | [src] |
func Math.countOnes | [src] |
Returns the total number of bits set to 1 in the value.
Also known as population count or Hamming weight.
func Math.cubicLerp | [src] |
Cubic interpolation between a, b, c, and d based on t.
func Math.exp | [src] |
func Math.exp2 | [src] |
func Math.floor | [src] |
func Math.floorS32 | [src] |
func Math.floorS64 | [src] |
func Math.fract | [src] |
Get the fractional part.
func Math.gcd | [src] |
Find the gcd between a and b.
func Math.hasByte | [src] |
Determin if an integer has a given byte.
func Math.hasZeroByte | [src] |
Determin if any of the bytes is zero.
func Math.interpHermite | [src] |
Hermite interpolation function.
func Math.interpQuintic | [src] |
Quintic interpolation function.
func Math.isEqualEpsilon | [src] |
Check if x and y are approximately equal within an epsilon threshold.
func Math.isFinite | [src] |
Returns true if the value is finite (not infinite and not NaN).
A finite number is any real number that is not positive infinity, negative infinity, or NaN.
Returns true if the value is finite (not infinite and not NaN).
A finite number is any real number that is not positive infinity, negative infinity, or NaN.
func Math.isNaN | [src] |
Check if x is NaN (not a number).
func Math.isPowerOf2 | [src] |
func Math.isZeroEpsilon | [src] |
Check if x is approximately zero within an epsilon threshold.
func Math.lcm | [src] |
Find the Least Common Multiple between a and b.
func Math.leadingZeros | [src] |
Returns the number of leading zero bits from the most significant bit.
Counts consecutive zero bits starting from the left (most significant) side.
func Math.lerp | [src] |
Linear interpolation between x and y based on factor.
func Math.littleEndianToNative | [src] |
Convert a little-endian integer to the current architecture's native format.
On little-endian systems returns x unchanged, on big-endian systems performs byte swap.
func Math.log | [src] |
func Math.log10 | [src] |
func Math.log2 | [src] |
func Math.make64 | [src] |
Make a 64 bits with two 32 bits.
func Math.makeRepeat16 | [src] |
Make a 16 bits by repeating a given byte 0x20 => 0x2020.
func Math.makeRepeat32 | [src] |
Make a 32 bits by repeating a given byte 0x20 => 0x20202020.
func Math.makeRepeat64 | [src] |
Make a 64 bits by repeating a given byte 0x20 => 0x20202020_20202020.
func Math.map | [src] |
Maps val from the range [minSrc, maxSrc] to [minDst, maxDst].
func Math.max | [src] |
Return the larger of two values.
Generic implementation that works with any comparable type T.
Return the largest of three values.
Efficiently finds the maximum using nested comparisons.
Return the largest of four values.
Efficiently finds the maximum using nested comparisons.
func Math.min | [src] |
Return the smaller of two values.
Generic implementation that works with any comparable type T.
Return the smallest of three values.
Efficiently finds the minimum using nested comparisons.
Return the smallest of four values.
Efficiently finds the minimum using nested comparisons.
func Math.moveTowards | [src] |
Interpolation at constant speed - moves a fixed distance per step.
func Math.mulAdd | [src] |
func Math.mulU64 | [src] |
func Math.nativeToBigEndian | [src] |
Convert a native architecture integer to big-endian format.
On big-endian systems returns x unchanged, on little-endian systems performs byte swap.
func Math.pow | [src] |
func Math.powerOf10 | [src] |
Calculates the smallest power of 10 greater than or equal to the given number val.
func Math.reverse | [src] |
Reverse all bits in an 8-bit value using lookup table.
Uses the precomputed Rev8Arr table for optimal performance.
Reverse all bits in a 16-bit value.
Splits the value into two bytes, reverses each using the lookup table, then recombines.
Reverse all bits in a 32-bit value using bit manipulation.
Uses a series of parallel bit operations with magic constants for efficiency.
Reverse all bits in a 64-bit value using bit manipulation.
Uses the same parallel bit operation technique as the 32-bit version with 64-bit constants.
func Math.rol | [src] |
Rotate bits left by y positions.
Bits that overflow from the left side wrap around to the right side.
func Math.ror | [src] |
Rotate bits right by y positions.
Bits that overflow from the right side wrap around to the left side.
func Math.round | [src] |
func Math.roundDownToPowerOf2 | [src] |
func Math.roundS32 | [src] |
func Math.roundS64 | [src] |
func Math.roundUpToPowerOf2 | [src] |
func Math.saturate | [src] |
Clamps x between 0 and 1.
func Math.sign | [src] |
Returns the sign of x (-1 for negative, 1 for positive).
func Math.sin | [src] |
func Math.sinh | [src] |
func Math.smoothDamp | [src] |
Perform smooth damping interpolation towards target.
Uses smoothTime and deltaTime for frame-rate independent smooth movement. currentVelocity is modified to track the current rate of change. Based on Game Programming Gems 4 Chapter 1.10
func Math.smoothstep | [src] |
Smoothstep interpolation between edge0 and edge1.
func Math.sqrt | [src] |
func Math.tan | [src] |
func Math.tanh | [src] |
func Math.toDegrees | [src] |
Convert radians to degrees.
func Math.toRadians | [src] |
func Math.trailingZeros | [src] |
Returns the number of trailing zero bits from the least significant bit.
Counts consecutive zero bits starting from the right (least significant) side.
func Math.trunc | [src] |
func Math.truncS32 | [src] |
func Math.truncS64 | [src] |
namespace Core.Memory |
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.
Align a pointer to the given amount.
func Memory.alloc | [src] |
Allocate a given amount of bytes.
func Memory.assertIsAllocated | [src] |
Check if a given pointer is allocated.
func Memory.clear | [src] |
Clear one block of memory.
func Memory.compare | [src] |
Compare two blocks of memory.
func Memory.copy | [src] |
Copy one block of memory to a given address.
func Memory.copyOver | [src] |
Move one block of memory to a given address.
func Memory.delete | [src] |
Drop and release memory of the given type.
Drop and release memory of an array of the given type.
func Memory.equals | [src] |
Compare two blocks of memory.
func Memory.free | [src] |
Free the specified memory block.
func Memory.freeAll | [src] |
Free all allocated memory of the given allocator if possible.
func Memory.freeTemp | [src] |
Clear the temporary allocator.
func Memory.new | [src] |
Allocate and initialize the given type.
Allocate and initialize an array of the given type.
func Memory.pushAllocator | [src] |
Push a new allocator for the given block of code.
func Memory.pushTempAllocator | [src] |
Push the temporary allocator for the given block of code.
func Memory.realloc | [src] |
Reallocate/allocate a given amount of bytes.
func Memory.set | [src] |
Set the content of one block of memory to a specific byte value.
func Memory.tempAlloc | [src] |
Allocate a given amount of bytes in the temporary allocator.
namespace Core.Noise |
FastNoise | FastNoise structure for generating different types of noise based on user-defined parameters. |
FastNoiseKind | Types of noise that can be generated by FastNoise. |
perlin(f32, f32, f32, s32) | Perlin noise in 3D. |
perlin(f32, f32, s32) | Perlin noise in 2D. |
struct Noise.FastNoise | [src] |
FastNoise structure for generating different types of noise based on user-defined parameters.
kind | Noise.FastNoiseKind | Type of noise to generate. |
seed | s32 | Seed value for noise generation. |
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 | Normalization factor used to keep the noise within bounds for fractal types. |
noise | Get a noise result. |
perlinFractalBillow | Computes billow-style fractal using Perlin noise. |
perlinFractalFBM | Computes fractal Brownian Motion using Perlin noise. |
perlinFractalRigidMulti | Computes rigid multi-fractal using Perlin noise. |
update | Update internal values. |
valueFractalBillow | Computes billow-style fractal using value noise. |
valueFractalFBM | Computes fractal Brownian Motion using value noise. |
valueFractalRigidMulti | Computes rigid multi-fractal using value noise. |
func FastNoise.noise | [src] |
Get a noise result.
func FastNoise.perlinFractalBillow | [src] |
Computes billow-style fractal using Perlin noise.
func FastNoise.perlinFractalFBM | [src] |
Computes fractal Brownian Motion using Perlin noise.
func FastNoise.perlinFractalRigidMulti | [src] |
Computes rigid multi-fractal using Perlin noise.
func FastNoise.update | [src] |
Update internal values.
Should be called each time an internal parameter has been changed.
func FastNoise.valueFractalBillow | [src] |
Computes billow-style fractal using value noise.
func FastNoise.valueFractalFBM | [src] |
Computes fractal Brownian Motion using value noise.
func FastNoise.valueFractalRigidMulti | [src] |
Computes rigid multi-fractal using value noise.
enum Noise.FastNoiseKind | [src] |
Types of noise that can be generated by FastNoise.
Perlin | Basic Perlin noise. |
PerlinFractalFBM | Fractal Brownian Motion using Perlin noise. |
PerlinFractalBillow | Billow-style fractal using Perlin noise. |
PerlinFractalRigidMulti | Rigid multi-fractal using Perlin noise. |
Value | Basic value noise. |
ValueFractalFBM | Fractal Brownian Motion using value noise. |
ValueFractalBillow | Billow-style fractal using value noise. |
ValueFractalRigidMulti | Rigid multi-fractal using value noise. |
func Noise.perlin | [src] |
Perlin noise in 2D.
Result range is [-1, 1]
Perlin noise in 3D.
Result range is [-1, 1]
namespace Core.Parser |
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 |
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(me, string) | Find the first occurence in the string. |
grep(string, string) | Find the first occurence in the string. |
grepAll(me, string) | Find all the occurences in the string. |
grepAll(string, string) | Find all the occurences in the string. |
match(me, string) | Returns true if str matches the regexp. |
match(me, string, string, bool) | Compile and match the expression. |
partialMatch | Try to match the start of the string, and returns the matched value or null. |
opDrop | |
opIndex | You can get a capture group value by using the derefence syntax. |
func RegExp.clear | [src] |
Clear content.
func RegExp.compile | [src] |
Compile the expression.
func RegExp.create | [src] |
Creates and return an expression.
func RegExp.getCapture | [src] |
Returns the parsed string associated with a given captured group.
func RegExp.getCaptures | [src] |
Returns all the captured strings, in order.
func RegExp.grep | [src] |
Find the first occurence in the string.
func RegExp.grepAll | [src] |
Find all the occurences in the string.
func RegExp.match | [src] |
Compile and match the expression.
Returns true if str matches the regexp.
Should have been compiled before.
func RegExp.opDrop | [src] |
func RegExp.opIndex | [src] |
You can get a capture group value by using the derefence syntax.
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.
namespace Core.Path |
combine | Combines multiple path segments into one, adding a directory separator between them if necessary. |
equals | Returns true if the two paths are equal (case-insensitive Latin1 comparison). |
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 in lower case, including the . character Returns null if no extension was found. |
getFileName | Returns the file name part of the path, null if not found. |
getFileNameWithoutExtension | Returns the file name without its extension, 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 has the specified extension (case-insensitive). |
isRooted | Returns true if the given path is rooted (starts with a separator or a drive letter and colon). |
isValidFileName | Returns true if the given file name is valid. |
isValidPathName | Returns true if the given path name is valid. |
normalize | Normalizes the path by replacing ' with /' to conform to standard path format. |
func Path.combine | [src] |
Combines multiple path segments into one, adding a directory separator between them if necessary.
func Path.equals | [src] |
Returns true if the two paths are equal (case-insensitive Latin1 comparison).
func Path.getAbsolute | [src] |
Transform fullname to an absolute path.
func Path.getDirectoryName | [src] |
Returns the directory part of the path, null if not found.
func Path.getExtension | [src] |
Returns the file name extension, including the . character Returns null if no extension was found.
func Path.getExtensionLowerCase | [src] |
Returns the file name extension in lower case, including the . character Returns null if no extension was found.
func Path.getFileName | [src] |
Returns the file name part of the path, null if not found.
func Path.getFileNameWithoutExtension | [src] |
Returns the file name without its extension, null if not found.
func Path.getRootLength | [src] |
Returns the length of the root part of the path.
func Path.getRootName | [src] |
Returns the root part of the path, null if not found.
func Path.hasExtension | [src] |
Returns true if the file name contains an extension.
func Path.isDirectorySeparator | [src] |
Returns true if the given character is a directory separator.
func Path.isExtension | [src] |
Returns true if the given file has the specified extension (case-insensitive).
func Path.isRooted | [src] |
Returns true if the given path is rooted (starts with a separator or a drive letter and colon).
func Path.isValidFileName | [src] |
Returns true if the given file name is valid.
func Path.isValidPathName | [src] |
Returns true if the given path name is valid.
func Path.normalize | [src] |
Normalizes the path by replacing ' with /' to conform to standard path format.
namespace Core.Random |
CMWC4096 | George Marsaglia's CMWC (Complementary Multiply With Carry) 4096 random number generator. |
MWC | |
Mt64 | |
Rng |
shared | Get the default per thread random generator. |
struct Random.CMWC4096 | [src] |
George Marsaglia's CMWC (Complementary Multiply With Carry) 4096 random number generator.
q | [4096] u32 | State array of 4096 32-bit unsigned integers. |
c | u32 | Carry value. |
i | u32 | Current index into the state array (initialized to an invalid value to trigger seeding). |
nextU32 | Generates the next 32-bit unsigned random number. |
seedU32 | Seeds the generator with a 32-bit unsigned value. |
func CMWC4096.nextU32 | [src] |
Generates the next 32-bit unsigned random number.
func CMWC4096.seedU32 | [src] |
Seeds the generator with a 32-bit unsigned value.
struct Random.MWC | [src] |
w | u32 | |
z | u32 |
nextU32 | |
seedU32(me, u32) | |
seedU32(me, u32, u32) |
func MWC.nextU32 | [src] |
func MWC.seedU32 | [src] |
struct Random.Mt64 | [src] |
mt | [312] u64 | |
mti | u64 |
nextU64 | |
seedU64(me, const [..] u64) | |
seedU64(me, u64) |
func Mt64.nextU64 | [src] |
func Mt64.seedU64 | [src] |
struct Random.Rng | [src] |
rng | Random.Rng.T | |
seedDone | bool |
nextBool | Returns a random bool. |
nextF32(me) | Range is [0..1[, so 1.0 will never be returned. |
nextF32(me, f32, f32) | Returns a float value in a given range max is excluded. |
nextF64(me) | Range is [0..1[, so 1.0 will never be returned. |
nextF64(me, f64, f64) | Returns a float value in a given range max is excluded. |
nextS32(me) | Returns a signed 32 bits random value. |
nextS32(me, s32, s32) | Returns a signed random value in a given range max is excluded. |
nextS64(me) | Returns a signed 64 bits random value. |
nextS64(me, s64, s64) | Returns a signed random value in a given range max is excluded. |
nextU32(me) | Returns an unsigned 32 bits random value. |
nextU32(me, u32, u32) | Returns an unsigned random value in a given range max is excluded. |
nextU64(me) | Returns an unsigned 64 bits random value. |
nextU64(me, 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 Rng.nextF32 | [src] |
Range is [0..1[, so 1.0 will never be returned.
Returns a float value in a given range max is excluded.
func Rng.nextF64 | [src] |
Range is [0..1[, so 1.0 will never be returned.
Returns a float value in a given range max is excluded.
func Rng.nextS32 | [src] |
Returns a signed 32 bits random value.
Returns a signed random value in a given range max is excluded.
func Rng.nextS64 | [src] |
Returns a signed 64 bits random value.
Returns a signed random value in a given range max is excluded.
func Rng.nextU32 | [src] |
Returns an unsigned 32 bits random value.
Returns an unsigned random value in a given range max is excluded.
func Rng.nextU64 | [src] |
Returns an unsigned 64 bits random value.
Returns an unsigned random value in a given range max is excluded.
func Rng.seedNow | [src] |
Seed the rng with the current time.
func Rng.seedU32 | [src] |
Seed random generator with a 32 bits value.
func Rng.seedU64 | [src] |
Seed random generator with a 64 bits value.
func Rng.shuffle | [src] |
Randomly change the order of a slice.
[src] |
Get the default per thread random generator.
namespace Core.Reflection |
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 Reflection.canCopy | [src] |
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 Reflection.copy | [src] |
func Reflection.crcToType | [src] |
Convert a crc to a registered typeinfo.
func Reflection.getAttribute | [src] |
Returns the given associated attribute to value or null.
Returns the given associated attribute to type or null.
func Reflection.getAttributeValue | [src] |
Returns the given attribute value, or null.
func Reflection.getAttributes | [src] |
Returns the given associated attributes to value.
Returns the given associated attributes to type.
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 Reflection.getEnumValue | [src] |
Get information about a specific value in a given enum Returns null if the value does not exist.
func Reflection.getField | [src] |
Get information about a specific field in a given struct Returns null if the field does not exist.
func Reflection.getFieldValue | [src] |
Get a field value with a given runtime type.
func Reflection.getMethod | [src] |
Get information about a specific method in a given struct.
Returns null if the method does not exist
func Reflection.getStructArrayType | [src] |
Returns the generic type of the Core.Array typeinfo.
If t is not a Core.Array, returns null
func Reflection.hasAttribute | [src] |
Returns true if the given value has the associated attribute.
Returns true if the given type has the associated attribute.
func Reflection.hasDrop | [src] |
func Reflection.hasInterface | [src] |
Returns true if the interface itf is implemented in the given structure type.
func Reflection.hasMethod | [src] |
Helper function to know if a struct has a special method.
func Reflection.hasPostCopy | [src] |
func Reflection.hasPostMove | [src] |
func Reflection.isAny | [src] |
func Reflection.isBool | [src] |
func Reflection.isEnum | [src] |
func Reflection.isEnumFlags | [src] |
func Reflection.isFloat | [src] |
func Reflection.isGeneric | [src] |
func Reflection.isInteger | [src] |
func Reflection.isInterface | [src] |
func Reflection.isNative | [src] |
func Reflection.isPod | [src] |
func Reflection.isPointer | [src] |
func Reflection.isPointerArithmetic | [src] |
func Reflection.isPointerRef | [src] |
func Reflection.isRune | [src] |
func Reflection.isSimpleNative | [src] |
func Reflection.isSlice | [src] |
func Reflection.isStaticArray | [src] |
func Reflection.isString | [src] |
func Reflection.isStruct | [src] |
func Reflection.isStructArray | [src] |
Returns true if the type t is a Core.Array type.
func Reflection.isStructOfName | [src] |
Returns true if this is a struct of the given name.
func Reflection.isTuple | [src] |
func Reflection.isType | [src] |
func Reflection.isTypeAlias | [src] |
func Reflection.makeConcreteAlias | [src] |
In case this is a type alias, need to go deep inside it to find the right type.
func Reflection.makeConcreteEnum | [src] |
Transform an enum type to its underling real native type.
func Reflection.maxSizeOf | [src] |
Returns the maximum sizeof a bunch of typeinfo.
func Reflection.nameToType | [src] |
Convert a crc to a registered typeinfo.
func Reflection.orFlags | [src] |
Make an union of flags of all types.
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 Reflection.setFieldValue | [src] |
Set a field value with a given runtime type.
namespace Core.Serialization |
Decoder | Serialization decoder. |
Encoder | Serialization encoder. |
Serializer |
DecoderFlags | |
SectionKind |
isPodFinal | Determin if a type can be serialized by a simple copy. |
Alias | Accept this other name for the struct field or the struct itself. |
Compress | Compress a struct or a field. |
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.
attr Serialization.Compress | [src] |
Compress a struct or a field.
struct Serialization.Decoder | [src] |
Serialization decoder.
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.
end | Finish reading. |
readAll | Read a full struct. |
readTypeValue | |
readTypedContent | |
start | Start reading. |
func IDecoder.beginField | [src] |
func IDecoder.beginSection | [src] |
func IDecoder.end | [src] |
func IDecoder.endField | [src] |
func IDecoder.endSection | [src] |
func IDecoder.getVersion | [src] |
func IDecoder.isTextual | [src] |
func IDecoder.read | [src] |
func IDecoder.readBool | [src] |
func IDecoder.readBufferU8 | [src] |
func IDecoder.readF32 | [src] |
func IDecoder.readF64 | [src] |
func IDecoder.readS16 | [src] |
func IDecoder.readS32 | [src] |
func IDecoder.readS64 | [src] |
func IDecoder.readS8 | [src] |
func IDecoder.readString | [src] |
func IDecoder.readU16 | [src] |
func IDecoder.readU32 | [src] |
func IDecoder.readU64 | [src] |
func IDecoder.readU8 | [src] |
func IDecoder.start | [src] |
func Decoder.end | [src] |
Finish reading.
func Decoder.readAll | [src] |
Read a full struct.
func Decoder.readTypeValue | [src] |
func Decoder.readTypedContent | [src] |
func Decoder.start | [src] |
Start reading.
enum Serialization.DecoderFlags | [src] |
Zero | |
IgnoreStructFieldError |
struct Serialization.Encoder | [src] |
Serialization encoder.
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.
Can be serialized:
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.
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 IEncoder.beginSection | [src] |
func IEncoder.end | [src] |
End serialization.
func IEncoder.endField | [src] |
func IEncoder.endSection | [src] |
func IEncoder.isTextual | [src] |
func IEncoder.start | [src] |
Start serialization.
func IEncoder.write | [src] |
func IEncoder.writeBool | [src] |
func IEncoder.writeBufferU8 | [src] |
func IEncoder.writeF32 | [src] |
func IEncoder.writeF64 | [src] |
func IEncoder.writeS16 | [src] |
func IEncoder.writeS32 | [src] |
func IEncoder.writeS64 | [src] |
func IEncoder.writeS8 | [src] |
func IEncoder.writeString | [src] |
func IEncoder.writeU16 | [src] |
func IEncoder.writeU32 | [src] |
func IEncoder.writeU64 | [src] |
func IEncoder.writeU8 | [src] |
func Encoder.end | [src] |
End serialization.
func Encoder.start | [src] |
Start serialization.
func Encoder.writeAll | [src] |
Write a full struct.
Will call Encoder.start, Encoder.writeValue and Encoder.end
func Encoder.writeTypeValue | [src] |
Write a given Swag.TypeValue.
func Encoder.writeValue | [src] |
Write a given value with a given type.
attr Serialization.Final | [src] |
The struct does not need versionning.
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, Swag.TypeValue) 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, Swag.TypeValue) 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.
namespace Core.Serialization.Read |
JSon | A simple JSON reader. |
TagBin | Binary serializer with forward/backward compatibility. |
TagBinOptions | Configuration options for controlling deserialization behavior. |
TagBinSection | Section information for tracking deserialization state within structured data. |
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).
func JSon.beginElement | [src] |
func JSon.beginRoot | [src] |
func JSon.beginSection | [src] |
func JSon.beginSequence | [src] |
func JSon.beginStruct | [src] |
func JSon.beginValue | [src] |
func JSon.endElement | [src] |
func JSon.endRoot | [src] |
func JSon.endSection | [src] |
func JSon.endSequence | [src] |
func JSon.endStruct | [src] |
func JSon.endValue | [src] |
func JSon.getError | [src] |
func JSon.getVersion | [src] |
func JSon.isTextual | [src] |
func JSon.readNative | [src] |
func JSon.startRead | [src] |
func JSon.toNextSequenceElement | [src] |
func JSon.zapBlanks | [src] |
struct Read.TagBin | [src] |
Binary serializer with forward/backward compatibility.
version | u32 | Version of the tagbin in the stream. |
ignoreElements | Array'(String) | A list of element names that should be skipped. |
stream | ByteStream | Input byte stream for reading serialized data. |
options | Serialization.Read.TagBinOptions | Configuration options for deserialization behavior. |
freeSections | ArrayPtr'(Serialization.Read.TagBinSection) | Pool of reusable section objects for memory efficiency. |
sections | ArrayPtr'(Serialization.Read.TagBinSection) | Stack of active sections during deserialization. |
convertNextNative | const *Swag.TypeInfoNative | Type information for pending native type conversion. |
convertValToArray | bool | Flag indicating next value should be converted to array. |
convertArrayToVal | bool | Flag indicating next array should be converted to single value. |
outStack | Array'({buf:const [..] u8,seek:u64}) | |
elemStack | Array'({compressed:bool,tmpBuf:*Array'(u8)}) | |
tmpPool | ArrayPtr'(Array'(u8)) |
Changes that are supported from V to V+1 are :
Supported type changes are :
Supported attributes are :
beginElement | Begin reading a field element identified by val. |
beginRoot | Begin reading the root container of the serialized data. |
beginSection | Begin reading a new section with the specified kind. |
beginSequence | Begin reading a sequence (array) of elements of type typeElem. |
beginStruct | Begin reading a struct of the given structType. |
beginValue | Begin reading a value within the current context. |
endElement | Finish reading the current field element. |
endRoot | Finish reading the root container. |
endSection | Finish reading the current section. |
endSequence | Finish reading the current sequence. |
endStruct | Finish reading the current struct. |
endValue | Finish reading a value within the current context. |
getVersion | Get the version number of the current section. |
isTextual | Check if this serializer uses textual representation. |
readNative | Read a native type value from the stream with automatic type conversion support. |
startRead | Initialize the deserializer with the given input byte array. |
toNextSequenceElement | Advance to the next element in the current sequence. |
func TagBin.beginElement | [src] |
Begin reading a field element identified by val.
Returns true if the element exists in the stream and should be processed, false to skip it.
func TagBin.beginRoot | [src] |
Begin reading the root container of the serialized data.
Validates the root signature to ensure the stream contains valid serialized data.
func TagBin.beginSection | [src] |
Begin reading a new section with the specified kind.
Optionally skips reading the fat table if skipFat is true for performance optimization.
func TagBin.beginSequence | [src] |
Begin reading a sequence (array) of elements of type typeElem.
Updates countElem with the actual number of elements and returns true for bulk reading optimization.
func TagBin.beginStruct | [src] |
Begin reading a struct of the given structType.
Returns false for normal struct processing, true for special handling cases.
func TagBin.beginValue | [src] |
Begin reading a value within the current context.
Currently no special processing is required, but this maintains the symmetric API.
func TagBin.endElement | [src] |
Finish reading the current field element.
Clears any pending native type conversion state.
func TagBin.endRoot | [src] |
Finish reading the root container.
Currently no cleanup is required, but this maintains the symmetric begin/end API.
func TagBin.endSection | [src] |
Finish reading the current section.
Updates the stream position and releases the section back to the pool.
func TagBin.endSequence | [src] |
Finish reading the current sequence.
Currently no cleanup is required, but this maintains the symmetric API.
func TagBin.endStruct | [src] |
Finish reading the current struct.
Closes the current section that was opened by beginStruct.
func TagBin.endValue | [src] |
Finish reading a value within the current context.
Currently no cleanup is required, but this maintains the symmetric API.
func TagBin.getVersion | [src] |
Get the version number of the current section.
Returns 0 if no sections are active, otherwise returns the version of the most recent section.
func TagBin.isTextual | [src] |
Check if this serializer uses textual representation.
Always returns false since this is a binary serializer.
func TagBin.readNative | [src] |
Read a native type value from the stream with automatic type conversion support.
Handles string types specially and performs type conversions when convertNextNative is set.
func TagBin.startRead | [src] |
Initialize the deserializer with the given input byte array.
Sets up the internal byte stream for reading from the provided data buffer.
func TagBin.toNextSequenceElement | [src] |
Advance to the next element in the current sequence.
Decrements countElem and returns false when no more elements remain.
struct Read.TagBinOptions | [src] |
Configuration options for controlling deserialization behavior.
tryForward | bool | Accept to try to read a newest version, otherwise error. |
struct Read.TagBinSection | [src] |
Section information for tracking deserialization state within structured data.
mapSeek | HashTable'(u32, u64) | |
afterFatSeek | u64 | Stream position after the section's fat table. |
version | u32 | Version number of this section. |
kind | Serialization.SectionKind | Type of section (ordered, unordered, or raw). |
skipFat | bool | Whether to skip reading the fat table for this section. |
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).
func Xml.beginElement | [src] |
func Xml.beginRoot | [src] |
func Xml.beginSection | [src] |
func Xml.beginSequence | [src] |
func Xml.beginStruct | [src] |
func Xml.beginValue | [src] |
func Xml.endElement | [src] |
func Xml.endRoot | [src] |
func Xml.endSection | [src] |
func Xml.endSequence | [src] |
func Xml.endStruct | [src] |
func Xml.endValue | [src] |
func Xml.getError | [src] |
func Xml.getVersion | [src] |
func Xml.isTextual | [src] |
func Xml.readEndTag | [src] |
func Xml.readNative | [src] |
func Xml.readStartTag | [src] |
func Xml.readTag | [src] |
func Xml.startRead | [src] |
func Xml.toNextSequenceElement | [src] |
func Xml.zapBlanks | [src] |
enum Serialization.SectionKind | [src] |
Raw | |
Unordered | |
Ordered |
struct Serialization.Serializer | [src] |
encode | Serialization.IEncoder | |
decode | Serialization.IDecoder | |
isWrite | bool |
beginSection | Start a new section. |
end | End encoding/decoding. |
endSection | End the previous section. |
isReading | |
isWriting | |
serialize(me, string, *MT) | Serialize one value. |
serialize(me, string, u32, *MT) | Serialize one value. |
startRead | Start decoding. |
startWrite | Start encoding. |
func Serializer.beginSection | [src] |
Start a new section.
func Serializer.end | [src] |
End encoding/decoding.
func Serializer.endSection | [src] |
End the previous section.
func Serializer.isReading | [src] |
func Serializer.isWriting | [src] |
func Serializer.serialize | [src] |
Serialize one value.
func Serializer.startRead | [src] |
Start decoding.
func Serializer.startWrite | [src] |
Start encoding.
attr Serialization.Version | [src] |
Set the struct version number.
namespace Core.Serialization.Write |
JSon | A JSON writer. |
JSonOptions | Options for customizing JSON formatting. |
TagBin | Binary writer for serialized data with support for structured and raw output. |
TagBinSection | Internal state for a binary serialization section. |
TagBinSignatures | Signatures used to tag different sections and elements in the binary serialization format. |
TagBinValueFlags | Additional signature for each value, stored after the value description (crcs). |
struct Write.JSon | [src] |
A JSON writer.
options | Serialization.Write.JSonOptions | Formatting options. |
output | *ConcatBuffer | Output buffer for generated JSON. |
indent | u32 | Current indentation level. |
fmtInt | StrConv.ConvertFormatInt | Format used for converting integers. |
fmtFloat | StrConv.ConvertFormatFloat | Format used for converting floating-point numbers. |
lastSeekValue | ConcatBufferSeek | Seek position used for rollback of trailing commas. |
beginElement | Begins a named JSON element (a key-value pair). |
beginRoot | Begins the root element (no-op for JSON). |
beginSection | Begins a JSON object section. |
beginSequence | Begins a JSON array. |
beginStruct | Begins writing a struct (treated as a JSON object). |
beginValue | Begins a JSON value (no-op). |
endElement | Ends a named JSON element (no-op). |
endRoot | Ends the root element (no-op for JSON). |
endSection | Ends a JSON object section. |
endSequence | Ends a JSON array. |
endStruct | Ends writing a struct. |
endValue | Ends a JSON value and appends a comma and optional newline. |
isTextual | Returns true indicating this writer produces textual output. |
startWrite | Initializes the JSON writer with the given output buffer. |
writeIndent | Writes indentation based on the current indent level and settings. |
writeNative | Writes a native value (bool, float, int, string) as a JSON value. |
func JSon.beginElement | [src] |
Begins a named JSON element (a key-value pair).
func JSon.beginRoot | [src] |
Begins the root element (no-op for JSON).
func JSon.beginSection | [src] |
Begins a JSON object section.
func JSon.beginSequence | [src] |
Begins a JSON array.
func JSon.beginStruct | [src] |
Begins writing a struct (treated as a JSON object).
func JSon.beginValue | [src] |
Begins a JSON value (no-op).
func JSon.endElement | [src] |
Ends a named JSON element (no-op).
func JSon.endRoot | [src] |
Ends the root element (no-op for JSON).
func JSon.endSection | [src] |
Ends a JSON object section.
func JSon.endSequence | [src] |
Ends a JSON array.
func JSon.endStruct | [src] |
Ends writing a struct.
func JSon.endValue | [src] |
Ends a JSON value and appends a comma and optional newline.
func JSon.isTextual | [src] |
Returns true indicating this writer produces textual output.
func JSon.startWrite | [src] |
Initializes the JSON writer with the given output buffer.
func JSon.writeIndent | [src] |
Writes indentation based on the current indent level and settings.
func JSon.writeNative | [src] |
Writes a native value (bool, float, int, string) as a JSON value.
struct Write.JSonOptions | [src] |
Options for customizing JSON formatting.
indentLevel | u32 | Number of spaces per indentation level. |
saveBlanks | bool | Whether to include indentation and line breaks. |
struct Write.TagBin | [src] |
Binary writer for serialized data with support for structured and raw output.
compressionFlags | Compress.Deflate.CompressionFlags | |
compressionLevel | Compress.Deflate.CompressionLevel | |
compressionStrategy | Compress.Deflate.CompressionStrategy |
beginElement | Begins a new element inside the current section and records its metadata. |
beginRoot | Begins the root section of the serialization structure. |
beginSection | Begins a new section of the specified kind. |
beginSequence | Begins a sequence and determines if elements can be written in bulk as raw data. |
beginStruct | Begins a new struct, writing versioning and section metadata. |
beginValue | Begins a value (stubbed out). |
endElement | Ends the current element (stubbed out). |
endRoot | Ends the root section and asserts that all subsections have been closed. |
endSection | Ends the current section and writes out any required metadata. |
endSequence | Ends a sequence (stubbed out). |
endStruct | Ends the current struct section. |
endValue | Ends a value (stubbed out). |
isTextual | Always returns true; indicates that output is textual (overridden stub). |
startWrite | Begins writing to a specified output buffer. |
writeNative | Writes a native value to the output buffer, with special handling for strings. |
func TagBin.beginElement | [src] |
Begins a new element inside the current section and records its metadata.
func TagBin.beginRoot | [src] |
Begins the root section of the serialization structure.
func TagBin.beginSection | [src] |
Begins a new section of the specified kind.
func TagBin.beginSequence | [src] |
Begins a sequence and determines if elements can be written in bulk as raw data.
func TagBin.beginStruct | [src] |
Begins a new struct, writing versioning and section metadata.
func TagBin.beginValue | [src] |
Begins a value (stubbed out).
func TagBin.endElement | [src] |
Ends the current element (stubbed out).
func TagBin.endRoot | [src] |
Ends the root section and asserts that all subsections have been closed.
func TagBin.endSection | [src] |
Ends the current section and writes out any required metadata.
func TagBin.endSequence | [src] |
Ends a sequence (stubbed out).
func TagBin.endStruct | [src] |
Ends the current struct section.
func TagBin.endValue | [src] |
Ends a value (stubbed out).
func TagBin.isTextual | [src] |
Always returns true; indicates that output is textual (overridden stub).
func TagBin.startWrite | [src] |
Begins writing to a specified output buffer.
func TagBin.writeNative | [src] |
Writes a native value to the output buffer, with special handling for strings.
struct Write.TagBinSection | [src] |
Internal state for a binary serialization section.
startSeek | ConcatBufferSeek | Seek position in the output buffer where the section starts. |
mapSeek | HashTable'(u32, ConcatBufferSeek) | Maps CRC keys to their position in the output buffer. |
kind | Serialization.SectionKind | Type of section (e.g., Raw or Unordered). |
enum Write.TagBinSignatures | [src] |
Signatures used to tag different sections and elements in the binary serialization format.
Root | Root element of the serialization structure. |
Fat | FAT table identifier for unordered sections. |
Sequence | Start of a sequence (array or list). |
Version | Indicates that a version number is present. |
Raw | Indicates raw POD data with no structure. |
UnRaw | Indicates non-POD structured data. |
enum Write.TagBinValueFlags | [src] |
Additional signature for each value, stored after the value description (crcs).
Zero | |
Compressed |
func Serialization.isPodFinal | [src] |
Determin if a type can be serialized by a simple copy.
namespace Core.Slice |
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 Slice.anyOf | [src] |
Returns true if cb returns true for at least one value.
func Slice.contains | [src] |
Returns true if the given slice contains the value.
func Slice.containsSorted | [src] |
Returns true if the given slice contains the value.
The slice must be sorted in ascending order
func Slice.equals | [src] |
Returns true if two slices are equal.
func Slice.findLinear | [src] |
Find value in a slice by performing a linear search.
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 Slice.findSorted | [src] |
Find value in a slice by performing a binary search.
The slice must be sorted in ascending order Returns Swag.U64.Max if not found.
func Slice.insertionSort | [src] |
Insertion sort algorithm (slow).
func Slice.isSorted | [src] |
Returns true if the slice is sorted.
func Slice.map | [src] |
Map the content of a slice to an array of type 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 Slice.min | [src] |
Get the minimum value of a slice, and the corresponding value index.
func Slice.modify | [src] |
Transform in place the content of a slice with a given lambda.
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 Slice.noneOf | [src] |
Returns true if cb returns false for all values.
func Slice.quickSort | [src] |
Quick sort algorithm.
func Slice.reduce | [src] |
Reduce the content of a slice to one single value.
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 Slice.sort | [src] |
Sort the slice, by picking the right algorithm depending on the type and the number of elements.
struct Core.StaticArray | [src] |
A stack-allocated array with a fixed capacity known at compile time.
buffer | [?] StaticArray.T | The fixed-size me.buffer that holds the elements. |
count | u64 | The number of valid elements currently in the array. |
It provides a similar interface to the dynamic Array but does not allocate memory on the heap.
add(me, &&T) | Moves an element to the end of the array. |
add(me, T) | Adds a copy of an element to the end of the array. |
add(me, const [..] T) | Appends all elements from a slice to the end of the array. |
addOnce | Adds an element to the end of the array, but only if it's not already present. |
back | Returns a copy of the last element of the array. |
backPtr | Returns a pointer to the last element of the array. |
clear | Removes all elements from the array, setting its me.count to 0. |
contains | Returns true if the array contains the given value. |
emplaceAddress | Makes room for num elements at the end of the array and returns a pointer to the new space. |
emplaceAt | Moves elements from a slice at a specific index, shifting existing elements to the right. |
emplaceInitAddress | Makes room for num elements at the end of the array and returns a pointer to the new space. |
free | Drops all elements in the array, setting its me.count to 0. |
front | Returns a copy of the first element of the array. |
frontPtr | Returns a pointer to the first element of the array. |
insertAt(me, u64, &&T) | Inserts a moved value at a specific index, shifting existing elements to the right. |
insertAt(me, u64, T) | Inserts a copy of a value at a specific index, shifting existing elements to the right. |
insertAt(me, u64, const [..] T) | Inserts elements from a slice at a specific index, shifting existing elements to the right. |
isEmpty | Returns true if the array contains no elements. |
popBack | Removes the last element from the array and returns it. |
remove(me, V) | Removes the first occurrence of a given value from the array. |
remove(me, u64, u64) | Removes a specified number of elements starting from a given index. |
removeAt | Removes the element at a given index by swapping it with the last element. |
removeAtOrdered | Removes one or more elements at a given index, shifting subsequent elements to the left. |
removeBack | Removes the last element from the array. |
removeOrdered | Removes the first occurrence of a given value, preserving the order of remaining elements. |
resize | Changes the number of elements in the array to newCount. |
sort(me) | Sorts the array in ascending order using the default comparison operator. |
sort(me, func(*void, T, T)->s32) | Sorts the array using a custom comparison function. |
sortReverse | Sorts the array in descending order. |
toSlice | Returns a mutable slice containing all valid elements of the array. |
opAffect | Replaces the content of the array with elements copied from a slice. |
opCast(me) | Allows the array to be implicitly cast to a mutable slice. |
opCast(me) | Allows the array to be implicitly cast to an immutable slice. |
opCount | Returns the number of elements in the array. |
opData | Returns a raw, constant pointer to the array's buffer. |
opDrop | Ensures that if elements have destructors, they are called when the array goes out of scope. |
opIndex(me, u64) | Returns a mutable reference to the element at the specified index. |
opIndex(me, u64) | Returns a constant reference to the element at the specified index. |
opIndexAffect | Assigns a new value to the element at the specified index. |
opIndexAssign | Handles compound assignment operators (e.g., +=, -=) for elements. |
opSlice | Creates a slice from a sub-part of the array. |
opVisit | Provides a way to iterate over each element in the array. |
func StaticArray.add | [src] |
Adds a copy of an element to the end of the array.
Asserts if the array is full.
Moves an element to the end of the array.
Asserts if the array is full.
Appends all elements from a slice to the end of the array.
Asserts if the array does not have enough capacity.
func StaticArray.addOnce | [src] |
Adds an element to the end of the array, but only if it's not already present.
Asserts if the array is full.
func StaticArray.back | [src] |
Returns a copy of the last element of the array.
Asserts if the array is empty.
func StaticArray.backPtr | [src] |
Returns a pointer to the last element of the array.
Asserts if the array is empty.
func StaticArray.clear | [src] |
Removes all elements from the array, setting its me.count to 0.
This calls the destructor for each element if one exists.
func StaticArray.contains | [src] |
Returns true if the array contains the given value.
func StaticArray.emplaceAddress | [src] |
Makes room for num elements at the end of the array and returns a pointer to the new space.
The new memory is not initialized. Asserts if the array does not have enough capacity.
func StaticArray.emplaceAt | [src] |
Moves elements from a slice at a specific index, shifting existing elements to the right.
Asserts if the array does not have enough capacity. Order is preserved.
func StaticArray.emplaceInitAddress | [src] |
Makes room for num elements at the end of the array and returns a pointer to the new space.
The new memory is default-initialized. Asserts if the array does not have enough capacity.
func StaticArray.free | [src] |
Drops all elements in the array, setting its me.count to 0.
This is equivalent to clear for this type.
func StaticArray.front | [src] |
Returns a copy of the first element of the array.
Asserts if the array is empty.
func StaticArray.frontPtr | [src] |
Returns a pointer to the first element of the array.
Asserts if the array is empty.
func StaticArray.insertAt | [src] |
Inserts a copy of a value at a specific index, shifting existing elements to the right.
Asserts if the array is full. Order is preserved.
Inserts a moved value at a specific index, shifting existing elements to the right.
Asserts if the array is full. Order is preserved.
Inserts elements from a slice at a specific index, shifting existing elements to the right.
Asserts if the array does not have enough capacity. Order is preserved.
func StaticArray.isEmpty | [src] |
Returns true if the array contains no elements.
func StaticArray.opAffect | [src] |
Replaces the content of the array with elements copied from a slice.
Asserts if the slice is larger than the array's capacity.
func StaticArray.opCast | [src] |
Allows the array to be implicitly cast to a mutable slice.
Allows the array to be implicitly cast to an immutable slice.
func StaticArray.opCount | [src] |
Returns the number of elements in the array.
func StaticArray.opData | [src] |
Returns a raw, constant pointer to the array's buffer.
func StaticArray.opDrop | [src] |
Ensures that if elements have destructors, they are called when the array goes out of scope.
func StaticArray.opIndex | [src] |
Returns a constant reference to the element at the specified index.
Returns a mutable reference to the element at the specified index.
func StaticArray.opIndexAffect | [src] |
Assigns a new value to the element at the specified index.
func StaticArray.opIndexAssign | [src] |
Handles compound assignment operators (e.g., +=, -=) for elements.
func StaticArray.opSlice | [src] |
Creates a slice from a sub-part of the array.
func StaticArray.opVisit | [src] |
Provides a way to iterate over each element in the array.
This is a macro that accepts a code block to execute for each element. Visiting by pointer and in reverse order is supported.
func StaticArray.popBack | [src] |
Removes the last element from the array and returns it.
Asserts if the array is empty.
func StaticArray.remove | [src] |
Removes a specified number of elements starting from a given index.
This is an unstable remove; the order of remaining elements is not preserved.
Removes the first occurrence of a given value from the array.
This is an unstable remove; order is not preserved. Does nothing if the value is not found.
func StaticArray.removeAt | [src] |
Removes the element at a given index by swapping it with the last element.
This is very fast, but the order of elements is not preserved.
func StaticArray.removeAtOrdered | [src] |
Removes one or more elements at a given index, shifting subsequent elements to the left.
This is slower than removeAt, but preserves the order of the remaining elements.
func StaticArray.removeBack | [src] |
Removes the last element from the array.
Asserts if the array is empty.
func StaticArray.removeOrdered | [src] |
Removes the first occurrence of a given value, preserving the order of remaining elements.
Does nothing if the value is not found.
func StaticArray.resize | [src] |
Changes the number of elements in the array to newCount.
Asserts if newCount exceeds the static capacity.
func StaticArray.sort | [src] |
Sorts the array in ascending order using the default comparison operator.
Sorts the array using a custom comparison function.
func StaticArray.sortReverse | [src] |
Sorts the array in descending order.
func StaticArray.toSlice | [src] |
Returns a mutable slice containing all valid elements of the array.
namespace Core.StrConv |
ConvertFormat | |
ConvertFormatFloat | Format structure to convert a float to a string. |
ConvertFormatInt | Format structure to convert an integer to a string. |
StringBuilder |
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. |
toDisplayBitrate | Converts a bit rate value into a readable format with Kbps, Mbps, or Gbps. |
toDisplayDuration | Converts a duration in milliseconds into a string formatted as "Xd Yh Zm Ws". |
toDisplaySize | Converts a size in bytes into a human-readable string with units (bytes, Kb, Mb, Gb, Tb). |
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 |
parse |
func Atod.parse | [src] |
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 |
setFormat | Set some format options with a given user string. |
func ConvertFormatFloat.setFormat | [src] |
Set some format options with a given user 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.
setFormat | Set some format options with a given user string. |
func ConvertFormatInt.setFormat | [src] |
Set some format options with a given user 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 |
parse | Convert of floating value to a string. |
func Dtoa.parse | [src] |
Convert of floating value to a string.
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 |
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. |
zeroTerminate | Force a ending 0. |
func StringBuilder.appendAny | [src] |
Append a value.
func StringBuilder.appendEOL | [src] |
Append a end of line.
func StringBuilder.appendFormat | [src] |
Append a formatted string.
func StringBuilder.appendRune | [src] |
Append a rune.
func StringBuilder.appendString | [src] |
Append a string.
func StringBuilder.clear | [src] |
Clear the content of the builder.
func StringBuilder.count | [src] |
Returns the number of characters.
func StringBuilder.moveToString | [src] |
Return the content as a string by eating the content of the string builder (if possible).
func StringBuilder.setBucketSize | [src] |
Set sizes of buckets of the string builder.
func StringBuilder.toString | [src] |
Return the content as a string.
func StringBuilder.zeroTerminate | [src] |
Force a ending 0.
func StrConv.convert | [src] |
Templated version. Convert a value of type T.
func StrConv.convertAny | [src] |
Convert a value to an utf8 string, and append the result in a ConcatBuffer.
func StrConv.convertBool | [src] |
Convert a bool to a string, and put the result in a ConcatBuffer.
func StrConv.convertFloat | [src] |
Convert a float to an utf8 string, and put the result in a ConcatBuffer.
func StrConv.convertInt | [src] |
Convert an integer to an utf8 string, and put the result in a ConcatBuffer.
func StrConv.convertRune | [src] |
Convert a rune to a string, and put the result in a ConcatBuffer.
func StrConv.convertStruct | [src] |
Convert a structure content to an utf8 string, and put the result in a ConcatBuffer.
func StrConv.parseB64 | [src] |
Convert an utf8 buffer in binary to an unsigned integer value.
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.
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.
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 StrConv.parseIdentifier | [src] |
Parse an identifier name in the sens of swag (ascii).
func StrConv.parseRune | [src] |
Convert an utf8 buffer to a simple rune.
func StrConv.parseS16 | [src] |
func StrConv.parseS32 | [src] |
func StrConv.parseS64 | [src] |
func StrConv.parseS8 | [src] |
Convert an utf8 buffer to an signed integer value.
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.
String in the buffer can be quoted (but the result will not be in that case)
func StrConv.parseU16 | [src] |
func StrConv.parseU32 | [src] |
func StrConv.parseU64 | [src] |
func StrConv.parseU8 | [src] |
Convert an utf8 buffer in decimal to an unsigned integer value.
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.
addr must point to an initialized memory location that can hold type
Accepted types are :
buf can contain multiple values separated with blanks if type is:
func StrConv.parseX64 | [src] |
Convert an utf8 buffer in hexadecimal to an unsigned integer value.
Returns the value and the number of bytes used to make the conversion. ovf will be true in case of overflow
func StrConv.toDisplayBitrate | [src] |
Converts a bit rate value into a readable format with Kbps, Mbps, or Gbps.
func StrConv.toDisplayDuration | [src] |
Converts a duration in milliseconds into a string formatted as "Xd Yh Zm Ws".
func StrConv.toDisplaySize | [src] |
Converts a size in bytes into a human-readable string with units (bytes, Kb, Mb, Gb, Tb).
func StrConv.toF32 | [src] |
Transform a string to an f32.
func StrConv.toF64 | [src] |
Transform a string to an f64.
func StrConv.toNum | [src] |
Transform a string to an integer or float.
func StrConv.toS16 | [src] |
Transform a string to an s16.
func StrConv.toS32 | [src] |
Transform a string to an s32.
func StrConv.toS64 | [src] |
Transform a string to an s64.
func StrConv.toS8 | [src] |
Transform a string to an s8.
func StrConv.toU16 | [src] |
Transform a string to an u16.
func StrConv.toU32 | [src] |
Transform a string to an u32.
func StrConv.toU64 | [src] |
Transform a string to an u64.
func StrConv.toU8 | [src] |
Transform a string to an u8.
struct Core.String | [src] |
buffer | [*] u8 | |
length | u64 | |
capacity | u64 | |
allocator | Swag.IAllocator | |
padding | [16] u8 |
append(me, rune) | Append a rune to the String. |
append(me, string) | Append a string to the String. |
append(me, 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(me, const [..] u8) | |
contains(me, rune) | |
contains(me, string) | |
contains(me, 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(me, rune, u64) | |
indexOf(me, string, u64, ComparisonType) | Find what, and returns the byte index of it. |
insert(me, u64, string) | Insert a substring at the given position. |
insert(me, 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(me, rune, string) | Replace all occurences of what with by. |
replace(me, 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(me, 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(me) | Returns a slice type. |
toSlice(me) | Returns a slice type. |
toString | Returns a string type. |
toUpper(me, 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. |
opAffect | |
opAssign(me, const [..] rune) | |
opAssign(me, const [..] string) | |
opAssign(me, const [..] u8) | |
opAssign(me, rune) | |
opAssign(me, string) | |
opAssign(me, u8) | |
opCast(me) | |
opCast(me) | |
opCast(me) | |
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 String.append | [src] |
Append a byte to the String.
Append a rune to the String.
Append a string to the String.
func String.appendFormat | [src] |
Append a formatted string.
func String.back | [src] |
Get the last byte.
func String.clear | [src] |
Set the length of the String to 0.
func String.contains | [src] |
Returns true if the string contains what.
func String.ensureNotNull | [src] |
Transform a null string in an empty one.
func String.from | [src] |
Convert a literal string to a String.
func String.grow | [src] |
Ensure the String is big enough to store a given amount of bytes.
func String.indexOf | [src] |
Find what, and returns the byte index of it.
func String.insert | [src] |
Insert an ascii byte at the given position.
Insert a substring at the given position.
func String.isEmpty | [src] |
Returns true if the String has zero length.
func String.isNull | [src] |
Returns true if the String is null (undefined).
func String.isNullOrEmpty | [src] |
Returns true if the String is null or empty.
func String.join | [src] |
Join a list of strings to make a unique one.
func String.joinWith | [src] |
Join an list of strings to make a unique one, by using a given separator between them.
func String.makeLower | [src] |
Convert the string inplace to lower case.
func String.makeUpper | [src] |
Convert the string inplace to upper case.
func String.opAffect | [src] |
func String.opAssign | [src] |
func String.opCast | [src] |
func String.opCmp | [src] |
func String.opCount | [src] |
func String.opData | [src] |
func String.opDrop | [src] |
func String.opEquals | [src] |
func String.opIndex | [src] |
Returns the byte at the given index.
func String.opIndexAffect | [src] |
func String.opIndexAssign | [src] |
func String.opPostCopy | [src] |
func String.opPostMove | [src] |
func String.opSlice | [src] |
func String.opVisit | [src] |
Default foreach, by bytes.
func String.opVisitBytes | [src] |
Visit the String utf8 bytes.
func String.opVisitRunes | [src] |
Visit the String runes See Utf8.visitRunes for aliases.
func String.remove | [src] |
Remove some bytes at the given index.
func String.removeBack | [src] |
Remove some bytes at the end.
func String.replace | [src] |
Replace all occurences of what with by.
func String.reserve | [src] |
Reserve room for at least newCapacity bytes.
func String.startsWith | [src] |
Return true if the string starts with str.
func String.toLower | [src] |
Returns a new String in lower case.
func String.toRuneArray | [src] |
Convert string to a 32 bits character array.
func String.toSlice | [src] |
Returns a slice type.
func String.toString | [src] |
Returns a string type.
func String.toUpper | [src] |
Returns a new String in upper case.
Returns a new String in lower case.
func String.trim | [src] |
Removes all leading and trailing white-space characters from the current String.
func String.trimEnd | [src] |
Remove whitespaces at the end of the String.
func String.trimStart | [src] |
Remove whitespaces at the start of the String.
namespace Core.Sync |
Event | |
Mutex | |
RWLock |
scopedLock | |
sharedLock |
struct Sync.Event | [src] |
handle | Win32.HANDLE |
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. |
opDrop |
func Event.create | [src] |
Creates a new event.
func Event.init | [src] |
Initialize event.
func Event.isValid | [src] |
Returns true if the event is valid.
func Event.opDrop | [src] |
func Event.release | [src] |
Destroy an existing event.
func Event.reset | [src] |
Reset the event state.
func Event.signal | [src] |
Signal the event.
func Event.wait | [src] |
Wait for the event to be signaled.
struct Sync.Mutex | [src] |
v | Win32.SRWLOCK |
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 Mutex.tryLock | [src] |
Try to lock the mutex, and return true if it's the case.
func Mutex.unlock | [src] |
Unlock mutex.
struct Sync.RWLock | [src] |
v | Win32.SRWLOCK |
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 RWLock.lockExclusive | [src] |
Lock mutex.
[src] |
Lock mutex.
func RWLock.tryLockExclusive | [src] |
Try to lock the mutex, and return true if it's the case.
[src] |
Try to lock the mutex, and return true if it's the case.
func RWLock.unlock | [src] |
func RWLock.unlockExclusive | [src] |
Unlock mutex.
[src] |
Unlock mutex.
func Sync.scopedLock | [src] |
[src] |
namespace Core.System |
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.
namespace Core.Threading |
Thread |
ThreadPriority |
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 |
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. |
opDrop |
func Thread.init | [src] |
Initialize a thread in pause state.
func Thread.isDone | [src] |
Returns true if the thread has finished.
func Thread.isValid | [src] |
Returns true if the thread is valid.
func Thread.opDrop | [src] |
func Thread.safeForceEnd | [src] |
Force the thread to safely exist User code needs to check for requestEnd.
func Thread.setPriority | [src] |
Set the thread priority.
func Thread.sleep | [src] |
Sleep the current thread for a given amount of milliseconds.
func Thread.start | [src] |
Resume the given thread, if it was paused.
func Thread.wait | [src] |
Wait for the given thread to be done, and close it After that call, isValid() will return false.
func Thread.yield | [src] |
Sleep the current thread for a given amount of milliseconds.
enum Threading.ThreadPriority | [src] |
Lowest | |
BelowNormal | |
Normal | |
AboveNormal | |
Highest |
func Threading.wait | [src] |
Wait multiple threads.
namespace Core.Time |
DateTime | Represents an instant in time, typically expressed as a date and time of day. |
Duration | Represents a delay, expressed in seconds. |
FrameTiming | Holds timing information for frame-based updates. |
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-bit integer (in ticks). |
Timer |
DateTimeFormat | Supported formats for converting DateTime to/from string. |
DayOfWeek | Day of the week enumeration. |
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 | Year component (1 to 9999). |
month | u16 | Month component (1 to 12). |
day | u16 | Day component (1 to 31 depending on the month). |
hour | u16 | Hour component (0 to 23). |
minute | u16 | Minute component (0 to 59). |
second | u16 | Second component (0 to 59). |
millisecond | u16 | Millisecond component (0 to 999). |
dayOfWeek | Returns the day of the week for the current date. |
dayOfWeekName | Returns the name of the given day of the week. |
isValid | Returns true if this is a valid DateTime. |
monthName | Returns the month name corresponding to a month number (1 to 12). |
now | Returns a DateTime containing the current date and time. |
parse | Converts a string to a DateTime using the expected format. |
setNow | Initialize the structure with the current local date and time. |
toString | Converts the DateTime to a string using the given format. |
opCmp | Compares two DateTime values. Returns -1, 0, or 1. |
opEquals | Compares if two DateTime instances are equal. |
func IConvert.convert | [src] |
Converts a DateTime to a string using a single-character format specifier (for use with Format.toString).
func ISerialize.postRead | [src] |
func ISerialize.read | [src] |
Reads a DateTime from a textual encoder.
func ISerialize.readElement | [src] |
func ISerialize.write | [src] |
Writes a DateTime to a textual encoder.
func ISerialize.writeElement | [src] |
func DateTime.dayOfWeek | [src] |
Returns the day of the week for the current date.
func DateTime.dayOfWeekName | [src] |
Returns the name of the given day of the week.
func DateTime.isValid | [src] |
Returns true if this is a valid DateTime.
func DateTime.monthName | [src] |
Returns the month name corresponding to a month number (1 to 12).
func DateTime.now | [src] |
Returns a DateTime containing the current date and time.
func DateTime.opCmp | [src] |
Compares two DateTime values. Returns -1, 0, or 1.
func DateTime.opEquals | [src] |
Compares if two DateTime instances are equal.
func DateTime.parse | [src] |
Converts a string to a DateTime using the expected format.
func DateTime.setNow | [src] |
Initialize the structure with the current local date and time.
func DateTime.toString | [src] |
Converts the DateTime to a string using the given format.
enum Time.DateTimeFormat | [src] |
Supported formats for converting DateTime to/from string.
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] |
Day of the week enumeration.
Sunday | Sunday. |
Monday | Monday. |
Tuesday | Tuesday. |
Wednesday | Wednesday. |
Thursday | Thursday. |
Friday | Friday. |
Saturday | Saturday. |
struct Time.Duration | [src] |
Represents a delay, expressed in seconds.
timeInSeconds | f32 | The duration in seconds. |
fromMs | Returns a duration initialized with milliseconds. |
toMs | Returns the value in milliseconds. |
opAffect | |
opAffectLiteral |
func Duration.fromMs | [src] |
Returns a duration initialized with milliseconds.
func Duration.opAffect | [src] |
func Duration.opAffectLiteral | [src] |
func Duration.toMs | [src] |
Returns the value in milliseconds.
struct Time.FrameTiming | [src] |
Holds timing information for frame-based updates.
dtMin | f32 | Minimum delta time allowed (in seconds). |
dtMax | f32 | Maximum delta time allowed (in seconds). |
dt | f32 | Current delta time, in seconds. |
frameCount | u32 | Frame counter. |
prevTick | u64 | Tick of the previous frame. |
paused | bool | Whether timing is currently paused. |
pause | Pauses frame timing and frame count. |
unpause | Resumes frame timing and resets the tick reference. |
update | Updates the delta time and frame count. |
func FrameTiming.pause | [src] |
Pauses frame timing and frame count.
func FrameTiming.unpause | [src] |
Resumes frame timing and resets the tick reference.
func FrameTiming.update | [src] |
Updates the delta time and frame count.
struct Time.Stopwatch | [src] |
Provides a set of methods and properties that you can use to accurately measure elapsed time.
isStarted | bool | True if the stopwatch is currently running. |
startTimeStamp | u64 | Timestamp when the stopwatch was last started. |
elapsedTicks | u64 | Accumulated elapsed time in ticks. |
elapsedMicroseconds | Returns the total elapsed time in microseconds, after calling stop. |
elapsedMicrosecondsNow | Returns the current elapsed time in microseconds since the last start. |
elapsedMilliseconds | Returns the total elapsed time in milliseconds, after calling stop. |
elapsedMillisecondsNow | Returns the current elapsed time in milliseconds since the last start. |
reset | Resets the stopwatch and clears the elapsed time. |
restart | Resets the stopwatch and immediately starts measuring elapsed time. |
scopeMeasure | Measures elapsed time for the current scope and prints the result when the scope ends. |
start | Starts or resumes measuring elapsed time. |
stop | Stops measuring elapsed time and accumulates the result. |
func Stopwatch.elapsedMicroseconds | [src] |
Returns the total elapsed time in microseconds, after calling stop.
func Stopwatch.elapsedMicrosecondsNow | [src] |
Returns the current elapsed time in microseconds since the last start.
func Stopwatch.elapsedMilliseconds | [src] |
Returns the total elapsed time in milliseconds, after calling stop.
func Stopwatch.elapsedMillisecondsNow | [src] |
Returns the current elapsed time in milliseconds since the last start.
func Stopwatch.reset | [src] |
Resets the stopwatch and clears the elapsed time.
func Stopwatch.restart | [src] |
Resets the stopwatch and immediately starts measuring elapsed time.
func Stopwatch.scopeMeasure | [src] |
Measures elapsed time for the current scope and prints the result when the scope ends.
func Stopwatch.start | [src] |
Starts or resumes measuring elapsed time.
func Stopwatch.stop | [src] |
Stops measuring elapsed time and accumulates the result.
struct Time.TimeSpan | [src] |
Represents an interval of time, stored as a 64-bit integer (in ticks).
ticks | Time.Ticks | Duration represented in ticks. |
addDays | Adds or subtracts a number of days to the TimeSpan. |
addHours | Adds or subtracts a number of hours to the TimeSpan. |
addMilliSeconds | Adds or subtracts a number of milliseconds to the TimeSpan. |
addMinutes | Adds or subtracts a number of minutes to the TimeSpan. |
addMonths | Adds or subtracts a number of months to the TimeSpan. |
addSeconds | Adds or subtracts a number of seconds to the TimeSpan. |
addYears | Adds or subtracts a number of years to the TimeSpan. |
from | Creates a TimeSpan from a DateTime. |
now | Returns the current time as a TimeSpan. |
setNow | Sets the TimeSpan to the current time. |
toDateTime | Converts the TimeSpan to a DateTime. |
totalDays | Returns the total duration in days. |
totalHours | Returns the total duration in hours. |
totalMilliSeconds | Returns the total duration in milliseconds. |
totalMinutes | Returns the total duration in minutes. |
totalSeconds | Returns the total duration in seconds. |
opCmp | Compares two TimeSpan values. |
func TimeSpan.addDays | [src] |
Adds or subtracts a number of days to the TimeSpan.
func TimeSpan.addHours | [src] |
Adds or subtracts a number of hours to the TimeSpan.
func TimeSpan.addMilliSeconds | [src] |
Adds or subtracts a number of milliseconds to the TimeSpan.
func TimeSpan.addMinutes | [src] |
Adds or subtracts a number of minutes to the TimeSpan.
func TimeSpan.addMonths | [src] |
Adds or subtracts a number of months to the TimeSpan.
func TimeSpan.addSeconds | [src] |
Adds or subtracts a number of seconds to the TimeSpan.
func TimeSpan.addYears | [src] |
Adds or subtracts a number of years to the TimeSpan.
func TimeSpan.from | [src] |
Creates a TimeSpan from a DateTime.
func TimeSpan.now | [src] |
Returns the current time as a TimeSpan.
func TimeSpan.opCmp | [src] |
Compares two TimeSpan values.
func TimeSpan.setNow | [src] |
Sets the TimeSpan to the current time.
func TimeSpan.toDateTime | [src] |
Converts the TimeSpan to a DateTime.
func TimeSpan.totalDays | [src] |
Returns the total duration in days.
func TimeSpan.totalHours | [src] |
Returns the total duration in hours.
func TimeSpan.totalMilliSeconds | [src] |
Returns the total duration in milliseconds.
func TimeSpan.totalMinutes | [src] |
Returns the total duration in minutes.
func TimeSpan.totalSeconds | [src] |
Returns the total duration in seconds.
struct Time.Timer | [src] |
userLambda | func(Time.Timer) | |
handle | Time.TimerHandle | |
context | Swag.Context |
create | Creates a new timer. |
init | Initialize timer. |
release | Release the timer. |
func Timer.create | [src] |
Creates a new timer.
func Timer.init | [src] |
Initialize timer.
func Timer.release | [src] |
Release the timer.
func Time.dateToTicks | [src] |
Convert a date to a 64 bits value.
func Time.daysInMonth | [src] |
Returns the number of days of the given month, for the given year.
func Time.isLeapYear | [src] |
Returns true if the given year is a leap year.
func Time.nowMicroseconds | [src] |
Returns the current time expressed in microseconds.
func Time.nowMilliseconds | [src] |
Returns the current time expressed in milliseconds.
func Time.nowPrecise | [src] |
Get current time precise value.
func Time.preciseFrequency | [src] |
The frequency of the precise counter, in ticks per second.
func Time.ticksToDate | [src] |
Convert a 64 bits value to a date.
func Time.ticksToTime | [src] |
Convert a 64 bits tick value to a time.
func Time.timeToTicks | [src] |
Convert a time to a 64 bits value.
namespace Core.Tokenize |
eatCount | Eats count bytes from the beginning of the string and returns the remaining string. |
eatQuotes | Removes surrounding double quotes from the string, if present. |
eatSpaces | Removes leading space characters from the string and returns the trimmed result. |
getTo | Returns a substring of src starting at startByteIndex and ending at the first occurrence of delimiter Includes the delimiter if includeDelimiter is true. |
getToSpace | Returns the first substring of str stopping at the first whitespace character. |
getWhileAlnum | Returns the first substring of str that contains only alphanumeric characters. |
split(string, rune, u32, bool) | Splits the string into substrings using a rune as 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) | Splits the string into substrings using another string as 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) | Splits the string into substrings using a byte as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed. |
splitAny | Splits the string into substrings using any rune from the given array as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed. |
splitLines | Splits the string into an array of lines using newline or carriage return as delimiters Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed. |
func Tokenize.eatCount | [src] |
Eats count bytes from the beginning of the string and returns the remaining string.
func Tokenize.eatQuotes | [src] |
Removes surrounding double quotes from the string, if present.
func Tokenize.eatSpaces | [src] |
Removes leading space characters from the string and returns the trimmed result.
func Tokenize.getTo | [src] |
Returns a substring of src starting at startByteIndex and ending at the first occurrence of delimiter Includes the delimiter if includeDelimiter is true.
func Tokenize.getToSpace | [src] |
Returns the first substring of str stopping at the first whitespace character.
func Tokenize.getWhileAlnum | [src] |
Returns the first substring of str that contains only alphanumeric characters.
func Tokenize.split | [src] |
Splits the string into substrings using a byte as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
Splits the string into substrings using another string as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
Splits the string into substrings using a rune as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.
func Tokenize.splitAny | [src] |
Splits the string into substrings using any rune from the given array as separator Note that this returns an array of native strings, not copies. All strings will be invalid if src String is destroyed.
func Tokenize.splitLines | [src] |
Splits the string into an array of lines using newline or carriage return as delimiters Note that this returns an array of native strings, not copies. All strings will be invalid if src is destroyed.
namespace Core.Unicode |
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.
Convert an utf8 buffer to a character sequence.
func Unicode.isAscii | [src] |
func Unicode.isControl | [src] |
func Unicode.isDigit | [src] |
func Unicode.isLatin1 | [src] |
func Unicode.isLetter | [src] |
func Unicode.isLetterOrDigit | [src] |
func Unicode.isLower | [src] |
func Unicode.isNumber | [src] |
func Unicode.isSpace | [src] |
func Unicode.isSymbol | [src] |
func Unicode.isSymbolMath | [src] |
func Unicode.isTitle | [src] |
func Unicode.isUpper | [src] |
func Unicode.isWord | [src] |
func Unicode.makeLower | [src] |
Make a rune buffer lower case.
func Unicode.makeUpper | [src] |
Make a rune buffer upper case.
func Unicode.toLower | [src] |
func Unicode.toTitle | [src] |
func Unicode.toUpper | [src] |
namespace Core.Utf16 |
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 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 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.
Convert a character array (32 bits unicode) to an utf16 sequence.
func Utf16.fromUtf8 | [src] |
Convert an utf8 buffer to a utf16 buffer, and returns the number of valid elements in the destination buffer.
Convert an utf8 buffer to an utf16 sequence.
func Utf16.lengthZeroTerminated | [src] |
Compute the string length of a zero terminated utf16 buffer.
func Utf16.toZeroTerminated | [src] |
Convert string to an utf16 array, zero terminated.
namespace Core.Utf8 |
ComparisonType |
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 Utf8.byteIndex | [src] |
Returns the byte index of the given rune index.
func Utf8.compare | [src] |
Compare two utf8 buffers with the given algorithm.
func Utf8.contains | [src] |
Returns true if src contains the string what.
Returns true if src contains the slice what.
func Utf8.countBytesAt | [src] |
Returns the number of bytes to encode the first rune of the utf8 buffer.
If it's an invalid encoding, returns 1.
func Utf8.countRunes | [src] |
Returns the number of runes in an utf8 buffer.
func Utf8.decodeLastRune | [src] |
Get the last unicode rune of the utf8 slice, and the number of bytes to encode it.
func Utf8.decodeRune | [src] |
Get the unicode rune pointed by buffer, and the number of bytes to encode it.
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.
dest must be at least 4 bytes long
func Utf8.endsWith | [src] |
Return true if the string ends with str.
func Utf8.firstRune | [src] |
Returns the first rune of the slice.
func Utf8.fromUnicode | [src] |
Convert a rune array to an utf8 buffer.
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 Utf8.fromUtf16 | [src] |
Convert an utf16 array to an utf8 buffer.
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 Utf8.indexOf | [src] |
Find the first occurence of rune what, and returns the byte index of it.
Returns Swag.U64.Max if not found
Find the given string, and returns the byte index of it.
func Utf8.indexOfAny | [src] |
Find one of the runes in what, and returns the byte index of it.
Returns Swag.U64.Max if not found
Find one of the runes in what, and returns the byte index of it.
func Utf8.isValid | [src] |
Returns true if the utf8 sequence is valid.
func Utf8.isValidRune | [src] |
Returns true if the given unicode rune can be encoded in utf8.
func Utf8.lastIndexOf | [src] |
Find the last rune occurence of what, and returns the byte index of it.
Returns Swag.U64.Max if not found
Returns the last index (in bytes) of a string.
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.
Returns Swag.U64.Max if not found
Returns the last index (in bytes) of a any of the bytes in what.
Returns Swag.U64.Max if not found
func Utf8.lastRune | [src] |
Returns the last rune of the slice.
func Utf8.startsWith | [src] |
Return true if the string starts with str.
func Utf8.visitRunes | [src] |
Macro to foreach the unicode characters of the utf8 sequence.
func Core.add | [src] |
func Core.equals | [src] |
func Core.has | [src] |
func Core.orderMaxMin | [src] |
Ensures that the first value is greater than or equal to the second value.
If the first value is less than the second, their contents are swapped.
func Core.orderMinMax | [src] |
Ensures that the first value is less than or equal to the second value.
If the first value is greater than the second, their contents are swapped.
func Core.remove | [src] |
func Core.set | [src] |
func Core.swap | [src] |
Swaps the values of two variables.
Takes pointers to the two values to be swapped.
func Core.toggle | [src] |