Informedica.Utils.Lib Namespace
| Type/Module | Description |
|
Holds the data directory of the application domain, or an empty string when the application domain has none. |
|
|
Resolves the application root directory once and returns the root path and the paths of the data, cache, zindex, logs and interactions directories. The root is the directory that holds the data directory, so the development server, a published binary, the Docker container and the test projects all use the same paths. The root is the first of: the directory named by the GENPRES_ROOT environment variable, when that directory exists; the directory of a .env file, searched upward from the current directory and then from the assembly location; the parent of a data/zindex directory, searched upward from the assembly location and then from the current directory; else the current directory, with a warning. The searches for the .env file and the data/zindex directory read the file system directly and do not need Env.loadDotEnv to have run, so test projects and F# scripts find the same root without setup. |
|
|
Picks, removes, prunes and formats the elements of an array and finds the median and the element nearest to a target. |
|
|
Creates a console table from a sequence of rows and writes the table to the console or to Markdown text. |
|
|
Writes plain, info, warning, error, debug and question messages to the console in colors. Each message is written under one lock, so messages from concurrent threads do not mix. A debug message is written only when the setting GENPRES_DEBUG is 1. |
|
|
Reads a typed value from a named column of a row of text and splits CSV text into rows. An unknown column raises a KeyNotFoundException. |
|
|
Walks up the directory tree from a start directory and returns the first directory that meets a condition or holds a given file, or None when no directory does. The module has the same name as the System.IO.Directory class and hides the class in a file that opens both, so the module calls the class by the full name System.IO.Directory. |
|
|
Reads the environment variables of the process, loads unset variables from a .env file and returns a text with system information. |
|
|
Lists the files of a directory, reads the lines of a file, writes or appends text to a file and tests whether a file exists. |
|
|
Serializes a value to JSON text and back with Newtonsoft.Json, writing a BigRational as a numerator and a denominator. |
|
|
Finds, replaces, removes and counts the elements of a list and builds the rotations and combinations of lists. |
|
|
Wraps a function in a thread-safe cache, so a repeated call with an equal argument returns the stored result. |
|
|
Applies a function to one, two or three values and returns a default value when any of the values is null. |
|
|
Chooses between two option values with a comparison, giving the minimum or the maximum. When only one option holds a value, the result is this option. |
|
|
Replaces the slashes and backslashes of a path with the directory separator of the platform, combines two paths, and returns the full path of a given path. |
|
|
Converts a union case without fields to its name and a name back to the union case. An unknown name gives None. |
|
|
Returns the value of an Ok result. Raises an InvalidOperationException for an Error result. |
|
|
Creates a mutable buffer of fixed capacity, adds items by overwriting the oldest item when full, and reads the items from oldest to newest. |
|
|
Fixed-size, overwriting ring buffer (oldest -> newest order on iteration) |
|
|
Picks, filters, prunes and formats the elements of a sequence and tests whether all elements are equal or unique. |
|
|
Removes from a set of BigRational values every value which is a multiple of another value in the set, and formats a set as text. |
|
|
Runs a function, writes the elapsed time in milliseconds with a message to the console and returns the result of the function. |
|
|
Wraps the append, format, replace and toString methods of a StringBuilder as functions to use in a pipeline. |
|
|
Holds the GoogleSheets module, which downloads a Google spreadsheet and reads its sheets. |
|
|
Reads the sheets of an xlsx workbook as rows of text. |
GenPRES