Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
Wvader | 607a30e728 | |
code liturgy | eae24d1b14 | |
code liturgy | 29619765a8 | |
code liturgy | f5c1368b8f | |
code liturgy | dfba89a82f | |
code liturgy | 766d451b52 | |
code liturgy | 3759eec7cb | |
code liturgy | 2abeb3b379 | |
code liturgy | 6949875891 | |
code liturgy | 0e4d02652f | |
code liturgy | 07ac032b99 |
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nerdbank.GitVersioning">
|
||||
<Version>3.4.22</Version>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
Binary file not shown.
|
@ -16,10 +16,6 @@
|
|||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Sharp.Augeas\Sharp.Augeas.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="root\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
@ -32,4 +28,7 @@
|
|||
<TargetPath>lens\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Sharp.Augeas\Sharp.Augeas.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Example</id>
|
||||
<version>1.0.0</version>
|
||||
<authors>Example</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>Example</description>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="libclAugeas.so" target="Platform\libclAugeas.so" />
|
||||
</files>
|
||||
</package>
|
|
@ -1,12 +1,12 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Sharp.Augeas.Test
|
||||
namespace Sharp.Augeas
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe partial struct AugSettings {
|
||||
|
||||
[MarshalAs(UnmanagedType.LPStr)] internal string root;
|
||||
[MarshalAs(UnmanagedType.LPStr)] internal string loadPath;
|
||||
[MarshalAs(UnmanagedType.LPStr)] public string root;
|
||||
[MarshalAs(UnmanagedType.LPStr)] public string loadPath;
|
||||
|
||||
public AugSettings(string _root, string _loadPath )
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace Sharp.Augeas.Test
|
|||
root = "NIL";
|
||||
loadPath = "NIL";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Sharp.Augeas.Test;
|
||||
using static Sharp.Augeas.AugeasExtern;
|
||||
|
||||
namespace Sharp.Augeas
|
||||
|
|
|
@ -2,13 +2,20 @@ using System.Numerics;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using Sharp.Augeas.Test;
|
||||
|
||||
namespace Sharp.Augeas
|
||||
{
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public static unsafe class AugeasExtern
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Used by DllImport to load the native library
|
||||
/// </summary>
|
||||
///
|
||||
private const string _libName = "clAugeas";
|
||||
|
||||
|
||||
[DllImport(_libName)]
|
||||
public static extern IntPtr init_aug(AugSettings settings, int flags);
|
||||
|
||||
|
@ -18,10 +25,6 @@ namespace Sharp.Augeas
|
|||
[DllImport(_libName)]
|
||||
public static extern void free_str(IntPtr str);
|
||||
|
||||
/// <summary>
|
||||
/// Used by DllImport to load the native library
|
||||
/// </summary>
|
||||
private const string _libName = "clAugeas";
|
||||
|
||||
/// <summary>Test calling</summary>
|
||||
[DllImport(_libName)]
|
||||
|
|
|
@ -5,19 +5,29 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<RootNamespace>Sharp.Augeas</RootNamespace>
|
||||
<PackageProjectUrl>https://git.codeliturgy.com/P0/Sharp.Augeas</PackageProjectUrl>
|
||||
<PackageVersion>$(Version)</PackageVersion>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<RepositoryUrl>https://git.codeliturgy.com/P0/Sharp.Augeas</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ContentWithTargetPath Include="root\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<TargetPath>root\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
|
||||
</ContentWithTargetPath>
|
||||
<PackageReference Update="Nerdbank.GitVersioning">
|
||||
<Version>3.5.109</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="./Platform/Linux/libclAugeas.so">
|
||||
<None Include="libclAugeas.so">
|
||||
<Pack>true</Pack>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="libclAugeas.dylib">
|
||||
<Pack>true</Pack>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Sharp.Augeas;
|
|||
public class Argument : Node
|
||||
{
|
||||
|
||||
public string Value;
|
||||
public string Value { get; set; }
|
||||
|
||||
public bool SetValue(string newValue)
|
||||
{
|
||||
|
|
|
@ -4,14 +4,14 @@ namespace Sharp.Augeas;
|
|||
|
||||
public class Directive : Node
|
||||
{
|
||||
public string Value;
|
||||
public List<Argument> Arguments;
|
||||
public string Value { get; set; }
|
||||
public List<Argument> Arguments { get; set; }
|
||||
public bool HasArguments => Arguments.Count != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Sets a new value for the directive using string literals
|
||||
/// The values are separated by spaces, the first value is the directive value,
|
||||
/// the other values are values corresponding to the arguments.
|
||||
/// Sets a new value for the directive.
|
||||
/// The first word is the directive value,
|
||||
/// the following words correspond to the arguments.
|
||||
/// </summary>
|
||||
/// <param name="newValue"></param>
|
||||
public void Set(string newValue)
|
||||
|
@ -31,8 +31,7 @@ public class Directive : Node
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the value of this directive.
|
||||
/// Note: This doesn't write any changes to disk.
|
||||
/// Set the value of this directivew without writing changes to the disk.
|
||||
/// </summary>
|
||||
/// <param name="newValue">New value.</param>
|
||||
/// <returns></returns>
|
||||
|
|
|
@ -4,9 +4,9 @@ namespace Sharp.Augeas
|
|||
{
|
||||
public class SuperNode : Node
|
||||
{
|
||||
public List<Directive> Directives;
|
||||
public List<Argument> Arguments;
|
||||
public List<SuperNode> SuperNodes;
|
||||
public List<Directive> Directives { get; set; }
|
||||
public List<Argument> Arguments { get; set; }
|
||||
public List<SuperNode> SuperNodes { get; set; }
|
||||
|
||||
public SuperNode(Augeas augeas, string path, string id) : base(augeas, path)
|
||||
{
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
|
||||
"version": "0.9",
|
||||
"version": "1.3",
|
||||
"semVer1NumericIdentifierPadding": 1,
|
||||
"publicReleaseRefSpec": [
|
||||
"^refs/heads/master$",
|
||||
|
|
Loading…
Reference in New Issue