Compression.BSA nullable enabled. Some heavy files disabled

This commit is contained in:
Justin Swanson 2020-08-11 10:28:25 -05:00
parent a6169988c1
commit 56fe093618
9 changed files with 14 additions and 9 deletions

View File

@ -8,6 +8,7 @@ using System.Threading.Tasks;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using Wabbajack.Common;
#nullable disable
namespace Compression.BSA
{

View File

@ -8,6 +8,7 @@ using ICSharpCode.SharpZipLib.Zip.Compression;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
using File = Alphaleonis.Win32.Filesystem.File;
#nullable disable
namespace Compression.BSA
{

View File

@ -10,6 +10,7 @@ using K4os.Compression.LZ4.Streams;
using Wabbajack.Common;
using File = Alphaleonis.Win32.Filesystem.File;
using Path = Alphaleonis.Win32.Filesystem.Path;
#nullable disable
namespace Compression.BSA
{

View File

@ -18,8 +18,8 @@ namespace Compression.BSA
internal AbsolutePath _fileName;
internal uint _folderCount;
internal uint _folderRecordOffset;
private Lazy<FolderRecord[]> _folders;
internal string _magic;
private Lazy<FolderRecord[]> _folders = null!;
internal string _magic = string.Empty;
internal uint _totalFileNameLength;
internal uint _totalFolderNameLength;

View File

@ -10,13 +10,13 @@ namespace Compression.BSA
[JsonName("BSAState")]
public class BSAStateObject : ArchiveStateObject
{
public string Magic { get; set; }
public string Magic { get; set; } = string.Empty;
public uint Version { get; set; }
public uint ArchiveFlags { get; set; }
public uint FileFlags { get; set; }
public BSAStateObject()
{
{
}
public BSAStateObject(BSAReader bsaReader)
@ -25,7 +25,6 @@ namespace Compression.BSA
Version = (uint)bsaReader.HeaderType;
ArchiveFlags = (uint)bsaReader.ArchiveFlags;
FileFlags = (uint)bsaReader.FileFlags;
}
public override async Task<IBSABuilder> MakeBuilder(long size)

View File

@ -13,11 +13,11 @@ namespace Compression.BSA
{
internal readonly BSAReader BSA;
private readonly ReadOnlyMemorySlice<byte> _data;
internal Lazy<FileRecord[]> _files;
internal Lazy<FileRecord[]> _files = null!;
private int _prevFileCount;
internal FileNameBlock FileNameBlock;
internal FileNameBlock FileNameBlock = null!;
internal int Index { get; }
public string Name { get; private set; }
public string? Name { get; private set; }
public IEnumerable<IFile> Files => _files.Value;

View File

@ -6,6 +6,8 @@
<Platforms>x64</Platforms>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<Version>3.0</Version>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

View File

@ -6,7 +6,7 @@ namespace Compression.BSA
{
public interface IFolder
{
string Name { get; }
string? Name { get; }
IEnumerable<IFile> Files { get; }
int FileCount { get; }
}

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Wabbajack.Common;
using Wabbajack.Common.Serialization.Json;
#nullable disable
namespace Compression.BSA
{