mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
23 lines
534 B
C#
23 lines
534 B
C#
using System.IO;
|
|
|
|
namespace Wabbajack.Paths.IO;
|
|
|
|
public static class BinaryReaderExtensions
|
|
{
|
|
public static IPath ReadIPath(this BinaryReader rdr)
|
|
{
|
|
if (rdr.ReadBoolean()) return rdr.ReadAbsolutePath();
|
|
|
|
return rdr.ReadRelativePath();
|
|
}
|
|
|
|
public static AbsolutePath ReadAbsolutePath(this BinaryReader rdr)
|
|
{
|
|
return rdr.ReadString().ToAbsolutePath();
|
|
}
|
|
|
|
public static RelativePath ReadRelativePath(this BinaryReader rdr)
|
|
{
|
|
return rdr.ReadString().ToRelativePath();
|
|
}
|
|
} |