mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
[skip ci] documentation in AssetRipper.IO.Files
This commit is contained in:
parent
cbd02f75ca
commit
c7961747a6
@ -4,6 +4,14 @@ namespace AssetRipper.IO.Files
|
||||
{
|
||||
public interface IScheme
|
||||
{
|
||||
/// <summary>
|
||||
/// Checks if the file can be read by this scheme.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Implementations are expected to reset the <paramref name="stream"/> to its initial position.
|
||||
/// </remarks>
|
||||
/// <param name="stream">The stream for the file.</param>
|
||||
/// <returns>True if the file can be read.</returns>
|
||||
bool CanRead(SmartStream stream);
|
||||
FileBase Read(SmartStream stream, string filePath, string fileName);
|
||||
}
|
||||
|
||||
@ -57,6 +57,9 @@ namespace AssetRipper.IO.Files.SerializedFiles.Parser
|
||||
if (HasEndian(header.Version))
|
||||
{
|
||||
int num = stream.ReadByte();
|
||||
//This is not and should not be aligned.
|
||||
//Aligment only happens for the endian boolean on version 9 and greater.
|
||||
//This coincides with endianess being stored in the header on version 9 and greater.
|
||||
return num switch
|
||||
{
|
||||
< 0 => throw new EndOfStreamException(),
|
||||
|
||||
@ -2,6 +2,12 @@
|
||||
|
||||
namespace AssetRipper.IO.Files.SerializedFiles.Parser
|
||||
{
|
||||
/// <summary>
|
||||
/// A reference type for a serializeable C# type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These are used for fields with the [SerializeReference] attribute.
|
||||
/// </remarks>
|
||||
public sealed class SerializedTypeReference : SerializedTypeBase
|
||||
{
|
||||
public string ClassName { get; set; } = "";
|
||||
|
||||
@ -6,14 +6,8 @@ namespace AssetRipper.IO.Files.SerializedFiles
|
||||
{
|
||||
public SerializedFileException(string message, UnityVersion version, BuildTarget platform, int classIdType, string fileName, string filePath) : base(message)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(fileName));
|
||||
}
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(filePath));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(fileName);
|
||||
ArgumentException.ThrowIfNullOrEmpty(filePath);
|
||||
|
||||
Version = version;
|
||||
Platform = platform;
|
||||
@ -24,14 +18,8 @@ namespace AssetRipper.IO.Files.SerializedFiles
|
||||
|
||||
public SerializedFileException(string message, Exception innerException, UnityVersion version, BuildTarget platform, int classIdType, string fileName, string filePath) : base(message, innerException)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fileName))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(fileName));
|
||||
}
|
||||
if (string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(filePath));
|
||||
}
|
||||
ArgumentException.ThrowIfNullOrEmpty(fileName);
|
||||
ArgumentException.ThrowIfNullOrEmpty(filePath);
|
||||
|
||||
Version = version;
|
||||
Platform = platform;
|
||||
@ -42,7 +30,7 @@ namespace AssetRipper.IO.Files.SerializedFiles
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new();
|
||||
sb.Append("SerializedFileException:");
|
||||
sb.Append(" v:").Append(Version.ToString());
|
||||
sb.Append(" p:").Append(Platform.ToString());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user