Skip to content

Commit

Permalink
Merge pull request #2 from usdAG/develop
Browse files Browse the repository at this point in the history
Prepare v1.0.0 Release
  • Loading branch information
qtc-de authored Jan 26, 2022
2 parents f7f0a2c + c66eccb commit 5374af9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## v1.0.0 - Jan 26, 2022

### Added

* Add support for [RegistryLinks](/docs#registrylink)
* Add support for [LinkGroups](/docs#linkgroup)
* Add [static functions](/docs#junction) for manual creation of *Junctions* and *DosDevices*

### Changed

* Global refactoring. To many changes to list here :)


## v0.0.0 - Sep 07, 2021

* Initial release
17 changes: 17 additions & 0 deletions SharpLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
namespace de.usd.SharpLink
{
/**
* SharpLink v1.0.0
*
* This namespace contains classes that allow low privileged user accounts to create
* file system and registry symbolic links.
*
Expand Down Expand Up @@ -130,12 +132,27 @@ public UNICODE_STRING(string str)
}
}

/**
* The ILink interface contains the required methods that classes need to implement to be assignable
* to a LinkGroup. Currently, this interface is implemented by the Symlink and RegistryLink types.
*
* Author: Tobias Neitzel (@qtc_de)
*/
public interface ILink
{
// open the underlying link
void Open();

// close the underlying link
void Close();

// print the current link status to stdout
void Status();

// enforce closing the link
void ForceClose();

// tell the link whether it should stay alive after the object is cleaned up
void KeepAlive(bool value);
}

Expand Down
26 changes: 13 additions & 13 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ create a new key within the target. Since this key is owned by the invoking user
usually possible. To make such operations easier, the `RegistryLink` class exports some static functions:

```csharp
public static bool CreateLink(string key, string target) // create the specified registry link manually
public static void DeleteLink(string key, string target) // delete the specified registry link manually
public static void CreateKey(string key) // create the specified registry key
public static void DeleteKey(string key) // delete the specified registry key
public static string GetLinkTarget(string key) // return the target name of a registry link
public static bool CreateLink(string key, string target); // create the specified registry link manually
public static void DeleteLink(string key, string target); // delete the specified registry link manually
public static void CreateKey(string key); // create the specified registry key
public static void DeleteKey(string key); // delete the specified registry key
public static string GetLinkTarget(string key); // return the target name of a registry link
```

Status information on the current link status can be obtained from the `Status()` method:
Expand Down Expand Up @@ -252,10 +252,10 @@ Despite it is not recommended to use static functions from the `Junction` class
be consumed from *Powershell*. The following functions are available:

```csharp
public static Junction Create(string baseDir, string targetDir, bool keepAlive) // Create a new Junction
public static void Close(string baseDir, string targetDir) // Close an existing Junction
public static void Close(string baseDir) // Close an existing Junction
public static string GetTarget(string baseDir) // Get the target path of an existing Junction
public static Junction Create(string baseDir, string targetDir, bool keepAlive); // Create a new Junction
public static void Close(string baseDir, string targetDir); // Close an existing Junction
public static void Close(string baseDir); // Close an existing Junction
public static string GetTarget(string baseDir); // Get the target path of an existing Junction
```

`Junction` objects are treated as resources and perform a cleanup operation when they go out of scope.
Expand All @@ -273,10 +273,10 @@ Despite it is not recommended to use static functions from the `DosDevice` class
be consumed from *Powershell*. The following functions are available:

```csharp
public static DosDevice Create(string name, string target, bool keepAlive) // Create a new DosDevice
public static void Close(string name, string target) // Close an existing DosDevice
public static void Close(string name) // Close an existing DosDevice
public static string GetTarget(string name) // Get the target path of an existing DosDevice
public static DosDevice Create(string name, string target, bool keepAlive); // Create a new DosDevice
public static void Close(string name, string target); // Close an existing DosDevice
public static void Close(string name); // Close an existing DosDevice
public static string GetTarget(string name); // Get the target path of an existing DosDevice
```

`DosDevice` objects are treated as resources and perform a cleanup operation when they go out of scope.
Expand Down

0 comments on commit 5374af9

Please sign in to comment.