daily update on 20240427 by nitload youmu
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace StgSharp.Data
|
||||
|
||||
public SSDSegment FindSegment(int id, byte SSD)
|
||||
{
|
||||
|
||||
return discList[SSD].FindSegment(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ namespace StgSharp.Data.FileIO
|
||||
{
|
||||
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void CreateRawFile(string outputFolder, bool rewrite)
|
||||
|
||||
Reference in New Issue
Block a user