daily update on 20240427 by nitload youmu

This commit is contained in:
YoumuLiu
2024-04-28 02:01:30 +08:00
parent f83a130074
commit 0e01d99e1e
35 changed files with 406 additions and 262 deletions
@@ -23,9 +23,9 @@ namespace StgSharp.Data
leastUnusedDisc = 0;
}
private static int leastUnusedID;
private int leastUnusedID;
public static int NewID()
public int NewID()
{
int ret = leastUnusedID;
if (ret == int.MaxValue)
@@ -36,7 +36,7 @@ namespace StgSharp.Data
return ret;
}
public static void ClearIDBuffer()
public void ClearIDBuffer()
{
leastUnusedID = 1;
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace StgSharp.Data
public SSDSegment FindSegment(int id, byte SSD)
{
return discList[SSD].FindSegment(id);
}
}
}
+11 -3
View File
@@ -32,7 +32,7 @@ using StgSharp.Data.FileIO;
using System;
using System.Collections.Generic;
using System.Reflection.Metadata.Ecma335;
using System.IO;
using System.Text;
namespace StgSharp.Data
@@ -52,10 +52,18 @@ namespace StgSharp.Data
public SSDSegment FindSegment(int id)
{
SSDSegment s = segments[id];
if (s.)
if (s.ID != id)
{
foreach (var item in segments)
{
if (item.ID == id)
{
s = item;
break;
}
}
}
return s;
}
}
@@ -39,7 +39,7 @@ namespace StgSharp.Data
{
public class SSDFolder : SSDSerializable, IEnumerable<SSDSegmentHead>
{
private SSD local;
private Area local;
private SSDrawHead _head;
internal int _folderID;
internal string _name;
@@ -110,7 +110,8 @@ namespace StgSharp.Data
public SSDraw CreateFile(string name, byte type)
{
SSDraw ret = new SSDraw(name + SerializableTypeCode.GetNameTail(type));
ret.ID = local.
ret.ID = local.NewID();
return ret;
}
//TODO 虚拟文件夹的GetBytes好难写
@@ -122,7 +123,7 @@ namespace StgSharp.Data
fileid.Add(4);
foreach (var item in files)
{
fileid.Add(item.);
fileid.Add(item.Value.ID);
}
return rawBytes.ToArray();
}
+1
View File
@@ -100,6 +100,7 @@ namespace StgSharp.Data.FileIO
{
}
return ret;
}
public void CreateRawFile(string outputFolder, bool rewrite)