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="NUnit.Analyzers" Version="3.3.0" />
|
||||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Sharp.Augeas\Sharp.Augeas.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ContentWithTargetPath Include="root\**">
|
<ContentWithTargetPath Include="root\**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
@ -32,4 +28,7 @@
|
||||||
<TargetPath>lens\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
|
<TargetPath>lens\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
|
||||||
</ContentWithTargetPath>
|
</ContentWithTargetPath>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Sharp.Augeas\Sharp.Augeas.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</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;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Sharp.Augeas.Test
|
namespace Sharp.Augeas
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public unsafe partial struct AugSettings {
|
public unsafe partial struct AugSettings {
|
||||||
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)] internal string root;
|
[MarshalAs(UnmanagedType.LPStr)] public string root;
|
||||||
[MarshalAs(UnmanagedType.LPStr)] internal string loadPath;
|
[MarshalAs(UnmanagedType.LPStr)] public string loadPath;
|
||||||
|
|
||||||
public AugSettings(string _root, string _loadPath )
|
public AugSettings(string _root, string _loadPath )
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ namespace Sharp.Augeas.Test
|
||||||
root = "NIL";
|
root = "NIL";
|
||||||
loadPath = "NIL";
|
loadPath = "NIL";
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Sharp.Augeas.Test;
|
|
||||||
using static Sharp.Augeas.AugeasExtern;
|
using static Sharp.Augeas.AugeasExtern;
|
||||||
|
|
||||||
namespace Sharp.Augeas
|
namespace Sharp.Augeas
|
||||||
|
|
|
@ -2,13 +2,20 @@ using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Sharp.Augeas.Test;
|
|
||||||
|
|
||||||
namespace Sharp.Augeas
|
namespace Sharp.Augeas
|
||||||
{
|
{
|
||||||
[SuppressUnmanagedCodeSecurity]
|
[SuppressUnmanagedCodeSecurity]
|
||||||
public static unsafe class AugeasExtern
|
public static unsafe class AugeasExtern
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used by DllImport to load the native library
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
private const string _libName = "clAugeas";
|
||||||
|
|
||||||
|
|
||||||
[DllImport(_libName)]
|
[DllImport(_libName)]
|
||||||
public static extern IntPtr init_aug(AugSettings settings, int flags);
|
public static extern IntPtr init_aug(AugSettings settings, int flags);
|
||||||
|
|
||||||
|
@ -18,10 +25,6 @@ namespace Sharp.Augeas
|
||||||
[DllImport(_libName)]
|
[DllImport(_libName)]
|
||||||
public static extern void free_str(IntPtr str);
|
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>
|
/// <summary>Test calling</summary>
|
||||||
[DllImport(_libName)]
|
[DllImport(_libName)]
|
||||||
|
|
|
@ -5,19 +5,29 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>disable</Nullable>
|
<Nullable>disable</Nullable>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<RootNamespace>Sharp.Augeas</RootNamespace>
|
<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>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ContentWithTargetPath Include="root\**">
|
<PackageReference Update="Nerdbank.GitVersioning">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<Version>3.5.109</Version>
|
||||||
<TargetPath>root\%(RecursiveDir)\%(Filename)%(Extension)</TargetPath>
|
</PackageReference>
|
||||||
</ContentWithTargetPath>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="./Platform/Linux/libclAugeas.so">
|
<None Include="libclAugeas.so">
|
||||||
|
<Pack>true</Pack>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="libclAugeas.dylib">
|
||||||
|
<Pack>true</Pack>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -3,7 +3,7 @@ namespace Sharp.Augeas;
|
||||||
public class Argument : Node
|
public class Argument : Node
|
||||||
{
|
{
|
||||||
|
|
||||||
public string Value;
|
public string Value { get; set; }
|
||||||
|
|
||||||
public bool SetValue(string newValue)
|
public bool SetValue(string newValue)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,14 +4,14 @@ namespace Sharp.Augeas;
|
||||||
|
|
||||||
public class Directive : Node
|
public class Directive : Node
|
||||||
{
|
{
|
||||||
public string Value;
|
public string Value { get; set; }
|
||||||
public List<Argument> Arguments;
|
public List<Argument> Arguments { get; set; }
|
||||||
public bool HasArguments => Arguments.Count != 0;
|
public bool HasArguments => Arguments.Count != 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a new value for the directive using string literals
|
/// Sets a new value for the directive.
|
||||||
/// The values are separated by spaces, the first value is the directive value,
|
/// The first word is the directive value,
|
||||||
/// the other values are values corresponding to the arguments.
|
/// the following words correspond to the arguments.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newValue"></param>
|
/// <param name="newValue"></param>
|
||||||
public void Set(string newValue)
|
public void Set(string newValue)
|
||||||
|
@ -31,8 +31,7 @@ public class Directive : Node
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the value of this directive.
|
/// Set the value of this directivew without writing changes to the disk.
|
||||||
/// Note: This doesn't write any changes to disk.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="newValue">New value.</param>
|
/// <param name="newValue">New value.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
|
@ -4,9 +4,9 @@ namespace Sharp.Augeas
|
||||||
{
|
{
|
||||||
public class SuperNode : Node
|
public class SuperNode : Node
|
||||||
{
|
{
|
||||||
public List<Directive> Directives;
|
public List<Directive> Directives { get; set; }
|
||||||
public List<Argument> Arguments;
|
public List<Argument> Arguments { get; set; }
|
||||||
public List<SuperNode> SuperNodes;
|
public List<SuperNode> SuperNodes { get; set; }
|
||||||
|
|
||||||
public SuperNode(Augeas augeas, string path, string id) : base(augeas, path)
|
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",
|
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
|
||||||
"version": "0.9",
|
"version": "1.3",
|
||||||
"semVer1NumericIdentifierPadding": 1,
|
"semVer1NumericIdentifierPadding": 1,
|
||||||
"publicReleaseRefSpec": [
|
"publicReleaseRefSpec": [
|
||||||
"^refs/heads/master$",
|
"^refs/heads/master$",
|
||||||
|
|
Loading…
Reference in New Issue