Class TempFile
Provides file backing for an embedded resource. It is up to the caller to dispose any TempFile instances to ensure clean-up of files created.
Implements
Inherited Members
Namespace: Firefly.EmbeddedResourceLoader.Materialization
Assembly: Firefly.EmbeddedResourceLoader.dll
Syntax
public class TempFile : IDisposable
Constructors
| Improve this Doc View SourceTempFile(Stream, String)
Initializes a new instance of the TempFile class.
Declaration
public TempFile(Stream resourceData, string fileExtension = ".tmp")
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | resourceData | The resource data to copy to the file. |
| String | fileExtension | File extension to use for the temp file. |
TempFile(String)
Initializes a new instance of the TempFile class. It is not created until written to
Declaration
public TempFile(string fileExtension = ".tmp")
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileExtension | File extension to use for the temp file. |
TempFile(String, String)
Initializes a new instance of the TempFile class.
Declaration
public TempFile(string content, string fileExtension = ".tmp")
Parameters
| Type | Name | Description |
|---|---|---|
| String | content | String content to copy to the file. |
| String | fileExtension | File extension to use for the temp file. |
Properties
| Improve this Doc View SourceFullPath
Gets the full path to the temporary file.
Declaration
public string FullPath { get; }
Property Value
| Type | Description |
|---|---|
| String | The full path to the temporary file |
Methods
| Improve this Doc View SourceDispose()
Removes the temporary file.
Declaration
public void Dispose()
Write(Stream)
Writes data from stream to the temp file.
Declaration
public void Write(Stream streamData)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | streamData | Stream to write to the file. |
Write(String)
Writes data from string to the temp file.
Declaration
public void Write(string stringData)
Parameters
| Type | Name | Description |
|---|---|---|
| String | stringData | String to write to the file. |
Operators
| Improve this Doc View SourceImplicit(TempFile to String)
Declaration
public static implicit operator string (TempFile self)
Parameters
| Type | Name | Description |
|---|---|---|
| TempFile | self | The TempFile object. |
Returns
| Type | Description |
|---|---|
| String | The fill path to the temp file. |