Class TBinaryNCFile
Some class to use for writing binary files. It automatically synchronizes with the postprocessing system and, when debugging via CLDViewer, allows you to see how the contents of the file change right during the writing process. It also implements the functionality of insertion to an arbitrary location in the file (at the beginning or middle, and not just at the end).
Inherited Members
Namespace: SprutTechnology.SCPostprocessor
Assembly: SCPostprocessor.dll
Syntax
public class TBinaryNCFile : TNCFile
Constructors
TBinaryNCFile()
Initializes a new instance of TBinaryNCFile and assigns TNCFilesManager.Singletone.DefaultNCFilesOwner
as an
Owner.
Declaration
public TBinaryNCFile()
TBinaryNCFile(INCFileOwner)
Initializes a new instance of TBinaryNCFile object and assigns specified object as an Owner.
Declaration
public TBinaryNCFile(INCFileOwner Owner)
Parameters
Type | Name | Description |
---|---|---|
INCFileOwner | Owner | The object that is the owner of the output file formed by the postprocessor. Usually the owner is a postprocessor itself. |
Properties
Description
Short textual description of the file's content to be shown for the user in SprutCAM's window instead of hexadecimal representation of its bytes.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OutputFileName
The file name with a full path where this output file should be saved at the finish.
Declaration
public override string OutputFileName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Methods
SaveToFile(String)
This method is called by the system automatically at the most final stage of the postprocessor's work. Here the content of the file should be written from a temporary storage (in memory or temporary file) to the destination file specified in the OutputFileName property.
After this saving the OnFinalizeNCFiles(TNCFilesManager) handler of the postprocessor is called where you can implement some additional actions on the output files.
Declaration
public override void SaveToFile(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The destination file path. |
Overrides
Write(Byte[])
Writes specified array of bytes to the end of the file.
Declaration
public void Write(byte[] b)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | b | The array of bytes to write. |
Write(Byte[], Int64, Int32)
Writes only the subrange of the specified array of bytes to the end of the file.
Declaration
public void Write(byte[] b, long offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | b | The array of bytes to write. |
System.Int64 | offset | Offset of the first writing byte of the b array. |
System.Int32 | count | The count of bytes to write. |
Write(ReadOnlySpan<Byte>)
Writes the specified buffer of bytes System.ReadOnlySpan<T> to the end of the file.
Declaration
public void Write(ReadOnlySpan<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | buffer | The span of bytes to write. |