FindNeedleCoreUtils 1.0.0.3

dotnet add package FindNeedleCoreUtils --version 1.0.0.3
                    
NuGet\Install-Package FindNeedleCoreUtils -Version 1.0.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FindNeedleCoreUtils" Version="1.0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FindNeedleCoreUtils" Version="1.0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="FindNeedleCoreUtils" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FindNeedleCoreUtils --version 1.0.0.3
                    
#r "nuget: FindNeedleCoreUtils, 1.0.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FindNeedleCoreUtils@1.0.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FindNeedleCoreUtils&version=1.0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=FindNeedleCoreUtils&version=1.0.0.3
                    
Install as a Cake Tool

FindNeedleCoreUtils

This library provides core utility classes for file I/O, temporary storage management, text manipulation, and unit conversions. Below is a description of every class and enum in this library:

Classes and Enums

1. FileIO

Provides static methods for file and directory operations.

  • GetAppDataFindNeedlePluginFolder(): Returns the path to the AppData folder for FindNeedlePlugin, creating it if necessary.
  • FindFullPathToFile(string fileName, bool throwError=false): Attempts to resolve the full path to a file by searching several common locations.
  • GetAllFilesErrorCallback: Delegate for error handling during file enumeration.
  • GetAllFiles(string path, GetAllFilesErrorCallback? errorHandler = null): Recursively enumerates all files in a directory tree, optionally handling errors with a callback.

2. TempStorage

Manages temporary storage directories for the application.

  • GetSingleton(): Returns a singleton instance of TempStorage.
  • GetMainTempPath(): Gets the main temp path from the singleton instance.
  • DeleteSomeTempPath(string randomDir): Deletes a temp directory and waits until it is removed.
  • GetNewTempPath(string hint): Generates a new temp path with a hint for identification.
  • GenerateRandomFolderName(string hint): Generates a random folder name using a hint and timestamp.
  • GenerateNewPath(string root, string hint = "FindNeedleTemp"): Generates a new unique temp path under the specified root.
  • GetExistingMainTempPath(): Returns the current main temp path.
  • Dispose(): Cleans up the temp path by deleting it.

3. TextManipulation

Provides static methods for parsing and manipulating text, especially for command-line arguments.

  • ParseCommandLineIntoDictionary(string[] args): Parses command-line arguments into a list of key-value pairs.
  • SplitApart(string text): Splits a comma-separated string into a list, removing invalid characters.
  • ReplaceInvalidChars(string text): Removes certain invalid characters and trims whitespace from a string.
CommandLineArgument

A simple class representing a key-value pair for command-line arguments.

  • key: The argument key.
  • value: The argument value.

4. ByteUtils

Provides static methods for working with byte sizes.

  • BytesToFriendlyString(long value, int decimalPlaces = 1): Converts a byte value to a human-readable string (e.g., "1.5 MB").

5. TimeAgoUnit (enum)

Enumerates time units for "time ago" calculations.

  • Second, Minute, Hour, Day: Units of time.

This library is intended to be used as a foundational utility layer for the FindNeedle ecosystem, providing robust and reusable helpers for common tasks.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0-windows10.0.19041

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FindNeedleCoreUtils:

Package Downloads
FindNeedlePluginLib

A library for plugin implementers to code against

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0.3 164 7/4/2025
1.0.0.2 179 6/30/2025
1.0.0.1 176 6/27/2025