Skip to content

Commit 723809a

Browse files
committed
IsNullOrEmpty
1 parent ec5cc57 commit 723809a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

NStack/NStack.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="..\packages\NuGet.Build.Packaging.0.1.248\build\NuGet.Build.Packaging.props" Condition="Exists('..\packages\NuGet.Build.Packaging.0.1.248\build\NuGet.Build.Packaging.props')" />
44

55
<PropertyGroup>
6-
<TargetFramework>netstandard1.5</TargetFramework>
6+
<TargetFramework>netstandard1.6</TargetFramework>
77
<PackageId>NStack.Core</PackageId>
88
<PackageVersion>0.8</PackageVersion>
99
<Authors>Miguel de Icaza</Authors>
@@ -26,15 +26,20 @@ It starts with a new string type that is focused on Unicode code-points as oppos
2626
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2727
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2828
<DocumentationFile>bin\Debug\netstandard1.6\NStack.xml</DocumentationFile>
29+
<LangVersion>Latest</LangVersion>
2930
</PropertyGroup>
3031
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3132
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
33+
<LangVersion>Latest</LangVersion>
3234
</PropertyGroup>
3335
<ItemGroup>
3436
<Reference Include="System.ValueTuple">
3537
<HintPath>..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
3638
<Private>False</Private>
3739
</Reference>
3840
</ItemGroup>
41+
<ItemGroup>
42+
<PackageReference Include="System.Memory" Version="4.5.0-preview1-26216-02" />
43+
</ItemGroup>
3944
<Import Project="..\packages\NuGet.Build.Packaging.0.1.248\build\NuGet.Build.Packaging.targets" Condition="Exists('..\packages\NuGet.Build.Packaging.0.1.248\build\NuGet.Build.Packaging.targets')" />
4045
</Project>

NStack/strings/ustring.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,14 @@ public ustring Replace (ustring oldValue, ustring newValue, int maxReplacements
20942094
return new ByteBufferUString (result);
20952095
}
20962096

2097+
public static bool IsNullOrEmpty (ustring value)
2098+
{
2099+
if (value == null)
2100+
return true;
2101+
if (value.Length == 0)
2102+
return true;
2103+
return false;
2104+
}
20972105

20982106
TypeCode IConvertible.GetTypeCode ()
20992107
{

NStack/unicode/Rune.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Runtime.InteropServices;
23

34
namespace System {
45
/// <summary>
@@ -7,6 +8,7 @@ namespace System {
78
/// <remarks>
89
///
910
/// </remarks>
11+
[StructLayout(LayoutKind.Sequential)]
1012
public partial struct Rune {
1113
// Stores the rune
1214
uint value;

0 commit comments

Comments
 (0)