Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs MemoryWriter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
module juptune.data.buffer;

struct MemoryWriter
{
    /++ ALIASES ++/
    
    ///
    alias __xpostblit = __MARMOS_BUG__;
    ///
    alias putI16BE = __MARMOS_BUG__;
    ///
    alias putI16LE = __MARMOS_BUG__;
    ///
    alias putI32BE = __MARMOS_BUG__;
    ///
    alias putI32LE = __MARMOS_BUG__;
    ///
    alias putI64BE = __MARMOS_BUG__;
    ///
    alias putI64LE = __MARMOS_BUG__;
    ///
    alias putI8 = __MARMOS_BUG__;
    ///
    alias putU16BE = __MARMOS_BUG__;
    ///
    alias putU16LE = __MARMOS_BUG__;
    ///
    alias putU24BE = __MARMOS_BUG__;
    ///
    alias putU24LE = __MARMOS_BUG__;
    ///
    alias putU32BE = __MARMOS_BUG__;
    ///
    alias putU32LE = __MARMOS_BUG__;
    ///
    alias putU64BE = __MARMOS_BUG__;
    ///
    alias putU64LE = __MARMOS_BUG__;
    ///
    alias putU8 = __MARMOS_BUG__;
    
    /++ FUNCTIONS ++/
    
    /// Returns: The underlying buffer passed to the constructor. 
    ubyte[] buffer();
    /// Returns: The number of bytes left in the buffer, for the current cursor position. 
    ulong bytesLeft();
    /// Returns: The current cursor position. 
    ulong cursor();
    /// Sets the cursor position. 
    void cursor(ulong newCursor);
    /// Moves the cursor back by the given number of bytes. 
    void goBack(ulong count);
    /// Advances the cursor by the given number of bytes. 
    void goForward(ulong count);
    ///
    MemoryWriter opAssign(MemoryWriter p);
    ///
    const ubyte[] putBytesPartial(const ubyte[] bytes);
    ///
    bool putU24(Endian endian)(uint value);
    ///
    bool tryBytes(const ubyte[] bytes);
    /// Attempts to write an integral type into the buffer; automatically converting it from big/little endian into the native endianess, and then advances the cursor. 
    bool tryIntegral(IntT, Endian endian)(IntT value);
    ///
    ubyte[] usedBuffer();
    
}

Aliases

Name Description
__xpostblit
putI16BE
putI16LE
putI32BE
putI32LE
putI64BE
putI64LE
putI8
putU16BE
putU16LE
putU24BE
putU24LE
putU32BE
putU32LE
putU64BE
putU64LE
putU8

Functions

Name Description
buffer

Returns: The underlying buffer passed to the constructor.

bytesLeft

Returns: The number of bytes left in the buffer, for the current cursor position.

cursor

Returns: The current cursor position.

cursor

Sets the cursor position.

goBack

Moves the cursor back by the given number of bytes.

goForward

Advances the cursor by the given number of bytes.

opAssign
putBytesPartial
putU24
tryBytes
tryIntegral

Attempts to write an integral type into the buffer; automatically converting it from big/little endian into the native endianess, and then advances the cursor.

usedBuffer

ON THIS PAGE