Move some classes to Cryville.Common.

This commit is contained in:
2023-05-03 22:51:30 +08:00
parent 8f211568be
commit b143fb49ce
90 changed files with 788 additions and 2457 deletions

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: bac705fb1491fd84b8d4feb7a4dae3b0
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,261 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Common.Buffers</name>
</assembly>
<members>
<member name="T:Cryville.Common.Buffers.ArrayPool`1">
<summary>
A resource pool that allows reusing instances of arrays of type <typeparamref name="T" />.
</summary>
<typeparam name="T">The item type of the arrays in the pool.</typeparam>
</member>
<member name="M:Cryville.Common.Buffers.ArrayPool`1.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.ArrayPool`1" /> class with the default maximum list size and bucket capacity.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.ArrayPool`1.#ctor(System.Int32,System.Int32)">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.ArrayPool`1" /> class.
</summary>
<param name="maxSize">The maximum size of the arrays in the pool.</param>
<param name="capacityPerBucket">The capacity of each bucket. The pool groups arrays of similar sizes into buckets for faster access.</param>
</member>
<member name="M:Cryville.Common.Buffers.ArrayPool`1.Rent(System.Int32)">
<summary>
Rents an array that is at least the specified size from the pool.
</summary>
<param name="size">The minimum size of the array.</param>
<returns>An array of type <typeparamref name="T" /> that is at least the specified size.</returns>
</member>
<member name="M:Cryville.Common.Buffers.ArrayPool`1.Return(`0[])">
<summary>
Returns a rented array to the pool.
</summary>
<param name="arr">The array to return.</param>
</member>
<member name="T:Cryville.Common.Buffers.CategorizedPool`2">
<summary>
A set of resource pools categorized by a category type.
</summary>
<typeparam name="TCategory">The category type.</typeparam>
<typeparam name="TObject">The type of the objects in the pool.</typeparam>
</member>
<member name="P:Cryville.Common.Buffers.CategorizedPool`2.Buckets">
<summary>
The set of underlying pools.
</summary>
<remarks>
<para>The <see cref="M:Cryville.Common.Buffers.CategorizedPool`2.Rent(`0)" /> and <see cref="M:Cryville.Common.Buffers.CategorizedPool`2.Return(`0,`1)" /> method select an underlying pool directly from this set with the category as the key. When overridden, this set must be available since construction.</para>
</remarks>
</member>
<member name="P:Cryville.Common.Buffers.CategorizedPool`2.RentedCount">
<summary>
The count of objects rented from the set of pools.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPool`2.Rent(`0)">
<summary>
Rents an object from the pool.
</summary>
<param name="category">The category.</param>
<returns>The rented object.</returns>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPool`2.Return(`0,`1)">
<summary>
Returns a rented object to the pool.
</summary>
<param name="category">The category.</param>
<param name="obj">The object to return.</param>
</member>
<member name="T:Cryville.Common.Buffers.CategorizedPoolAccessor`2">
<summary>
A utility to access a categorized pool, representing a single unit that uses a shared categorized pool.
</summary>
<typeparam name="TCategory">The category type.</typeparam>
<typeparam name="TObject">The type of the objects in the pool.</typeparam>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPoolAccessor`2.#ctor(Cryville.Common.Buffers.CategorizedPool{`0,`1})">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.CategorizedPoolAccessor`2" /> class.
</summary>
<param name="pool">The categorized pool.</param>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPoolAccessor`2.Rent(`0)">
<summary>
Rents an object from the pool.
</summary>
<param name="category">The category.</param>
<returns>The rented object.</returns>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPoolAccessor`2.Return(`1)">
<summary>
Returns a rented object to the pool.
</summary>
<param name="obj">The object to return.</param>
</member>
<member name="M:Cryville.Common.Buffers.CategorizedPoolAccessor`2.ReturnAll">
<summary>
Returns all objects rented by this accessor to the pool.
</summary>
</member>
<member name="T:Cryville.Common.Buffers.ListPool`1">
<summary>
A resource pool that allows reusing instances of lists of type <typeparamref name="T" />.
</summary>
<typeparam name="T">The item type of the lists in the pool.</typeparam>
</member>
<member name="M:Cryville.Common.Buffers.ListPool`1.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.ListPool`1" /> class with the default maximum list size and bucket capacity.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.ListPool`1.#ctor(System.Int32,System.Int32)">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.ListPool`1" /> class.
</summary>
<param name="maxSize">The maximum size of the lists in the pool.</param>
<param name="capacityPerBucket">The capacity of each bucket. The pool groups lists of similar sizes into buckets for faster access.</param>
</member>
<member name="M:Cryville.Common.Buffers.ListPool`1.Rent(System.Int32)">
<summary>
Rents a list of the specified size from the pool. The size of the list must not be changed when it is rented.
</summary>
<param name="size">The size of the list.</param>
<returns>A <see cref="T:System.Collections.Generic.List`1" /> of the specified size.</returns>
</member>
<member name="M:Cryville.Common.Buffers.ListPool`1.Return(System.Collections.Generic.List{`0})">
<summary>
Returns a rented list to the pool.
</summary>
<param name="list">The list to return.</param>
</member>
<member name="T:Cryville.Common.Buffers.ObjectPool`1">
<summary>
A resource pool that allows reusing instances of type <typeparamref name="T" />.
</summary>
<typeparam name="T">The type of the objects in the pool.</typeparam>
</member>
<member name="M:Cryville.Common.Buffers.ObjectPool`1.#ctor(System.Int32)">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.ObjectPool`1" /> class.
</summary>
<param name="capacity">The capacity of the pool.</param>
</member>
<member name="P:Cryville.Common.Buffers.ObjectPool`1.RentedCount">
<summary>
The count of objects rented from the pool.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.ObjectPool`1.Rent">
<summary>
Rents a object from the pool.
</summary>
<returns>The rented object.</returns>
</member>
<member name="M:Cryville.Common.Buffers.ObjectPool`1.Return(`0)">
<summary>
Returns a rented object to the pool.
</summary>
<param name="obj">The object to return.</param>
</member>
<member name="M:Cryville.Common.Buffers.ObjectPool`1.Construct">
<summary>
Constructs a new instance of type <typeparamref name="T" />.
</summary>
<returns>The new instance.</returns>
</member>
<member name="M:Cryville.Common.Buffers.ObjectPool`1.Reset(`0)">
<summary>
Resets an object.
</summary>
<param name="obj">The object.</param>
</member>
<member name="T:Cryville.Common.Buffers.SimpleObjectPool`1">
<summary>
A resource pool that allows reusing instances of type <typeparamref name="T" />, which has a parameterless constructor.
</summary>
<typeparam name="T">The type of the objects in the pool.</typeparam>
</member>
<member name="M:Cryville.Common.Buffers.SimpleObjectPool`1.#ctor(System.Int32)">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.SimpleObjectPool`1" /> class.
</summary>
<param name="capacity">The capacity of the pool.</param>
</member>
<member name="M:Cryville.Common.Buffers.SimpleObjectPool`1.Construct">
<inheritdoc />
</member>
<member name="T:Cryville.Common.Buffers.TargetString">
<summary>
An auto-resized <see cref="T:System.Char" /> array as a variable-length string used as a target that is modified frequently.
</summary>
</member>
<member name="E:Cryville.Common.Buffers.TargetString.OnUpdate">
<summary>
Occurs when <see cref="M:Cryville.Common.Buffers.TargetString.Validate" /> is called if the string is invalidated.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.TargetString.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.TargetString" /> class with a capacity of 16.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.TargetString.#ctor(System.Int32)">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Buffers.TargetString" /> class.
</summary>
<param name="capacity">The initial capacity of the string.</param>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="capacity" /> is less than or equal to 0.</exception>
</member>
<member name="P:Cryville.Common.Buffers.TargetString.Item(System.Int32)">
<summary>
Gets or sets one of the characters in the string.
</summary>
<param name="index">The zero-based index of the character.</param>
<returns>The character at the given index.</returns>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index" /> is less than 0 or not less than <see cref="P:Cryville.Common.Buffers.TargetString.Length" />.</exception>
<remarks>
<para>Set <see cref="P:Cryville.Common.Buffers.TargetString.Length" /> to a desired value before updating the characters.</para>
<para>Call <see cref="M:Cryville.Common.Buffers.TargetString.Validate" /> after all the characters are updated.</para>
<para>Changing any character invalidates the string.</para>
</remarks>
</member>
<member name="P:Cryville.Common.Buffers.TargetString.Length">
<summary>
The length of the string.
</summary>
<exception cref="T:System.ArgumentOutOfRangeException">The value specified for a set operation is less than 0.</exception>
<remarks>
<para>Changing the length of the string invalidates the string.</para>
</remarks>
</member>
<member name="M:Cryville.Common.Buffers.TargetString.Validate">
<summary>
Validates the string.
</summary>
</member>
<member name="M:Cryville.Common.Buffers.TargetString.GetEnumerator">
<summary>
Returns an enumerator that iterates through the <see cref="T:Cryville.Common.Buffers.TargetString" />.
</summary>
<returns>A <see cref="T:Cryville.Common.Buffers.TargetString.Enumerator" /> for the <see cref="T:Cryville.Common.Buffers.TargetString" />.</returns>
</member>
<member name="T:Cryville.Common.Buffers.TargetString.Enumerator">
<inheritdoc />
</member>
<member name="P:Cryville.Common.Buffers.TargetString.Enumerator.Current">
<inheritdoc />
</member>
<member name="M:Cryville.Common.Buffers.TargetString.Enumerator.Dispose">
<inheritdoc />
</member>
<member name="M:Cryville.Common.Buffers.TargetString.Enumerator.MoveNext">
<inheritdoc />
</member>
<member name="M:Cryville.Common.Buffers.TargetString.Enumerator.Reset">
<inheritdoc />
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 99281b8f6cabd2c43a28a49de5441a8c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 49987e8d1061c94418bce1d5deeed761
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Common.Collections.PairCollection</name>
</assembly>
<members>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c553d68d14b3650448c6955705f2255d
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 7012af44c8041284fb5d52726b57773c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Common.Logging</name>
</assembly>
<members>
<member name="T:Cryville.Common.Logging.Logger">
<summary>
A logger.
</summary>
</member>
<member name="M:Cryville.Common.Logging.Logger.SetLogPath(System.String)">
<summary>
Sets the path where the log files shall be stored.
</summary>
<param name="path">The path.</param>
</member>
<member name="M:Cryville.Common.Logging.Logger.Log(System.String,System.Int32,System.String,System.String,System.Object[])">
<summary>
Logs to the specified logger.
</summary>
<param name="key">The key of the logger.</param>
<param name="level">The severity level.</param>
<param name="module">The module that is logging.</param>
<param name="format">The format string.</param>
<param name="args">The arguments for formatting.</param>
</member>
<member name="M:Cryville.Common.Logging.Logger.Create(System.String,Cryville.Common.Logging.Logger)">
<summary>
Adds a created logger to the shared logger manager.
</summary>
<param name="key">The key of the logger.</param>
<param name="logger">The logger.</param>
</member>
<member name="M:Cryville.Common.Logging.Logger.Close">
<summary>
Closes all loggers and related file streams.
</summary>
</member>
<member name="M:Cryville.Common.Logging.Logger.Log(System.Int32,System.String,System.String)">
<summary>
Logs to the logger.
</summary>
<param name="level">The severity level.</param>
<param name="module">The module that is logging.</param>
<param name="msg">The message.</param>
</member>
<member name="T:Cryville.Common.Logging.InstantLogger">
<summary>
A <see cref="T:Cryville.Common.Logging.Logger" /> that calls a callback function on log.
</summary>
</member>
<member name="M:Cryville.Common.Logging.InstantLogger.#ctor(System.Action{System.Int32,System.String,System.String})">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Logging.InstantLogger" /> class.
</summary>
<param name="callback">The callback function.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="callback" /> is <see langword="null" />.</exception>
</member>
<member name="M:Cryville.Common.Logging.InstantLogger.Log(System.Int32,System.String,System.String)">
<inheritdoc />
</member>
<member name="T:Cryville.Common.Logging.BufferedLogger">
<summary>
A <see cref="T:Cryville.Common.Logging.Logger" /> that buffers the logs for enumeration.
</summary>
</member>
<member name="M:Cryville.Common.Logging.BufferedLogger.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.Logging.BufferedLogger" /> class.
</summary>
</member>
<member name="M:Cryville.Common.Logging.BufferedLogger.Log(System.Int32,System.String,System.String)">
<inheritdoc />
</member>
<member name="M:Cryville.Common.Logging.BufferedLogger.Enumerate(System.Action{System.Int32,System.String,System.String})">
<summary>
Enumerates the buffered logs.
</summary>
<param name="callback">The callback function to receive the logs.</param>
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ce092ccbdda2afa499ccd5e379ad2521
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: b51b9c8b4886f7e4484ffdc790ccd7f6
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,75 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Common.Reflection</name>
</assembly>
<members>
<member name="T:Cryville.Common.Reflection.FieldLikeHelper">
<summary>
Provides a set of <see langword="static" /> methods for field and property.
</summary>
</member>
<member name="M:Cryville.Common.Reflection.FieldLikeHelper.FindMemberWithAttribute``1(System.Type)">
<summary>
Finds the member with the specified attribute type in the specified type.
</summary>
<typeparam name="T">The attribute type.</typeparam>
<param name="type">The type containing the member with the specified attribute type.</param>
<returns>The member with the specified attribute type in the specified type. <see langword="null" /> when the member is not found or multiple members are found.</returns>
</member>
<member name="M:Cryville.Common.Reflection.FieldLikeHelper.GetMember(System.Type,System.String)">
<summary>
Gets the member from a type with the specified name.
</summary>
<param name="type">The type.</param>
<param name="name">The name of the member.</param>
<returns>The member. <see langword="null" /> when the member is not found or multiple members are found.</returns>
</member>
<member name="M:Cryville.Common.Reflection.FieldLikeHelper.GetMemberType(System.Reflection.MemberInfo)">
<summary>
Gets the type of a member.
</summary>
<param name="mi">The member.</param>
<returns>The type of the member.</returns>
<exception cref="T:System.ArgumentException"><paramref name="mi" /> is not a field or a property.</exception>
</member>
<member name="M:Cryville.Common.Reflection.FieldLikeHelper.GetValue(System.Reflection.MemberInfo,System.Object)">
<summary>
Gets the value of a member of an object.
</summary>
<param name="mi">The member.</param>
<param name="obj">The object.</param>
<returns>The value.</returns>
<exception cref="T:System.ArgumentException"><paramref name="mi" /> is not a field or a property.</exception>
</member>
<member name="M:Cryville.Common.Reflection.FieldLikeHelper.SetValue(System.Reflection.MemberInfo,System.Object,System.Object,System.Reflection.Binder)">
<summary>
Sets the value of a member of an object.
</summary>
<param name="mi">The member.</param>
<param name="obj">The object.</param>
<param name="value">The value.</param>
<param name="binder">An optional binder to convert the value.</param>
<exception cref="T:System.ArgumentException"><paramref name="mi" /> is not a field or a property.</exception>
</member>
<member name="T:Cryville.Common.Reflection.TypeNameHelper">
<summary>
Provides a set of <see langword="static" /> methods for getting type name.
</summary>
</member>
<member name="M:Cryville.Common.Reflection.TypeNameHelper.GetSimpleName(System.Type)">
<summary>
Gets a simple name of a type.
</summary>
<param name="type">The type.</param>
<returns>A simple name of the class.</returns>
</member>
<member name="M:Cryville.Common.Reflection.TypeNameHelper.GetNamespaceQualifiedName(System.Type)">
<summary>
Gets the namespace qualified name of a type.
</summary>
<param name="type">The type.</param>
<returns>The namespace qualified name of the class.</returns>
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9691dcb3d841ff44ca8d611967ac5e73
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 0b115809ca063be4dbb8b057946c4b70
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>Cryville.Common.SurrogateHash</name>
</assembly>
<members>
<member name="T:Cryville.Common.Collections.Specialized.IntKeyedDictionary`1">
<summary>
Represents a collection of <see cref="T:System.Int32" /> keys and values. Identical to <see cref="!:Dictionary&lt;int, T&gt;" /> but much faster.
</summary>
<typeparam name="T">The type of the values in the dictionary.</typeparam>
</member>
<member name="T:Cryville.Common.IdentifierManager">
<summary>
A manager that assigns each given identifiers a unique integer ID.
</summary>
</member>
<member name="F:Cryville.Common.IdentifierManager.Shared">
<summary>
A shared instance of the <see cref="T:Cryville.Common.IdentifierManager" /> class.
</summary>
</member>
<member name="M:Cryville.Common.IdentifierManager.#ctor">
<summary>
Creates an instance of the <see cref="T:Cryville.Common.IdentifierManager" /> class.
</summary>
</member>
<member name="M:Cryville.Common.IdentifierManager.Request(System.Object)">
<summary>
Requests an integer ID for an identifier.
</summary>
<param name="ident">The identifier.</param>
<returns>The integer ID.</returns>
</member>
<member name="M:Cryville.Common.IdentifierManager.Retrieve(System.Int32)">
<summary>
Retrieves the identifier assigned with an integer ID.
</summary>
<param name="id">The integer ID.</param>
<returns>The identifier.</returns>
</member>
</members>
</doc>

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cbfca5369f624d841bda04da273ea9e3
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: