20 lines
596 B
C#
20 lines
596 B
C#
namespace Beam.Exports {
|
|
public interface IExporter {
|
|
/// <summary>
|
|
/// Synchronously writes the object to the desired path, creating it if it does not exist.
|
|
/// </summary>
|
|
/// <param name="path">The path of the exported object</param>
|
|
public void Write(string path);
|
|
|
|
protected void EnsurePathExists(string path) {
|
|
if (File.Exists(path)) {
|
|
File.Delete(path);
|
|
return;
|
|
}
|
|
else if (!Directory.Exists(path))
|
|
Directory.CreateDirectory(path);
|
|
}
|
|
|
|
}
|
|
}
|