Class CodeParserBuffer
Internal buffer for reading asynchronously from files
Inherited Members
Namespace: DuetAPI.Commands
Assembly: DuetAPI.dll
Syntax
public sealed class CodeParserBuffer
Constructors
CodeParserBuffer(int, bool)
Default constructor of this class
Declaration
public CodeParserBuffer(int bufferSize, bool isFile)
Parameters
| Type | Name | Description |
|---|---|---|
| int | bufferSize | How many bytes to buffer when reading from a file |
| bool | isFile | Indicates if line numbers and file positions are valid |
Fields
LastGCode
Last major G-code to repeat
Declaration
public int LastGCode
Field Value
| Type | Description |
|---|---|
| int |
LineNumber
Current line number
Declaration
public long? LineNumber
Field Value
| Type | Description |
|---|---|
| long? |
MayRepeatCode
Indicates if the last code may be repeated as per Fanuc or LaserWeb style
Declaration
public bool MayRepeatCode
Field Value
| Type | Description |
|---|---|
| bool |
Methods
GetPosition(Stream)
Get the actual byte position when reading from a stream
Declaration
public long GetPosition(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to read from |
Returns
| Type | Description |
|---|---|
| long | Actual position in bytes |
GetPosition(StreamReader)
Get the actual byte position when reading from a stream
Declaration
[Obsolete("This call is deprecated because the buffer position of a StreamReader is not accessible. Pass your stream directly instead")]
public long GetPosition(StreamReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| StreamReader | reader | Stream reader to read from |
Returns
| Type | Description |
|---|---|
| long | Actual position in bytes |
Invalidate()
Invalidate the buffer
Declaration
public void Invalidate()