Skip to content

Commit

Permalink
Change version and fix XML comments (#20)
Browse files Browse the repository at this point in the history
* Change version to 1.1.0

* Fix XML comments

* Update IPool.cs

* Include Nuget references in builds

* Update packages
  • Loading branch information
MichalPetryka authored Aug 5, 2020
1 parent 94be2ab commit 2c202f1
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
2 changes: 1 addition & 1 deletion NorthwoodLib.Tests/NorthwoodLib.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
12 changes: 12 additions & 0 deletions NorthwoodLib/Logging/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,21 @@ namespace NorthwoodLib.Logging
/// </summary>
public enum LogType
{
/// <summary>
/// Debugging logs
/// </summary>
Debug,
/// <summary>
/// Informational logs
/// </summary>
Info,
/// <summary>
/// Warning logs
/// </summary>
Warning,
/// <summary>
/// Error logs
/// </summary>
Error
}
}
3 changes: 3 additions & 0 deletions NorthwoodLib/NativeMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public void Dispose()
GC.SuppressFinalize(this);
}

/// <summary>
/// Frees allocated memory
/// </summary>
~NativeMemory()
{
Free();
Expand Down
20 changes: 20 additions & 0 deletions NorthwoodLib/NorthwoodLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<LangVersion>7.3</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>NorthwoodLib</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<AssemblyName>NorthwoodLib</AssemblyName>
<Product>NorthwoodLib</Product>
Expand All @@ -28,6 +29,25 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.7.1" />
</ItemGroup>

<Target Name="CopyReferenceFilesBuild" BeforeTargets="Build">
<ItemGroup>
<ReferenceFiles Include="%(Reference.RelativeDir)%(Reference.Filename).xml;%(Reference.RelativeDir)%(Reference.Filename).pdb" />
</ItemGroup>
<Message Text="Copying reference files to $(OutputPath)" Importance="High" />
<Copy SourceFiles="@(ReferenceFiles)" DestinationFolder="$(OutputPath)" Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
</Target>

<Target Name="CopyReferenceFilesPublish" BeforeTargets="Publish">
<ItemGroup>
<ReferenceFiles Include="%(Reference.RelativeDir)%(Reference.Filename).xml;%(Reference.RelativeDir)%(Reference.Filename).pdb" />
</ItemGroup>
<Message Text="Copying reference files to $(PublishDir)" Importance="High" />
<Copy SourceFiles="@(ReferenceFiles)" DestinationFolder="$(PublishDir)" Condition="Exists('%(RootDir)%(Directory)%(Filename)%(Extension)')" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion NorthwoodLib/PlatformSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class PlatformSettings
/// <summary>
/// Current library version
/// </summary>
internal const string VersionConst = "1.0.0";
internal const string VersionConst = "1.1.0";

/// <summary>
/// Returns the library version
Expand Down
6 changes: 3 additions & 3 deletions NorthwoodLib/Pools/IPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ namespace NorthwoodLib.Pools
public interface IPool<T> where T : class
{
/// <summary>
/// Returns a pooled instance of <see cref="T"/>
/// Returns a pooled instance of <typeparamref name="T"/>
/// </summary>
/// <returns><see cref="T"/> from the pool</returns>
/// <returns><typeparamref name="T"/> from the pool</returns>
T Rent();
/// <summary>
/// Returns a <see cref="T"/> to the pool
/// Returns a <typeparamref name="T"/> to the pool
/// </summary>
/// <param name="obj">Pooled object</param>
void Return(T obj);
Expand Down
12 changes: 6 additions & 6 deletions NorthwoodLib/StringUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ public static class StringUtils
private static readonly Regex TagRegex = new Regex("<.*?>", RegexOptions.Compiled);

/// <summary>
/// Truncates a string to the last occurance of <see cref="character"/> within <see cref="maxSize"/> characters if it's longer than it
/// Truncates a string to the last occurance of <see paramref="character"/> within <see paramref="maxSize"/> characters if it's longer than it
/// </summary>
/// <param name="text">Processed text</param>
/// <param name="maxSize">Maximum size</param>
/// <param name="character">Checked character</param>
/// <returns>Truncated <see cref="text"/></returns>
/// <returns>Truncated <see paramref="text"/></returns>
public static string TruncateToLast(this string text, int maxSize, char character)
{
int index = text.LastIndexOf(character, maxSize - 1, maxSize);
return text.Length <= maxSize ? text : text.Substring(0, index == -1 ? maxSize : index + 1);
}

/// <summary>
/// Truncates a string to the last occurance of <see cref="str"/> within <see cref="maxSize"/> characters if it's longer than it
/// Truncates a string to the last occurance of <see paramref="str"/> within <see paramref="maxSize"/> characters if it's longer than it
/// </summary>
/// <param name="text">Processed text</param>
/// <param name="maxSize">Maximum size</param>
/// <param name="str">Checked string</param>
/// <param name="comparison">String comparison</param>
/// <returns>Truncated <see cref="text"/></returns>
/// <returns>Truncated <see paramref="text"/></returns>
public static string TruncateToLast(this string text, int maxSize, string str, StringComparison comparison = StringComparison.Ordinal)
{
int index = text.LastIndexOf(str, maxSize - 1, maxSize, comparison);
Expand All @@ -45,7 +45,7 @@ public static string TruncateToLast(this string text, int maxSize, string str, S
/// Converts a text to Base64 encoded UTF8
/// </summary>
/// <param name="plainText">Processed text</param>
/// <returns>Base64 encoded UTF8 of <see cref="plainText"/></returns>
/// <returns>Base64 encoded UTF8 of <see paramref="plainText"/></returns>
public static string Base64Encode(string plainText)
{
byte[] buffer = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(plainText.Length));
Expand Down Expand Up @@ -83,7 +83,7 @@ public static bool Contains(this string s, char value)
/// <param name="s">Checked string</param>
/// <param name="value">The string to seek.</param>
/// <param name="comparison">One of the enumeration values that specifies the rules to use in the comparison.</param>
/// <returns><see langword="true"/> if the <see cref="value"/> occurs within this string, or if <see cref="value"/> is the empty string (""); otherwise, <see langword="false"/>.</returns>
/// <returns><see langword="true"/> if the <see paramref="value"/> occurs within this string, or if <see paramref="value"/> is the empty string (""); otherwise, <see langword="false"/>.</returns>
public static bool Contains(this string s, string value, StringComparison comparison)
{
return s.IndexOf(value, comparison) >= 0;
Expand Down

0 comments on commit 2c202f1

Please sign in to comment.