DummyFileSystem

DummyFileSystem class

Read/write operations are dummy operations.

public class DummyFileSystem : FileSystem

Constructors

NameDescription
DummyFileSystem()The default constructor.

Methods

NameDescription
virtual Dispose()Dispose the File system and release its resources.
override ReadFile(string, IOConfig)Create a stream for reading dependencies.
override WriteFile(string, IOConfig)Create a stream for writing dependencies.

Examples

The following code shows how to export file to memory, and ignore all dependent file generation.

//create a scene with material
Scene scene = new Scene();
scene.RootNode.CreateChildNode(new Box()).Material = new LambertMaterial();
//create a save option and specify the file system, so the dependent file will be written to memory
var opt = FileFormat.WavefrontOBJ.CreateSaveOptions();
var dfs = new DummyFileSystem();
opt.FileSystem = dfs;
//obj's material file name is associated with the obj's file name, so we need a explicit name.
opt.FileName = "test.obj";
using (var ms = new MemoryStream())
{
    scene.Save(ms, opt);
}

See Also