From 02ca32ae0a5bc290918d2b2a3288e385b9cc6b11 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 19 Feb 2021 17:10:51 -0500 Subject: external & build dependences in src tree - external & build dependences boost licensed - ext_depends (external depends) - D-YAML - tinyendian - d2sqlite3 - imageformats - build_depends - dub2nix --- src/ext_depends/tinyendian/doc/tinyendian.html | 117 +++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/ext_depends/tinyendian/doc/tinyendian.html (limited to 'src/ext_depends/tinyendian/doc/tinyendian.html') diff --git a/src/ext_depends/tinyendian/doc/tinyendian.html b/src/ext_depends/tinyendian/doc/tinyendian.html new file mode 100644 index 0000000..be69219 --- /dev/null +++ b/src/ext_depends/tinyendian/doc/tinyendian.html @@ -0,0 +1,117 @@ + + + + + + +tinyendian + + + + + +
+ + +
+
public @system pure nothrow @nogc void swapByteOrder(T)(T[] array) 
+if([2, 4].canFind(T.sizeof))
+
+

Swap byte order of items in an array in place. +

+ + +
+

Parameters

+ + + +
T

Item type. Must be either 2 or 4 bytes long. +

+
array

Buffer with values to fix byte order of. +

+
+
+
public @system pure nothrow @nogc auto fixUTFByteOrder(ubyte[] array)
+
+

Convert byte order of an array encoded in UTF(8/16/32) to system endianness in place. +

+ + +
+

Uses the UTF byte-order-mark (BOM) to determine UTF encoding. If there is no BOM + at the beginning of array, UTF-8 is assumed (this is compatible with ASCII). The + BOM, if any, will be removed from the buffer. +

+

If the encoding is determined to be UTF-16 or UTF-32 and there aren't enough bytes + for the last code unit (i.e. if array.length is odd for UTF-16 or not divisible by + 4 for UTF-32), the extra bytes (1 for UTF-16, 1-3 for UTF-32) are stripped. +

+

Note that this function does not check if the array is a valid UTF string. It + only works with the BOM and 1,2 or 4-byte items. +

+ + +
+

Parameters

+ + +
array

The array with UTF-data. +

+
+
+

Returns

+

A struct with the following members: +

+

ubyte[] array A slice of the input array containing data in correct + byte order, without BOM and in case of UTF-16/UTF-32, + without stripped bytes, if any. + UTFEncoding encoding Encoding of the result (UTF-8, UTF-16 or UTF-32) + std.system.Endian endian Endianness of the original array. + uint bytesStripped Number of bytes stripped from a UTF-16/UTF-32 array, if + any. This is non-zero only if array.length was not + divisible by 2 or 4 for UTF-16 and UTF-32, respectively. +

+ + +
+

Complexity

+

(BIGOH array.length) +

+ + +
+

A minimal library providing functionality for changing the endianness of data. +

+ + +
+

Enums

UTFEncoding

Unicode UTF encodings. +

+

Functions

swapByteOrder

Swap byte order of items in an array in place. +

+
autofixUTFByteOrder

Convert byte order of an array encoded in UTF(8/16/32) to system endianness in place. +

+
+
+
+ +
+ +
+ + -- cgit v1.2.3