diff --git a/source/dub/internal/io/filesystem.d b/source/dub/internal/io/filesystem.d index 52550a705..414005551 100644 --- a/source/dub/internal/io/filesystem.d +++ b/source/dub/internal/io/filesystem.d @@ -51,7 +51,12 @@ public interface Filesystem public abstract string readText (in NativePath path) const scope; /// Write to this file - public abstract void writeFile (in NativePath path, const(char)[] data) scope; + public final void writeFile (in NativePath path, const(char)[] data) scope + { + import std.string : representation; + + this.writeFile(path, data.representation); + } /// Ditto public abstract void writeFile (in NativePath path, const(ubyte)[] data) scope; diff --git a/source/dub/internal/io/mockfs.d b/source/dub/internal/io/mockfs.d index fc086cd54..4c0f3d660 100644 --- a/source/dub/internal/io/mockfs.d +++ b/source/dub/internal/io/mockfs.d @@ -58,13 +58,6 @@ public final class MockFS : Filesystem { return this.cwd.writeFile(path, data); } - /// Ditto - public override void writeFile (in NativePath path, const(char)[] data) - scope - { - return this.cwd.writeFile(path, data); - } - /// Reads a file, returns the content as `ubyte[]` public override ubyte[] readFile (in NativePath path) const scope { @@ -405,12 +398,6 @@ public class FSEntry return cast(string) content; } - /// Write to this file - public void writeFile (in NativePath path, const(char)[] data) scope - { - this.writeFile(path, data.representation); - } - /// Ditto public void writeFile (in NativePath path, const(ubyte)[] data) scope { diff --git a/source/dub/internal/io/realfs.d b/source/dub/internal/io/realfs.d index 6ce5264e9..9497169c0 100644 --- a/source/dub/internal/io/realfs.d +++ b/source/dub/internal/io/realfs.d @@ -53,13 +53,6 @@ public final class RealFS : Filesystem { return dub.internal.vibecompat.core.file.writeFile(path, data); } - /// Ditto - protected override void writeFile (in NativePath path, const(char)[] data) - scope - { - return dub.internal.vibecompat.core.file.writeFile(path, data); - } - /// Reads a file, returns the content as `ubyte[]` public override ubyte[] readFile (in NativePath path) const scope {