Types in CilBrowser.Core namespace: AssemblyServer CilBrowserOptions FileUtils HtmlAttribute HtmlBuilder HtmlGenerator ServerBase SourceServer Utils WebsiteGenerator |
.class public abstract auto ansi sealed beforefieldinit CilBrowser.Core.Utils
extends [netstandard]System.Object
{
.method public hidebysig static bool StrEquals(
string left,
string right
) cil managed
{
.maxstack 3
.locals init (bool V_0)
nop
ldarg.0
ldarg.1
ldc.i4.4
call bool [netstandard]System.String::Equals(string, string, valuetype [netstandard]System.StringComparison)
stloc.0
br.s IL_0001
IL_0001: ldloc.0
ret
}
.method public hidebysig static string GetDirectoryNameFromPath(
string path
) cil managed
{
.maxstack 4
.locals init (bool V_0,
string V_1)
nop
ldarg.0
ldstr "\\"
callvirt instance bool [netstandard]System.String::EndsWith(string)
brtrue.s IL_0001
ldarg.0
ldstr "/"
callvirt instance bool [netstandard]System.String::EndsWith(string)
br.s IL_0002
IL_0001: ldc.i4.1
IL_0002: stloc.0
ldloc.0
brfalse.s IL_0003
nop
ldarg.0
ldc.i4.0
ldarg.0
callvirt instance int32 [netstandard]System.String::get_Length()
ldc.i4.1
sub
callvirt instance string [netstandard]System.String::Substring(int32, int32)
call string [netstandard]System.IO.Path::GetFileName(string)
stloc.1
br.s IL_0004
IL_0003: nop
ldarg.0
call string [netstandard]System.IO.Path::GetFileName(string)
stloc.1
br.s IL_0004
IL_0004: ldloc.1
ret
}
.method public hidebysig static string UrlAppend(
string url,
string str
) cil managed
{
.maxstack 3
.locals init (bool V_0,
string V_1)
nop
ldarg.0
ldstr "/"
ldc.i4.4
callvirt instance bool [netstandard]System.String::EndsWith(string, valuetype [netstandard]System.StringComparison)
stloc.0
ldloc.0
brfalse.s IL_0001
ldarg.0
ldarg.1
call string [netstandard]System.String::Concat(string, string)
stloc.1
br.s IL_0002
IL_0001: ldarg.0
ldstr "/"
ldarg.1
call string [netstandard]System.String::Concat(string, string, string)
stloc.1
br.s IL_0002
IL_0002: ldloc.1
ret
}
.method public hidebysig static int32 CompareTypes(
class [netstandard]System.Type x,
class [netstandard]System.Type y
) cil managed
{
.maxstack 3
.locals init (string V_0,
string V_1,
int32 V_2)
nop
ldarg.0
callvirt instance string [netstandard]System.Type::get_FullName()
stloc.0
ldarg.1
callvirt instance string [netstandard]System.Type::get_FullName()
stloc.1
ldloc.0
ldloc.1
ldc.i4.5
call int32 [netstandard]System.String::Compare(string, string, valuetype [netstandard]System.StringComparison)
stloc.2
br.s IL_0001
IL_0001: ldloc.2
ret
}
.method public hidebysig static class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>> GroupByNamespace(
class [netstandard]System.Type[] types
) cil managed
{
.maxstack 3
.locals init (class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>> V_0,
int32 V_1,
string V_2,
class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type> V_3,
bool V_4,
bool V_5,
bool V_6,
valuetype [???]System.Collections.Generic.KeyCollection/Enumerator<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>> V_7,
string V_8,
class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type> V_9,
class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>> V_10)
nop
newobj instance void class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::.ctor()
stloc.0
ldc.i4.0
stloc.1
br.s IL_0005
IL_0001: nop
ldarg.0
ldloc.1
ldelem.ref
callvirt instance string [netstandard]System.Type::get_Namespace()
stloc.2
ldloc.2
ldnull
ceq
stloc.s V_4
ldloc.s V_4
brfalse.s IL_0002
ldsfld string [netstandard]System.String::Empty
stloc.2
IL_0002: ldloc.0
ldloc.2
callvirt instance bool class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::ContainsKey(!0)
stloc.s V_5
ldloc.s V_5
brfalse.s IL_0003
nop
ldloc.0
ldloc.2
callvirt instance !1 class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::get_Item(!0)
stloc.3
nop
br.s IL_0004
IL_0003: nop
newobj instance void class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>::.ctor()
stloc.3
ldloc.0
ldloc.2
ldloc.3
callvirt instance void class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::set_Item(!0, !1)
nop
nop
IL_0004: ldloc.3
ldarg.0
ldloc.1
ldelem.ref
callvirt instance void class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>::Add(!0)
nop
nop
ldloc.1
ldc.i4.1
add
stloc.1
IL_0005: ldloc.1
ldarg.0
ldlen
conv.i4
clt
stloc.s V_6
ldloc.s V_6
brtrue.s IL_0001
nop
ldloc.0
callvirt instance class [netstandard]System.Collections.Generic.Dictionary`2/KeyCollection<!0, !1> class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::get_Keys()
callvirt instance valuetype [???]System.Collections.Generic.KeyCollection/Enumerator<!0, !1> class [netstandard]System.Collections.Generic.Dictionary`2/KeyCollection<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::GetEnumerator()
stloc.s V_7
.try
{
br.s IL_0007
IL_0006: ldloca.s V_7
call instance !0 valuetype [???]System.Collections.Generic.KeyCollection/Enumerator<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::get_Current()
stloc.s V_8
nop
ldloc.0
ldloc.s V_8
callvirt instance !1 class [netstandard]System.Collections.Generic.Dictionary`2<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::get_Item(!0)
stloc.s V_9
ldloc.s V_9
ldnull
ldftn int32 CilBrowser.Core.Utils::CompareTypes(class [netstandard]System.Type, class [netstandard]System.Type)
newobj instance void class [netstandard]System.Comparison`1<class [netstandard]System.Type>::.ctor(object, native int)
callvirt instance void class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>::Sort(class [netstandard]System.Comparison`1<!0>)
nop
nop
IL_0007: ldloca.s V_7
call instance bool valuetype [???]System.Collections.Generic.KeyCollection/Enumerator<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>::MoveNext()
brtrue.s IL_0006
leave.s IL_0008
}
finally
{
ldloca.s V_7
constrained. valuetype [???]System.Collections.Generic.KeyCollection/Enumerator<string, class [netstandard]System.Collections.Generic.List`1<class [netstandard]System.Type>>
callvirt instance void [netstandard]System.IDisposable::Dispose()
nop
endfinally
}
IL_0008: ldloc.0
stloc.s V_10
br.s IL_0009
IL_0009: ldloc.s V_10
ret
}
.method public hidebysig static bool IsMatchingNamespaceFilter(
class [netstandard]System.Type t,
string nsFilter
) cil managed
{
.maxstack 2
.locals init (bool V_0,
bool V_1,
bool V_2)
nop
ldarg.1
callvirt instance int32 [netstandard]System.String::get_Length()
ldc.i4.0
ceq
stloc.0
ldloc.0
brfalse.s IL_0001
ldc.i4.1
stloc.1
br.s IL_0003
IL_0001: ldarg.0
ldnull
call bool [netstandard]System.Type::op_Equality(class [netstandard]System.Type, class [netstandard]System.Type)
stloc.2
ldloc.2
brfalse.s IL_0002
ldc.i4.0
stloc.1
br.s IL_0003
IL_0002: ldarg.0
callvirt instance string [netstandard]System.Type::get_Namespace()
ldarg.1
call bool CilBrowser.Core.Utils::StrEquals(string, string)
stloc.1
br.s IL_0003
IL_0003: ldloc.1
ret
}
.method public hidebysig static bool IsTypeInAssembly(
class [netstandard]System.Type t,
class [netstandard]System.Reflection.Assembly ass
) cil managed
{
.maxstack 3
.locals init (class [netstandard]System.Reflection.Assembly V_0,
string V_1,
string V_2,
bool V_3,
bool V_4,
bool V_5)
nop
ldarg.0
ldnull
call bool [netstandard]System.Type::op_Equality(class [netstandard]System.Type, class [netstandard]System.Type)
brtrue.s IL_0001
ldarg.1
ldnull
call bool [netstandard]System.Reflection.Assembly::op_Equality(class [netstandard]System.Reflection.Assembly, class [netstandard]System.Reflection.Assembly)
br.s IL_0002
IL_0001: ldc.i4.1
IL_0002: stloc.3
ldloc.3
brfalse.s IL_0003
ldc.i4.0
stloc.s V_4
br.s IL_0005
IL_0003: ldarg.0
callvirt instance class [netstandard]System.Reflection.Assembly [netstandard]System.Type::get_Assembly()
stloc.0
ldloc.0
ldnull
call bool [netstandard]System.Reflection.Assembly::op_Equality(class [netstandard]System.Reflection.Assembly, class [netstandard]System.Reflection.Assembly)
stloc.s V_5
ldloc.s V_5
brfalse.s IL_0004
ldc.i4.0
stloc.s V_4
br.s IL_0005
IL_0004: ldloc.0
callvirt instance class [netstandard]System.Reflection.AssemblyName [netstandard]System.Reflection.Assembly::GetName()
callvirt instance string [netstandard]System.Reflection.AssemblyName::get_Name()
stloc.1
ldarg.1
callvirt instance class [netstandard]System.Reflection.AssemblyName [netstandard]System.Reflection.Assembly::GetName()
callvirt instance string [netstandard]System.Reflection.AssemblyName::get_Name()
stloc.2
ldloc.1
ldloc.2
ldc.i4.3
call bool [netstandard]System.String::Equals(string, string, valuetype [netstandard]System.StringComparison)
stloc.s V_4
br.s IL_0005
IL_0005: ldloc.s V_4
ret
}
.method public hidebysig static string CreateTempDir(
string dirname
) cil managed
{
.maxstack 3
.locals init (string V_0,
string V_1,
class [netstandard]System.Random V_2,
int32 V_3,
int32 V_4,
string V_5,
bool V_6,
bool V_7,
string V_8,
bool V_9,
bool V_10)
nop
ldtoken CilBrowser.Core.Utils
call class [netstandard]System.Type [netstandard]System.Type::GetTypeFromHandle(valuetype [netstandard]System.RuntimeTypeHandle)
callvirt instance class [netstandard]System.Reflection.Assembly [netstandard]System.Type::get_Assembly()
callvirt instance string [netstandard]System.Reflection.Assembly::get_Location()
call string [netstandard]System.IO.Path::GetDirectoryName(string)
stloc.0
ldsfld string [netstandard]System.String::Empty
stloc.1
newobj instance void [netstandard]System.Random::.ctor()
stloc.2
ldc.i4.0
stloc.3
br IL_0008
IL_0001: nop
ldloc.2
callvirt instance int32 [netstandard]System.Random::Next()
stloc.s V_4
ldloca.s V_4
ldstr "X"
call instance string [netstandard]System.Int32::ToString(string)
stloc.s V_5
ldarg.0
call bool [netstandard]System.String::IsNullOrEmpty(string)
ldc.i4.0
ceq
stloc.s V_6
ldloc.s V_6
brfalse.s IL_0002
ldloc.0
ldloc.s V_5
ldarg.0
call string [netstandard]System.IO.Path::Combine(string, string, string)
stloc.1
br.s IL_0003
IL_0002: ldloc.0
ldloc.s V_5
call string [netstandard]System.IO.Path::Combine(string, string)
stloc.1
IL_0003: ldloc.1
call bool [netstandard]System.IO.File::Exists(string)
brtrue.s IL_0004
ldloc.1
call bool [netstandard]System.IO.Directory::Exists(string)
ldc.i4.0
ceq
br.s IL_0005
IL_0004: ldc.i4.0
IL_0005: stloc.s V_7
ldloc.s V_7
brfalse.s IL_0006
nop
ldloc.1
call class [netstandard]System.IO.DirectoryInfo [netstandard]System.IO.Directory::CreateDirectory(string)
pop
ldloc.1
stloc.s V_8
br.s IL_0009
IL_0006: ldloc.3
ldc.i4.1
add
stloc.3
ldloc.3
ldc.i4 2000
cgt
stloc.s V_9
ldloc.s V_9
brfalse.s IL_0007
ldstr "Failed to generate temp directory name"
newobj instance void [netstandard]System.IO.IOException::.ctor(string)
throw
IL_0007: nop
IL_0008: ldc.i4.1
stloc.s V_10
br IL_0001
IL_0009: ldloc.s V_8
ret
}
.method public hidebysig static bool DeleteTempDirRecursive(
string dir,
int32 n
) cil managed
{
.maxstack 3
.locals init (string[] V_0,
bool V_1,
string[] V_2,
int32 V_3,
bool V_4,
bool V_5,
bool V_6,
int32 V_7,
bool V_8,
bool V_9,
bool V_10,
bool V_11)
nop
ldarg.0
call string[] [netstandard]System.IO.Directory::GetFiles(string)
stloc.0
ldc.i4.1
stloc.1
ldc.i4.0
stloc.3
br.s IL_0003
IL_0001: nop
.try
{
nop
ldloc.0
ldloc.3
ldelem.ref
call void [netstandard]System.IO.File::Delete(string)
nop
nop
leave.s IL_0002
}
catch [netstandard]System.Exception
{
pop
nop
ldc.i4.0
stloc.1
nop
leave.s IL_0002
}
IL_0002: nop
ldloc.3
ldc.i4.1
add
stloc.3
IL_0003: ldloc.3
ldloc.0
ldlen
conv.i4
clt
stloc.s V_4
ldloc.s V_4
brtrue.s IL_0001
ldarg.1
ldc.i4 500
cgt
stloc.s V_5
ldloc.s V_5
brfalse.s IL_0004
nop
ldstr "Error: recursion is too deep when removing temp dirs!"
call void [netstandard]System.Console::WriteLine(string)
nop
ldc.i4.0
stloc.s V_6
br.s IL_0010
IL_0004: ldarg.0
call string[] [netstandard]System.IO.Directory::GetDirectories(string)
stloc.2
ldc.i4.0
stloc.s V_7
br.s IL_0007
IL_0005: nop
ldloc.2
ldloc.s V_7
ldelem.ref
ldarg.1
ldc.i4.1
add
call bool CilBrowser.Core.Utils::DeleteTempDirRecursive(string, int32)
stloc.s V_8
ldloc.s V_8
ldc.i4.0
ceq
stloc.s V_9
ldloc.s V_9
brfalse.s IL_0006
ldc.i4.0
stloc.1
IL_0006: nop
ldloc.s V_7
ldc.i4.1
add
stloc.s V_7
IL_0007: ldloc.s V_7
ldloc.2
ldlen
conv.i4
clt
stloc.s V_10
ldloc.s V_10
brtrue.s IL_0005
ldloc.1
stloc.s V_11
ldloc.s V_11
brfalse.s IL_0009
nop
.try
{
nop
ldarg.0
call void [netstandard]System.IO.Directory::Delete(string)
nop
nop
leave.s IL_0008
}
catch [netstandard]System.Exception
{
pop
nop
nop
leave.s IL_0008
}
IL_0008: nop
IL_0009: ldloc.1
stloc.s V_6
br.s IL_0010
IL_0010: ldloc.s V_6
ret
}
}
|