Difference between revisions of "RawData"

From MiniScript Wiki
Jump to navigation Jump to search
m
Line 19: Line 19:
 
|-
 
|-
 
| <c>[[RawData.resize|resize]](bytes=32)</c> || change the size of the raw data buffer
 
| <c>[[RawData.resize|resize]](bytes=32)</c> || change the size of the raw data buffer
 +
|-
 +
| <c>[[RawData.byte|byte]](''self, offset=0'')</c> || get one unsigned byte of data
 +
|-
 +
| <c>[[RawData.setByte|setByte]](''self, offset=0, value=0'')</c> || set one unsigned byte value
 +
|-
 +
| <c>[[RawData.sbyte|sbyte]](''self, offset=0'')</c> || get one signed byte of data
 +
|-
 +
| <c>[[RawData.setSbyte|setSbyte]](''self, offset=0, value=0'')</c> || set one signed byte value
 +
|-
 +
| <c>[[RawData.ushort|ushort]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setUshort|setUshort]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.short|short]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setShort|setShort]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.uint|uint]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setUint|setUint]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.int|int]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setInt|setInt]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.float|float]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setFloat|setFloat]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.double|double]](''self, offset=0'')</c> ||
 +
|-
 +
| <c>[[RawData.setDouble|setDouble]](''self, offset=0, value=0'')</c> ||
 +
|-
 +
| <c>[[RawData.utf8|utf8]](''self, offset=0, bytes=-1'')</c> ||
 +
|-
 +
| <c>[[RawData.setUtf8|setUtf8]](''self, offset=0, value=""'')</c> ||
 
|}
 
|}

Revision as of 21:41, 26 March 2020

The RawData class in Mini Micro represents a buffer of raw bytes. Interpretation of these bytes is entirely up to the programmer.

Properties

Property Name Type Default Value Meaning
littleEndian number (boolean) true whether multi-byte values are stored with least significant byte first


Methods

Method Description
len returns the length of the raw data buffer, in bytes
resize(bytes=32) change the size of the raw data buffer
byte(self, offset=0) get one unsigned byte of data
setByte(self, offset=0, value=0) set one unsigned byte value
sbyte(self, offset=0) get one signed byte of data
setSbyte(self, offset=0, value=0) set one signed byte value
ushort(self, offset=0)
setUshort(self, offset=0, value=0)
short(self, offset=0)
setShort(self, offset=0, value=0)
uint(self, offset=0)
setUint(self, offset=0, value=0)
int(self, offset=0)
setInt(self, offset=0, value=0)
float(self, offset=0)
setFloat(self, offset=0, value=0)
double(self, offset=0)
setDouble(self, offset=0, value=0)
utf8(self, offset=0, bytes=-1)
setUtf8(self, offset=0, value="")