Extract Strings to separate submodule.

This commit is contained in:
Ottermandias 2022-10-29 15:53:45 +02:00
parent bc901f3ff6
commit 35baba18bf
75 changed files with 751 additions and 1657 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.IO;
using Penumbra.GameData.ByteString;
using Penumbra.String;
using Penumbra.String.Functions;
namespace Penumbra.GameData.Enums;
@ -93,10 +94,10 @@ public static class ResourceTypeExtensions
};
}
public static ResourceType FromString( Utf8String path )
public static ResourceType FromString( ByteString path )
{
var extIdx = path.LastIndexOf( ( byte )'.' );
var ext = extIdx == -1 ? path : extIdx == path.Length - 1 ? Utf8String.Empty : path.Substring( extIdx + 1 );
var ext = extIdx == -1 ? path : extIdx == path.Length - 1 ? ByteString.Empty : path.Substring( extIdx + 1 );
return ext.Length switch
{