mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 17:08:00 +02:00
Merge branch 'master' into FuzzyAutoComplete
This commit is contained in:
commit
62c3998521
64 changed files with 2485 additions and 598 deletions
|
@ -30,6 +30,8 @@ namespace System
|
|||
Delete = 0x80000,
|
||||
Alias = 0x100000,
|
||||
Block = 0x200000,
|
||||
DelegateTypeRef = 0x400000,
|
||||
FunctionTypeRef = 0x800000,
|
||||
|
||||
Types = .Struct | .Enum | .Function | .Class | .Interface,
|
||||
ValueTypes = .Struct | .Enum | .Function,
|
||||
|
@ -227,7 +229,7 @@ namespace System
|
|||
|
||||
}
|
||||
|
||||
[AttributeUsage(.Method | .Constructor | .Delegate | .Function)]
|
||||
[AttributeUsage(.Method | .Constructor | .Delegate | .Function | .DelegateTypeRef | .FunctionTypeRef)]
|
||||
public struct CallingConventionAttribute : Attribute
|
||||
{
|
||||
public enum Kind
|
||||
|
|
|
@ -17,6 +17,11 @@ namespace System
|
|||
strBuffer.Append(((bool)this) ? TrueString : FalseString);
|
||||
}
|
||||
|
||||
public static int operator<=>(Boolean a, Boolean b)
|
||||
{
|
||||
return (SelfBase)a <=> (SelfBase)b;
|
||||
}
|
||||
|
||||
public int GetHashCode()
|
||||
{
|
||||
return ((bool)this) ? 1 : 0;
|
||||
|
|
|
@ -311,6 +311,7 @@ namespace System.Collections
|
|||
{
|
||||
if (sizeof(int) == 4)
|
||||
return (int32)hashCode & 0x7FFFFFFF;
|
||||
#unwarn
|
||||
if (sizeof(int_cosize) == 8)
|
||||
return (int_cosize)(hashCode & 0x7FFFFFFF'FFFFFFFFL);
|
||||
return ((int32)hashCode ^ (int32)((int64)hashCode >> 33)) & 0x7FFFFFFF;
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Reflection;
|
|||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
@ -217,6 +218,12 @@ namespace System
|
|||
[LinkName("#CallerFileDir")]
|
||||
public static extern String CallerFileDir;
|
||||
|
||||
[LinkName("#CallerType")]
|
||||
public static extern Type CallerType;
|
||||
|
||||
[LinkName("#CallerTypeName")]
|
||||
public static extern String CallerTypeName;
|
||||
|
||||
[LinkName("#CallerMemberName")]
|
||||
public static extern String CallerMemberName;
|
||||
|
||||
|
@ -300,5 +307,21 @@ namespace System
|
|||
if (Compiler.IsComptime)
|
||||
Comptime_EmitMixin(text);
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public static Span<uint8> ReadBinary(StringView path)
|
||||
{
|
||||
List<uint8> data = scope .();
|
||||
File.ReadAll(path, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public static String ReadText(StringView path)
|
||||
{
|
||||
String data = scope .();
|
||||
File.ReadAllText(path, data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,5 +106,24 @@ namespace System.Diagnostics
|
|||
if (gIsDebuggerPresent)
|
||||
Break();
|
||||
}
|
||||
|
||||
public static void WriteMemory(Span<uint8> mem)
|
||||
{
|
||||
String str = scope .();
|
||||
for (int i < mem.Length)
|
||||
{
|
||||
if ((i != 0) && (i % 16 == 0))
|
||||
str.Append('\n');
|
||||
str.AppendF($" {mem.[Friend]mPtr[i]:X2}");
|
||||
}
|
||||
str.Append('\n');
|
||||
Write(str);
|
||||
}
|
||||
|
||||
public static void WriteMemory<T>(T result)
|
||||
{
|
||||
#unwarn
|
||||
WriteMemory(.((.)&result, sizeof(T)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,23 @@ namespace System.Diagnostics
|
|||
|
||||
struct ProfileInstance : int32
|
||||
{
|
||||
public void Dispose()
|
||||
public bool HasValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return this != 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose() mut
|
||||
{
|
||||
if (this == 0)
|
||||
return;
|
||||
String str = scope String();
|
||||
str.Append("StopSampling\t");
|
||||
((int32)this).ToString(str);
|
||||
Internal.ProfilerCmd(str);
|
||||
this = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Reflection;
|
||||
using System.Collections;
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
@ -30,12 +31,157 @@ namespace System
|
|||
return .Err;
|
||||
}
|
||||
|
||||
/*public override void ToString(String strBuffer) mut
|
||||
public static bool IsDefined<T>(T value)
|
||||
where T : enum
|
||||
{
|
||||
Type type = GetType();
|
||||
int32* iPtr = (int32*)((int)(&this) + (int)type.Size);
|
||||
EnumToString(type, strBuffer, *iPtr);
|
||||
//EnumToString(GetType(), )
|
||||
}*/
|
||||
var typeInst = (TypeInstance)typeof(T);
|
||||
for (var field in typeInst.GetFields())
|
||||
{
|
||||
if (field.[Friend]mFieldData.[Friend]mData == (.)value)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static EnumEnumerator<TEnum> GetEnumerator<TEnum>()
|
||||
where TEnum : enum
|
||||
{
|
||||
return .();
|
||||
}
|
||||
|
||||
public static EnumValuesEnumerator<TEnum> GetValues<TEnum>()
|
||||
where TEnum : enum
|
||||
{
|
||||
return .();
|
||||
}
|
||||
|
||||
public static EnumNamesEnumerator<TEnum> GetNames<TEnum>()
|
||||
where TEnum : enum
|
||||
{
|
||||
return .();
|
||||
}
|
||||
|
||||
private struct EnumFieldsEnumerator<TEnum>
|
||||
where TEnum : enum
|
||||
{
|
||||
TypeInstance mTypeInstance;
|
||||
int32 mIdx;
|
||||
|
||||
public this()
|
||||
{
|
||||
mTypeInstance = typeof(TEnum) as TypeInstance;
|
||||
mIdx = -1;
|
||||
}
|
||||
|
||||
public void Reset() mut
|
||||
{
|
||||
mIdx = -1;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveNext() mut
|
||||
{
|
||||
if (mTypeInstance == null)
|
||||
return false;
|
||||
|
||||
TypeInstance.FieldData* fieldData = null;
|
||||
|
||||
repeat
|
||||
{
|
||||
mIdx++;
|
||||
if (mIdx == mTypeInstance.[Friend]mFieldDataCount)
|
||||
return false;
|
||||
fieldData = &mTypeInstance.[Friend]mFieldDataPtr[mIdx];
|
||||
}
|
||||
while (!fieldData.mFlags.HasFlag(.EnumCase));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public FieldInfo Current
|
||||
{
|
||||
get
|
||||
{
|
||||
var fieldData = &mTypeInstance.[Friend]mFieldDataPtr[mIdx];
|
||||
return FieldInfo(mTypeInstance, fieldData);
|
||||
}
|
||||
}
|
||||
|
||||
public int32 Index
|
||||
{
|
||||
get
|
||||
{
|
||||
return mIdx;
|
||||
}
|
||||
}
|
||||
|
||||
public Result<FieldInfo> GetNext() mut
|
||||
{
|
||||
if (!MoveNext())
|
||||
return .Err;
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnumEnumerator<TEnum> : EnumFieldsEnumerator<TEnum>, IEnumerator<(StringView name, TEnum value)>
|
||||
where TEnum : enum
|
||||
{
|
||||
public new (StringView name, TEnum value) Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((.)base.Current.[Friend]mFieldData.[Friend]mName, (.)base.Current.[Friend]mFieldData.[Friend]mData);
|
||||
}
|
||||
}
|
||||
|
||||
public new Result<(StringView name, TEnum value)> GetNext() mut
|
||||
{
|
||||
if (!MoveNext())
|
||||
return .Err;
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnumValuesEnumerator<TEnum> : EnumFieldsEnumerator<TEnum>, IEnumerator<TEnum>
|
||||
where TEnum : enum
|
||||
{
|
||||
public new TEnum Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return (.)base.Current.[Friend]mFieldData.[Friend]mData;
|
||||
}
|
||||
}
|
||||
|
||||
public new Result<TEnum> GetNext() mut
|
||||
{
|
||||
if (!MoveNext())
|
||||
return .Err;
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
|
||||
public struct EnumNamesEnumerator<TEnum> : EnumFieldsEnumerator<TEnum>, IEnumerator<StringView>
|
||||
where TEnum : enum
|
||||
{
|
||||
public new StringView Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return (.)base.Current.[Friend]mFieldData.[Friend]mName;
|
||||
}
|
||||
}
|
||||
|
||||
public new Result<StringView> GetNext() mut
|
||||
{
|
||||
if (!MoveNext())
|
||||
return .Err;
|
||||
return Current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace System.IO
|
|||
{
|
||||
public struct VTable : COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IPersistFile* self, Guid* pClassID) GetClassID;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self, Guid* pClassID) GetClassID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,11 @@ namespace System.IO
|
|||
|
||||
public struct VTable : COM_IPersist.VTable
|
||||
{
|
||||
public function HResult(COM_IPersistFile* self) IsDirty;
|
||||
public function HResult(COM_IPersistFile* self, char16* pszFileName) Load;
|
||||
public function HResult(COM_IPersistFile* self, char16* pszFileName, Windows.IntBool remember) Save;
|
||||
public function HResult(COM_IPersistFile* self, char16* pszFileName) SaveCompleted;
|
||||
public function HResult(COM_IPersistFile* self, char16* pszName) GetCurFile;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self) IsDirty;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self, char16* pszFileName) Load;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self, char16* pszFileName, Windows.IntBool remember) Save;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self, char16* pszFileName) SaveCompleted;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IPersistFile* self, char16* pszName) GetCurFile;
|
||||
}
|
||||
public new VTable* VT
|
||||
{
|
||||
|
@ -43,24 +43,24 @@ namespace System.IO
|
|||
|
||||
public struct VTable : Windows.COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IShellLink* self, char16* pszFile, int32 cch, Windows.NativeFindData* pfd, uint32 fFlags) GetPath;
|
||||
public function HResult(COM_IShellLink* self, IDLIST** ppidl) GetIDList;
|
||||
public function HResult(COM_IShellLink* self, IDLIST* pidl) SetIDList;
|
||||
public function HResult(COM_IShellLink* self, char16* pszName, int32 cch) GetDescription;
|
||||
public function HResult(COM_IShellLink* self, char16* pszName) SetDescription;
|
||||
public function HResult(COM_IShellLink* self, char16* pszDir, int32 cch) GetWorkingDirectory;
|
||||
public function HResult(COM_IShellLink* self, char16* pszDir) SetWorkingDirectory;
|
||||
public function HResult(COM_IShellLink* self, char16* pszArgs, int32 cch) GetArguments;
|
||||
public function HResult(COM_IShellLink* self, char16* pszArgs) SetArguments;
|
||||
public function HResult(COM_IShellLink* self, uint16 *pwHotkey) GetHotkey;
|
||||
public function HResult(COM_IShellLink* self, uint16 wHotkey) SetHotkey;
|
||||
public function HResult(COM_IShellLink* self, int32 *piShowCmd) GetShowCmd;
|
||||
public function HResult(COM_IShellLink* self, int32 iShowCmd) SetShowCmd;
|
||||
public function HResult(COM_IShellLink* self, char16* pszIconPath, int32 cch, int32 *piIcon) GetIconLocation;
|
||||
public function HResult(COM_IShellLink* self, char16* pszIconPath, int32 iIcon) SetIconLocation;
|
||||
public function HResult(COM_IShellLink* self, char16* pszPathRel, uint32 dwReserved) SetRelativePath;
|
||||
public function HResult(COM_IShellLink* self, Windows.HWnd hwnd, uint32 fFlags) Resolve;
|
||||
public function HResult(COM_IShellLink* self, char16* pszFile) SetPath;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszFile, int32 cch, Windows.NativeFindData* pfd, uint32 fFlags) GetPath;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, IDLIST** ppidl) GetIDList;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, IDLIST* pidl) SetIDList;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszName, int32 cch) GetDescription;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszName) SetDescription;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszDir, int32 cch) GetWorkingDirectory;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszDir) SetWorkingDirectory;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszArgs, int32 cch) GetArguments;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszArgs) SetArguments;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, uint16 *pwHotkey) GetHotkey;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, uint16 wHotkey) SetHotkey;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, int32 *piShowCmd) GetShowCmd;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, int32 iShowCmd) SetShowCmd;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszIconPath, int32 cch, int32 *piIcon) GetIconLocation;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszIconPath, int32 iIcon) SetIconLocation;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszPathRel, uint32 dwReserved) SetRelativePath;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, Windows.HWnd hwnd, uint32 fFlags) Resolve;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellLink* self, char16* pszFile) SetPath;
|
||||
|
||||
}
|
||||
public new VTable* VT
|
||||
|
|
|
@ -118,6 +118,9 @@ namespace System
|
|||
|
||||
public this()
|
||||
{
|
||||
if (Compiler.IsComptime)
|
||||
return;
|
||||
|
||||
#if BF_PLATFORM_WINDOWS
|
||||
bool isWinSrv()
|
||||
{
|
||||
|
|
|
@ -105,7 +105,8 @@ namespace System.Reflection
|
|||
argIdx++;
|
||||
}
|
||||
|
||||
methodInfo.Invoke(targetAttr, params args);
|
||||
if (methodInfo.Invoke(targetAttr, params args) case .Ok(var val))
|
||||
val.Dispose();
|
||||
return .Ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ namespace System
|
|||
{
|
||||
let bufferSize = 16 - sizeof(char8*);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace System
|
|||
let count = str.mLength;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
Internal.MemCpy(Ptr, str.Ptr, count);
|
||||
mLength = count;
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
|
@ -106,7 +106,7 @@ namespace System
|
|||
let count = str.mLength - offset;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = str.Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
|
@ -123,7 +123,7 @@ namespace System
|
|||
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = str.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -137,7 +137,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
ptr[i] = c;
|
||||
|
@ -151,7 +151,7 @@ namespace System
|
|||
let count = Internal.CStrLen(char8Ptr);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int_strsize i = 0; i < count; i++)
|
||||
ptr[i] = char8Ptr[i];
|
||||
|
@ -164,7 +164,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
ptr[i] = char8Ptr[i];
|
||||
|
@ -178,7 +178,7 @@ namespace System
|
|||
let count = UTF16.GetLengthAsUTF8(char16Ptr);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
UTF16.Decode(char16Ptr, this);
|
||||
|
@ -190,7 +190,7 @@ namespace System
|
|||
let count = UTF16.GetLengthAsUTF8(chars);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
mLength = 0;
|
||||
UTF16.Decode(chars, this);
|
||||
|
@ -202,7 +202,7 @@ namespace System
|
|||
let tryBufferSize = strView.Length - sizeof(char8*);
|
||||
let bufferSize = (tryBufferSize >= 0) ? tryBufferSize : 0;
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
Internal.MemCpy(ptr, strView.Ptr, strView.Length);
|
||||
mAllocSizeAndFlags = (uint_strsize)bufferSize + (int_strsize)sizeof(char8*);
|
||||
|
@ -215,7 +215,7 @@ namespace System
|
|||
let count = strView.Length + (flags.HasFlag(.NullTerminate) ? 1 : 0);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
Internal.MemCpy(ptr, strView.Ptr, strView.Length);
|
||||
if (flags.HasFlag(.NullTerminate))
|
||||
|
@ -232,7 +232,7 @@ namespace System
|
|||
let count = strView.Length - offset;
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = strView.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -249,7 +249,7 @@ namespace System
|
|||
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
let srcPtr = strView.Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
|
@ -263,7 +263,7 @@ namespace System
|
|||
{
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
for (int i = 0; i < count; i++)
|
||||
ptr[i] = chars[i + offset];
|
||||
|
@ -285,7 +285,7 @@ namespace System
|
|||
int count = StrLengths(strs);
|
||||
int bufferSize = (count == 0) ? 0 : (count - 1) & ~(sizeof(char8*) - 1);
|
||||
#unwarn
|
||||
char8* addlPtr = append char8[bufferSize]*;
|
||||
char8* addlPtr = append char8[bufferSize]*(?);
|
||||
let ptr = Ptr;
|
||||
int curIdx = 0;
|
||||
for (var str in strs)
|
||||
|
@ -1965,6 +1965,22 @@ namespace System
|
|||
return EqualsIgnoreCaseHelper(a.Ptr, b.Ptr, a.mLength);
|
||||
return EqualsHelper(a.Ptr, b.Ptr, a.mLength);
|
||||
}
|
||||
|
||||
public bool Equals(StringView str)
|
||||
{
|
||||
if (mLength != str.[Friend]mLength)
|
||||
return false;
|
||||
return EqualsHelper(str.Ptr, mPtr, mLength);
|
||||
}
|
||||
|
||||
public bool Equals(StringView str, StringComparison comparisonType = StringComparison.Ordinal)
|
||||
{
|
||||
if (mLength != str.[Friend]mLength)
|
||||
return false;
|
||||
if (comparisonType == StringComparison.OrdinalIgnoreCase)
|
||||
return EqualsIgnoreCaseHelper(str.Ptr, mPtr, mLength);
|
||||
return EqualsHelper(str.Ptr, mPtr, mLength);
|
||||
}
|
||||
|
||||
public bool StartsWith(StringView b, StringComparison comparisonType = StringComparison.Ordinal)
|
||||
{
|
||||
|
@ -2278,6 +2294,36 @@ namespace System
|
|||
TrimStart((.)trimChar);
|
||||
TrimEnd((.)trimChar);
|
||||
}
|
||||
|
||||
public void PadLeft(int totalWidth, char8 paddingChar)
|
||||
{
|
||||
Insert(0, paddingChar, totalWidth - Length);
|
||||
}
|
||||
|
||||
public void PadLeft(int totalWidth, char32 paddingChar)
|
||||
{
|
||||
Insert(0, paddingChar, totalWidth - Length);
|
||||
}
|
||||
|
||||
public void PadLeft(int totalWidth)
|
||||
{
|
||||
Insert(0, ' ', totalWidth - Length);
|
||||
}
|
||||
|
||||
public void PadRight(int totalWidth, char8 paddingChar)
|
||||
{
|
||||
Append(paddingChar, totalWidth - Length);
|
||||
}
|
||||
|
||||
public void PadRight(int totalWidth, char32 paddingChar)
|
||||
{
|
||||
Append(paddingChar, totalWidth - Length);
|
||||
}
|
||||
|
||||
public void PadRight(int totalWidth)
|
||||
{
|
||||
Append(' ', totalWidth - Length);
|
||||
}
|
||||
|
||||
public void Join(StringView sep, IEnumerator<String> enumerable)
|
||||
{
|
||||
|
|
|
@ -1250,7 +1250,8 @@ namespace System.Reflection
|
|||
Const = 0x0040, // Value is compile time constant.
|
||||
SpecialName = 0x0080, // field is special. Name describes how.
|
||||
EnumPayload = 0x0100,
|
||||
EnumDiscriminator = 0x0200
|
||||
EnumDiscriminator = 0x0200,
|
||||
EnumCase = 0x0400
|
||||
}
|
||||
|
||||
public enum MethodFlags : uint16
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Diagnostics;
|
|||
|
||||
namespace System
|
||||
{
|
||||
struct Variant
|
||||
struct Variant : IDisposable
|
||||
{
|
||||
enum ObjectType
|
||||
{
|
||||
|
@ -472,4 +472,4 @@ namespace System
|
|||
return variant;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace System
|
|||
|
||||
public struct VTable
|
||||
{
|
||||
public function HResult(COM_IUnknown* self, ref Guid riid, void** result) QueryInterface;
|
||||
public function uint32(COM_IUnknown* self) AddRef;
|
||||
public function uint32(COM_IUnknown* self) Release;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IUnknown* self, ref Guid riid, void** result) QueryInterface;
|
||||
public function [CallingConvention(.Stdcall)] uint32(COM_IUnknown* self) AddRef;
|
||||
public function [CallingConvention(.Stdcall)] uint32(COM_IUnknown* self) Release;
|
||||
}
|
||||
|
||||
public enum HResult : int32
|
||||
|
@ -1124,14 +1124,13 @@ namespace System
|
|||
|
||||
public struct VTable : Windows.COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFileOk;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* psiFolder) OnFolderChanging;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFolderChange;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnSelectionChange;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, FDE_SHAREVIOLATION_RESPONSE* pResponse) OnShareViolation;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnTypeChange;
|
||||
public function HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* shellItem, FDE_OVERWRITE_RESPONSE* response) OnOverwrite;
|
||||
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFileOk;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* psiFolder) OnFolderChanging;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnFolderChange;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnSelectionChange;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, FDE_SHAREVIOLATION_RESPONSE* pResponse) OnShareViolation;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog) OnTypeChange;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialogEvents* self, COM_IFileDialog* fileDialog, COM_IShellItem* shellItem, FDE_OVERWRITE_RESPONSE* response) OnOverwrite;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1154,12 +1153,11 @@ namespace System
|
|||
|
||||
public struct VTable : Windows.COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IShellItem* self, void* pbc, ref Guid bhid, ref Guid riid, void** ppv) BindToHandler;
|
||||
public function HResult(COM_IShellItem* self, out COM_IShellItem* ppsi) GetParent;
|
||||
public function HResult(COM_IShellItem* self, SIGDN sigdnName, out char16* ppszName) GetDisplayName;
|
||||
public function HResult(COM_IShellItem* self, uint sfgaoMask, out uint psfgaoAttribs) GetAttributes;
|
||||
public function HResult(COM_IShellItem* self, COM_IShellItem* psi, uint32 hint, out int32 piOrder) Compare;
|
||||
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItem* self, void* pbc, ref Guid bhid, ref Guid riid, void** ppv) BindToHandler;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItem* self, out COM_IShellItem* ppsi) GetParent;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItem* self, SIGDN sigdnName, out char16* ppszName) GetDisplayName;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItem* self, uint sfgaoMask, out uint psfgaoAttribs) GetAttributes;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItem* self, COM_IShellItem* psi, uint32 hint, out int32 piOrder) Compare;
|
||||
}
|
||||
public new VTable* VT
|
||||
{
|
||||
|
@ -1207,13 +1205,13 @@ namespace System
|
|||
|
||||
public struct VTable : Windows.COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IShellItemArray* self, void* pbc, ref Guid rbhid, ref Guid riid, out void* ppvOut) BindToHandler;
|
||||
public function HResult(COM_IShellItemArray* self, GETPROPERTYSTOREFLAGS flags, ref Guid riid, out void* ppv) GetPropertyStore;
|
||||
public function HResult(COM_IShellItemArray* self, ref PROPERTYKEY keyType, ref Guid riid, out void* ppv) GetPropertyDescriptionList;
|
||||
public function HResult(COM_IShellItemArray* self, SIATTRIBFLAGS dwAttribFlags, uint32 sfgaoMask, out uint32 psfgaoAttribs) GetAttributes;
|
||||
public function HResult(COM_IShellItemArray* self, out uint32 pdwNumItems) GetCount;
|
||||
public function HResult(COM_IShellItemArray* self, uint32 dwIndex, out COM_IShellItem* ppsi) GetItemAt;
|
||||
public function HResult(COM_IShellItemArray* self, out void* ppenumShellItems) EnumItems;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, void* pbc, ref Guid rbhid, ref Guid riid, out void* ppvOut) BindToHandler;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, GETPROPERTYSTOREFLAGS flags, ref Guid riid, out void* ppv) GetPropertyStore;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, ref PROPERTYKEY keyType, ref Guid riid, out void* ppv) GetPropertyDescriptionList;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, SIATTRIBFLAGS dwAttribFlags, uint32 sfgaoMask, out uint32 psfgaoAttribs) GetAttributes;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, out uint32 pdwNumItems) GetCount;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, uint32 dwIndex, out COM_IShellItem* ppsi) GetItemAt;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IShellItemArray* self, out void* ppenumShellItems) EnumItems;
|
||||
}
|
||||
public new VTable* VT
|
||||
{
|
||||
|
@ -1268,30 +1266,30 @@ namespace System
|
|||
|
||||
public struct VTable : Windows.COM_IUnknown.VTable
|
||||
{
|
||||
public function HResult(COM_IFileDialog* self, Windows.HWnd parent) Show;
|
||||
public function HResult(COM_IFileDialog* self, uint cFileTypes, COMDLG_FILTERSPEC* rgFilterSpec) SetFileTypes;
|
||||
public function HResult(COM_IFileDialog* self, uint iFileType) SetFileTypeIndex;
|
||||
public function HResult(COM_IFileDialog* self, out uint piFileType) GetFileTypeIndex;
|
||||
public function HResult(COM_IFileDialog* self, COM_IFileDialogEvents* pfde, out uint pdwCookie) Advise;
|
||||
public function HResult(COM_IFileDialog* self, uint dwCookie) Unadvise;
|
||||
public function HResult(COM_IFileDialog* self, FOS fos) SetOptions;
|
||||
public function HResult(COM_IFileDialog* self, out FOS pfos) GetOptions;
|
||||
public function HResult(COM_IFileDialog* self, COM_IShellItem* psi) SetDefaultFolder;
|
||||
public function HResult(COM_IFileDialog* self, COM_IShellItem* psi) SetFolder;
|
||||
public function HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetFolder;
|
||||
public function HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetCurrentSelection;
|
||||
public function HResult(COM_IFileDialog* self, char16* pszName) SetFileName;
|
||||
public function HResult(COM_IFileDialog* self, out char16* pszName) GetFileName;
|
||||
public function HResult(COM_IFileDialog* self, char16* pszTitle) SetTitle;
|
||||
public function HResult(COM_IFileDialog* self, char16* pszText) SetOkButtonLabel;
|
||||
public function HResult(COM_IFileDialog* self, char16* pszLabel) SetFileNameLabel;
|
||||
public function HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetResult;
|
||||
public function HResult(COM_IFileDialog* self, COM_IShellItem* psi, FDAP fdap) AddPlace;
|
||||
public function HResult(COM_IFileDialog* self, char16* pszDefaultExtension) SetDefaultExtension;
|
||||
public function HResult(COM_IFileDialog* self, int hr) Close;
|
||||
public function HResult(COM_IFileDialog* self, ref Guid guid) SetClientGuid;
|
||||
public function HResult(COM_IFileDialog* self) ClearClientData;
|
||||
public function HResult(COM_IFileDialog* self, void* pFilter) SetFilter;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, Windows.HWnd parent) Show;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, uint cFileTypes, COMDLG_FILTERSPEC* rgFilterSpec) SetFileTypes;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, uint iFileType) SetFileTypeIndex;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out uint piFileType) GetFileTypeIndex;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, COM_IFileDialogEvents* pfde, out uint pdwCookie) Advise;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, uint dwCookie) Unadvise;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, FOS fos) SetOptions;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out FOS pfos) GetOptions;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, COM_IShellItem* psi) SetDefaultFolder;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, COM_IShellItem* psi) SetFolder;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetFolder;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetCurrentSelection;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, char16* pszName) SetFileName;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out char16* pszName) GetFileName;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, char16* pszTitle) SetTitle;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, char16* pszText) SetOkButtonLabel;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, char16* pszLabel) SetFileNameLabel;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, out COM_IShellItem* ppsi) GetResult;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, COM_IShellItem* psi, FDAP fdap) AddPlace;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, char16* pszDefaultExtension) SetDefaultExtension;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, int hr) Close;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, ref Guid guid) SetClientGuid;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self) ClearClientData;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileDialog* self, void* pFilter) SetFilter;
|
||||
}
|
||||
public new VTable* VT
|
||||
{
|
||||
|
@ -1314,8 +1312,8 @@ namespace System
|
|||
|
||||
public struct VTable : COM_IFileDialog.VTable
|
||||
{
|
||||
public function HResult(COM_IFileOpenDialog* self, out COM_IShellItemArray* ppenum) GetResults;
|
||||
public function HResult(COM_IFileOpenDialog* self, out COM_IShellItemArray* ppsai) GetSelectedItems;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileOpenDialog* self, out COM_IShellItemArray* ppenum) GetResults;
|
||||
public function [CallingConvention(.Stdcall)] HResult(COM_IFileOpenDialog* self, out COM_IShellItemArray* ppsai) GetSelectedItems;
|
||||
}
|
||||
public new VTable* VT
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue