Divooka.Platform
Divooka.Platform.FileUtilities.SearchInFiles()
Search keywords in a list of files
Returns
Result file and line number containing keywords and a snippet of the line.
Divooka.Platform.InMemoryConstruct
A demo InMemoryDB/python Pandas like construct - through a sequence of graph node connections, we can add and process data.
This is an instance class, with some static members for starting the processing
Divooka.Platform.SampleDataSet
Single-name single-column numerical history data
Divooka.Platform.Primitives
Primitives from texts
Divooka.Platform.Operators
Functional operators on basic types;
In general, front-ends and back-ends should provide more direct in-place and native evaluations for optimization purpose instead of relying on such functional operators
Divooka.Platform.Network.NetworkHelper
Remarks
Consider consolidating with Divooka.Infrastructure.DevelopmentServer
Divooka.Platform.Network.NetworkHelper.DownloadFile()
Download file from network location to a given local path
Divooka.Platform.Programming.ControlFlow.FunctionalBranch()
Provides a basic terminated conditional action.
Divooka.Platform.Programming.InputHelpers
Offers additional program/graph input-related functions
Divooka.Platform.Programming.InputHelpers.ValidateNumberExclusive()
Validates input number falls in expected range; Throw an exception otherwise.
Remarks
This function offers a functional way to do input validation; Useful when graph/program needs to halt when dealing with invalid inputs and thus stop downstream processing.
Useful when running graphs in command line.
Divooka.Platform.Programming.InputHelpers.ValidateNumberInclusive()
Validates input number falls in expected range; Throw an exception otherwise.
Remarks
This function offers a functional way to do input validation; Useful when graph/program needs to halt when dealing with invalid inputs and thus stop downstream processing.
Useful when running graphs in command line.
Divooka.Platform.Console.PrintMulticast
Provides a binding point for GUI implementations to listen to the "console" print event
Divooka.Platform.Console.Print()
Print any object in string representation; Automatically handles well-known types (e.g. arrays).
Divooka.Platform.Console.PrintLine()
Remarks
TODO: (Remark) We prefer "Print Line" for semantical reasons i.e. makes more sense in GUI. But we should keep the original interface - ideally just use System.Console and rely on XML file for renaming.
Divooka.Platform.Environment
Provide routines to interface with system environment.
Remarks
TODO: Integrate with Parcel NEXT and virtual environment
Divooka.Platform.Environment.GetEnvironmentVariable()
Get string value of named environment variable. Returns empty string if not available.
Parameters
| Name | Description | Default |
|---|---|---|
name |
Name of variable. |
Returns
Value or variable or empty string if not present.
Divooka.Platform.FileSystem
Contains standardized definitions for File, Directory, Path and FileSystemEntry operations.
This is a very thin layer (almost duplicate) built on top of standard .Net as part of PSL for interoperability purposes.
TODO: Need to expose functions on FileStream, StreamWriter and FileAttributes in order to make the API complete.
TODO: Pending trimming and pick which ones to keep and which functions to improve/merge.
TODO: Fix naming.
TODO: Consider whether it's necessary to put under specific File/Directory namespace/type like .Net did.
Remarks
Notice for this we do not wish to expose underying types directly - a layer of indirection is useful for our virtualization needs.
Divooka.Platform.FileSystem.AppendAllLines()
Appends lines to a file, optionally using a specified Encoding encoding, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file.
Default encoding is UTF8.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file path to which lines will be appended. | |
contents |
The lines to append to the file. | |
encoding |
The encoding to use, or null for UTF8. |
Divooka.Platform.FileSystem.AppendAllText()
Appends the specified string to the file, optionally using the specified Encoding encoding, creating the file if it does not already exist.
Default encoding is UTF8.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file path to which text will be appended. | |
contents |
The text to append to the file. | |
encoding |
The encoding to use, or null for UTF8. |
Divooka.Platform.FileSystem.Copy()
Copies an existing file to a new file. Optionally overwriting existing file.
Parameters
| Name | Description | Default |
|---|---|---|
sourceFileName |
The file to copy. | |
destFileName |
The name of the destination file. | |
overwrite |
True to allow overwriting an existing file; otherwise false. |
Divooka.Platform.FileSystem.Touch()
Creates, or truncates and overwrites, a file in the specified path, with an optional size (for non-text files).
File will be empty if it's a text file or if fileSize is 0.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file path to create or truncate. | |
fileSize |
Optional size in bytes if creating a binary file. |
Divooka.Platform.FileSystem.DeleteFile()
Deletes the specified file.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to delete. |
Divooka.Platform.FileSystem.FileExists()
Determines whether the specified file exists.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to check for existence. |
Divooka.Platform.FileSystem.GetCreationTime()
Returns the creation date and time of the specified file or directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory for which to obtain creation date and time. |
Returns
A DateTime set to the creation date and time.
Divooka.Platform.FileSystem.GetCreationTimeUtc()
Returns the creation date and time, in Coordinated Universal Time (UTC), of the specified file or directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory for which to obtain creation date and time in UTC. |
Returns
A DateTime set to the creation date and time in UTC.
Divooka.Platform.FileSystem.GetLastAccessTime()
Returns the date and time the specified file or directory was last accessed.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory to check. |
Returns
A DateTime set to the time of last access.
Divooka.Platform.FileSystem.GetLastAccessTimeUtc()
Returns the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last accessed.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory to check. |
Returns
A DateTime set to the time of last access in UTC.
Divooka.Platform.FileSystem.GetLastWriteTime()
Returns the date and time the specified file or directory was last written to.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory to check. |
Returns
A DateTime set to the last write time.
Divooka.Platform.FileSystem.GetLastWriteTimeUtc()
Returns the date and time, in Coordinated Universal Time (UTC), that the specified file or directory was last written to.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file or directory to check. |
Returns
A DateTime set to the last write time in UTC.
Divooka.Platform.FileSystem.MoveFile()
Moves a specified file to a new location with a new file name, optionally replace the destination file if it already exists. Default overwrites.
Parameters
| Name | Description | Default |
|---|---|---|
sourceFileName |
The file to move. | |
destFileName |
The new path for the file. | |
overwrite |
True to overwrite if the destination file exists; otherwise false. |
Divooka.Platform.FileSystem.ReadAllBytes()
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to open for reading. | |
returnEmptyOnException |
Whether the function should throw exception or return empty string in case of exception (e.g. file doesn't exist). |
Returns
A byte array containing the contents of the file.
Divooka.Platform.FileSystem.ReadAllLines()
Opens a file, reads all lines of the file, optionally with the specified Encoding encoding, and then closes the file.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to open for reading. | |
encoding |
The encoding to use, or null to use default. | |
returnEmptyOnException |
Whether the function should throw exception or return empty string in case of exception (e.g. file doesn't exist). |
Returns
An array of all lines read from the file.
Divooka.Platform.FileSystem.ReadAllText()
Opens a file, reads all text in the file, optionally with the specified Encoding encoding, and then closes the file.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to open for reading. | |
encoding |
The encoding to use, or null to use default. | |
returnEmptyOnException |
Whether the function should throw exception or return empty string in case of exception (e.g. file doesn't exist). |
Returns
A string containing all text in the file.
Divooka.Platform.FileSystem.Replace()
Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file, optionally ignores merge errors.
Parameters
| Name | Description | Default |
|---|---|---|
sourceFileName |
The name of a file that will replace the file specified by destinationFileName. | |
destinationFileName |
The file to be replaced. | |
destinationBackupFileName |
The name of the backup file. | |
ignoreMetadataErrors |
True to ignore merge errors (metadata), otherwise false. |
Divooka.Platform.FileSystem.ResolveFileLinkTarget()
Gets the target of the specified file link.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The link whose target will be resolved. | |
returnFinalTarget |
True to return the final target of the link chain, otherwise false. |
Divooka.Platform.FileSystem.SetCreationTime()
Sets the date and time the file was created.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file. | |
creationTime |
A DateTime containing the value to set for the creation date and time of the file. |
Divooka.Platform.FileSystem.SetCreationTimeUtc()
Sets the date and time, in Coordinated Universal Time (UTC), that the file was created.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file path. | |
creationTimeUtc |
A DateTime set to the creation date and time in UTC. |
Divooka.Platform.FileSystem.SetLastAccessTime()
Sets the date and time the specified file was last accessed.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file. | |
accessTime |
A DateTime containing the value to set for the last access date and time. |
Divooka.Platform.FileSystem.SetLastAccessTimeUtc()
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file was last accessed.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file. | |
utcTime |
A DateTime set to the last access date and time in UTC. |
Divooka.Platform.FileSystem.SetLastWriteTime()
Sets the date and time that the specified file was last written to.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file. | |
writeTime |
A DateTime containing the value to set for the last write date and time. |
Divooka.Platform.FileSystem.SetLastWriteTimeUtc()
Sets the date and time, in Coordinated Universal Time (UTC), that the specified file was last written to.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file. | |
utcTime |
A DateTime containing the value to set for the last write date and time in UTC. |
Divooka.Platform.FileSystem.WriteAllBytes()
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is truncated and overwritten.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to write to. | |
bytes |
The bytes to write to the file. |
Divooka.Platform.FileSystem.WriteAllLines()
Creates a new file, writes a collection of strings to the file, and then closes the file, optionally with specified encoding (default UTF8).
Remarks
Notice per PSL, our approach for writing texts is to assume UTF8 by default but when reading we allow using "local system" encoding.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to write to. | |
contents |
The lines to write to the file. | |
encoding |
The encoding to use, or null for UTF8. |
Divooka.Platform.FileSystem.WriteAllLines()
Creates a new file, writes the specified string array to the file and optionally using the specified Encoding encoding, and then closes the file.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to write to. | |
lines |
The string array to write to the file. | |
encoding |
The encoding to use, or null for UTF8. |
Divooka.Platform.FileSystem.WriteTextToFile()
Creates a new file, writes the specified string to the file, and then closes the file, optionally using the specified Encoding encoding. If the target file already exists, it is truncated and overwritten.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file to write to. | |
text |
The text to write to the file. | |
encoding |
The encoding to use, or null for UTF8. |
Divooka.Platform.FileSystem.DirectoryExists()
Determines whether the given path refers to an existing directory on disk.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to check. |
Returns
Divooka.Platform.FileSystem.GetFiles()
Returns the names of files (including their paths) in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search for files. |
Files
An array of the full names (including paths) for the files.
Divooka.Platform.FileSystem.GetFiles()
Returns the names of files (including their paths) that match the specified search pattern in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search for files. | |
searchPattern |
The search string to match against file names. |
Returns
An array of the full names (including paths) for the files that match the search pattern.
Divooka.Platform.FileSystem.GetFiles()
Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search for files. | |
searchPattern |
The search string to match against file names. | |
searchOption |
A value that specifies whether to search only the current directory or all subdirectories. |
Returns
An array of the full names (including paths) for the files that match the search pattern.
Divooka.Platform.FileSystem.GetFiles()
Returns the names of files (including their paths) that match the specified search pattern and enumeration options in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search for files. | |
searchPattern |
The search string to match against file names. | |
enumerationOptions |
Specifies how the directory is to be enumerated. |
Returns
An array of the full names (including paths) for the files that match the search pattern and enumeration options.
Divooka.Platform.FileSystem.GetDirectories()
Returns the names of subdirectories (including their paths) in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search for subdirectories. |
Returns
An array of the full names (including paths) for the subdirectories.
Divooka.Platform.FileSystem.GetDirectories()
Returns the names of subdirectories (including their paths) that match the specified search pattern in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search. | |
searchPattern |
The search string to match. |
Returns
An array of the full names (including paths) for the directories that match the specified search pattern.
Divooka.Platform.FileSystem.GetDirectories()
Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. | |
searchOption |
Specifies whether to search the current directory or all subdirectories. |
Returns
An array of the full names (including paths) for the directories that match the specified search pattern.
Divooka.Platform.FileSystem.GetDirectories()
Returns the names of subdirectories (including their paths) that match the specified search pattern and enumeration options in the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. | |
enumerationOptions |
Specifies options for directory enumeration. |
Returns
An array of the full names (including paths) for the directories that match the specified search pattern and enumeration options.
Divooka.Platform.FileSystem.GetFileSystemEntries()
Returns the names of all files and subdirectories in a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search. |
Returns
An array of the full names (including paths) for all files and subdirectories in the specified path.
Divooka.Platform.FileSystem.GetFileSystemEntries()
Returns an array of file names and directory names that match a search pattern in a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. |
Returns
An array of the full names (including paths) for the files and directories that match the specified search pattern.
Divooka.Platform.FileSystem.GetFileSystemEntries()
Returns an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. | |
searchOption |
Specifies whether to search the current directory or all subdirectories. |
Returns
An array of the full names (including paths) for the files and directories that match the specified search pattern.
Divooka.Platform.FileSystem.GetFileSystemEntries()
Returns an array of file names and directory names that match a search pattern and enumeration options in a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. | |
enumerationOptions |
Specifies options for directory enumeration. |
Returns
An array of the full names (including paths) for the files and directories that match the specified search pattern and enumeration options.
Divooka.Platform.FileSystem.EnumerateFileSystemEntries()
Returns an enumerable collection of file names and directory names in a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to search. |
Returns
An enumerable collection of the full names (including paths) of files and directories in the specified path.
Divooka.Platform.FileSystem.EnumerateFileSystemEntries()
Returns an enumerable collection of file names and directory names that match a search pattern in a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. |
Returns
An enumerable collection of the full names (including paths) of files and directories that match the specified search pattern.
Divooka.Platform.FileSystem.EnumerateFileSystemEntries()
Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path to search. | |
searchPattern |
The search string to match. | |
searchOption |
Specifies whether to search the current directory or all subdirectories. |
Returns
An enumerable collection of the full names (including paths) of files and directories that match the specified search pattern.
Divooka.Platform.FileSystem.GetDirectoryRoot()
Returns the volume information, root information, or both for the specified path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of a file or directory. |
Returns
A string that contains the directory information for the specified path.
Divooka.Platform.FileSystem.GetCurrentDirectory
Gets the current working directory of the application.
Returns
A string that contains the path of the current working directory.
Divooka.Platform.FileSystem.SetCurrentDirectory()
Sets the application's current working directory to the specified directory.
Parameters
| Name | Description | Default |
|---|---|---|
folderPath |
The path to the directory to set as the current working directory. |
Divooka.Platform.FileSystem.MoveDirectory()
Moves a file or a directory and its contents to a new location.
Parameters
| Name | Description | Default |
|---|---|---|
sourceDirName |
The path of the file or directory to move. | |
destDirName |
The path to the new location for sourceDirName. |
Divooka.Platform.FileSystem.DeleteDirectory()
Deletes an empty directory from a specified path.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The name of the empty directory to remove. |
Divooka.Platform.FileSystem.DeleteDirectory()
Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
The name of the directory to remove. | |
recursive |
true to remove directories, subdirectories, and files; otherwise, false. |
Divooka.Platform.FileSystem.GetLogicalDrives
Retrieves the names of the logical drives on this computer in the form "<drive letter>:\".
Returns
An array of strings that represent the names of logical drives.
Divooka.Platform.FileSystem.Move()
Move file or directory to new path
Parameters
| Name | Description | Default |
|---|---|---|
path |
The current path of the file or directory. | |
newPath |
The new path to which the file or directory will be moved. |
Divooka.Platform.FileSystem.RenameFile()
Rename file, automatically handles folder path, automatically handles extension.
Cannot be used to change extension - use Change Extension instead.
Parameters
| Name | Description | Default |
|---|---|---|
path |
Original path | |
newName |
New name, optionally with (existing) extension |
Divooka.Platform.FileSystem.RenameFile()
Rename file with regular expression.
Parameters
| Name | Description | Default |
|---|---|---|
path |
File path | |
regexPattern |
Regular expression pattern | |
replacement |
Replacement pattern |
Divooka.Platform.FileSystem.Delete()
Delete file or directory
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path of the file or directory to delete. |
Divooka.Platform.FileSystem.CreateSymbolicLink()
Create symbolic link to file or directory
Parameters
| Name | Description | Default |
|---|---|---|
path |
The original path of the file or directory. | |
newPath |
The path where the symbolic link will be created. |
Divooka.Platform.FileSystem.ResolveLinkTarget()
Resolve symbolic link to file or directory
Parameters
| Name | Description | Default |
|---|---|---|
path |
The path containing the symbolic link to resolve. | |
returnFinalTarget |
True to return the final target of the link; otherwise, false. |
Divooka.Platform.FileSystem.SetWorkingDirectory()
Set current working directory.
Parameters
| Name | Description | Default |
|---|---|---|
path |
Path to use. |
Divooka.Platform.FileSystem.GetWorkingDirectory
Get current working directory.
Returns
Path.
Divooka.Platform.FileSystem.GetTempFolderPath()
Gets a temporary folder path and optionally creates the folder.
Parameters
| Name | Description | Default |
|---|---|---|
createFolder |
True to create the folder; otherwise, false. |
Returns
The temporary folder path.
Divooka.Platform.FileSystem.GetTempFilePath
Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.
Returns
The full path of the newly created temporary file.
Divooka.Platform.FileSystem.GetTempFilePath()
Creates a uniquely named, zero-byte temporary file with certain extension on disk and returns the full path of that file.
Parameters
| Name | Description | Default |
|---|---|---|
extension |
The desired file extension. |
Returns
The full path of the newly created temporary file with the specified extension.
Divooka.Platform.FileSystem.GetApplicationDataFile()
Gets path to a file that's unique to a named application.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
fileName |
The name of the file. |
Returns
The path to the application data file.
Divooka.Platform.FileSystem.GetApplicationDataFile()
Gets path to a file that's unique to a named application within a folder.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
folderName |
The name of the folder. | |
fileName |
The name of the file. |
Returns
The path to the application data file.
Divooka.Platform.FileSystem.GetApplicationDataFile()
Gets path to a file that's unique to a named application within subfolders.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
folderName |
The name of the parent folder. | |
subfolderName |
The name of the subfolder. | |
fileName |
The name of the file. |
Returns
The path to the application data file.
Divooka.Platform.FileSystem.GetApplicationDataFolder()
Gets path to a folder that's unique to a named application, optionally creates the folder.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
createFolder |
True to create the folder; otherwise, false. |
Returns
The path to the application data folder.
Divooka.Platform.FileSystem.GetApplicationDataFolder()
Gets path to a subfolder folder within a uniquely named application, optionally creates the folder.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
folderName |
The name of the subfolder. | |
createFolder |
True to create the folder; otherwise, false. |
Returns
The path to the application data subfolder.
Divooka.Platform.FileSystem.GetApplicationDataFolder()
Gets path to a subfolder folder within a uniquely named application, optionally creates the folder.
Parameters
| Name | Description | Default |
|---|---|---|
applicationName |
The name of the application. | |
folderName |
The name of the subfolder. | |
subfolderName |
The name of the subfolder. | |
createFolder |
True to create the folder; otherwise, false. |
Returns
The path to the application data subfolder.
Divooka.Platform.FileSystem.EncodeBase64()
Encodes a binary file using Base64 string representation.
Parameters
| Name | Description | Default |
|---|---|---|
filePath |
The file path to read and encode. |
Returns
A Base64 string representation of the file.
Divooka.Platform.FileSystem.DecodeBase64()
Decodes a Base64 string representation into bytes array.
Parameters
| Name | Description | Default |
|---|---|---|
base64String |
The Base64 string to decode. |
Returns
The bytes resulting from decoding the Base64 string.
Divooka.Platform.FileSystem.DecodeBase64()
Decodes a Base64 string representation into a binary file.
Parameters
| Name | Description | Default |
|---|---|---|
base64String |
The Base64 string to decode. | |
outputFile |
The path where the decoded file will be written. |
Divooka.Platform.FileSystem.GetFileMD5()
Get MD5 string representation of file
Parameters
| Name | Description | Default |
|---|---|---|
path |
The file path to compute MD5 for. |
Returns
The MD5 hash string of the file.
Divooka.Platform.ZipArchive
Provides utility functions related to zip archive
Divooka.Platform.ZipArchive.ZipFolder()
Zips entire folder
Divooka.Platform.ZipArchive.Unzip()
Unzip a given zip archive, optionally eliminate duplicate root (not implemented yet).
Divooka.Platform.Standardization.ParcelOpenStandard
Provides a hierarchical description structure for DiOS. This is mostly for demonstration purpose.
Remarks
For simplicity, we are providing contents directly as string literals; Notice ParcelOpenStandard needs Frontend/DiOS level support for displaying.
TODO: Consider moving into Parcel.Demo or Parcel.Manual etc. package instead since this module doesn't serve practical purposes.
Divooka.Platform.Standardization.ParcelOpenStandard.DiOS
Children
Divooka.Platform.Standardization.ParcelOpenStandard.ParcelFrontends
Provides description for frontends.
Children
Divooka.Platform.Types.BooleanRoutines
Exposes binary operations
Remarks
Should also expose everything under System.Boolean
Divooka.Platform.Types.BooleanRoutines.BiggerThan()
Divooka.Platform.Types.BooleanRoutines.SmallerThan()
Divooka.Platform.Types.BooleanRoutines.Or()
Divooka.Platform.Types.BooleanRoutines.Xor()
Divooka.Platform.Types.LogicRoutines
Exposes logic
Divooka.Platform.Types.LogicRoutines.Choose()
Remarks
Otherwise known as ternary operator 😄
Divooka.Platform.Types.LogicRoutines.Choose()
Parameters
| Name | Description | Default |
|---|---|---|
choice |
Should we call it "choice" or "selector"?🤔 |
Divooka.Platform.Types.LogicRoutines.OneHotSwitch()
Check match against supplied values.
Returns 1-hot encoding.
Divooka.Platform.Types.LogicRoutines.OneHotSwitch()
Check match against supplied values.
Returns 1-hot encoding.
Divooka.Platform.Types.LogicRoutines.OneHotSwitch()
Check match against supplied values.
Returns 1-hot encoding.
Divooka.Platform.Types.LogicRoutines.OneHotSwitch()
Check match against supplied values.
Returns 1-hot encoding.
Divooka.Platform.Types.LogicRoutines.OneHotSwitch()
Check match against supplied values.
Returns 1-hot encoding.
Divooka.Platform.Types.NumberRoutines
Exposes double-point value type, provides all functions related to scalar numerical math.
Includes basic C# operations plus everything from System.Math
Remarks
For culture reasons, we are not simply naming arguments as a, b, or number1, number 2, etc.
Divooka.Platform.Types.NumberRoutines.Add()
Adds two numbers and returns the sum.
Parameters
| Name | Description | Default |
|---|---|---|
summand1 |
The first number to add. | |
summand2 |
The second number to add. |
Returns
The sum of the two numbers.
Divooka.Platform.Types.NumberRoutines.Subtract()
Subtracts the second number from the first and returns the result.
Parameters
| Name | Description | Default |
|---|---|---|
minuend |
The number to subtract from. | |
subtrahend |
The number to subtract. |
Returns
The difference between the two numbers.
Divooka.Platform.Types.NumberRoutines.Multiply()
Multiplies two numbers and returns the product.
Parameters
| Name | Description | Default |
|---|---|---|
factor1 |
The first number to multiply. | |
factor2 |
The second number to multiply. |
Returns
The product of the two numbers.
Divooka.Platform.Types.NumberRoutines.Divide()
Divides the first number by the second and returns the quotient.
Parameters
| Name | Description | Default |
|---|---|---|
dividend |
The number to be divided. | |
divisor |
The number by which to divide. |
Returns
The quotient of the division.
Divooka.Platform.Types.NumberRoutines.Modulus()
Returns the remainder of division of one number by another.
Parameters
| Name | Description | Default |
|---|---|---|
dividend |
The number to be divided. | |
divisor |
The number by which to divide. |
Returns
The remainder of the division.
Divooka.Platform.Types.NumberRoutines.Power()
Raises a base number to the specified exponent.
Parameters
| Name | Description | Default |
|---|---|---|
base |
The base number. | |
exponent |
The exponent to raise the base to. |
Returns
The result of raising base to the power of exponent.
Divooka.Platform.Types.NumberRoutines.Root()
Returns the specified root of a given number.
Parameters
| Name | Description | Default |
|---|---|---|
radicand |
The number whose root is to be calculated. | |
degree |
The degree of the root. |
Returns
The calculated root of the given number.
Divooka.Platform.Types.NumberRoutines.BiggerThan()
Determines whether the first double is greater than the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is greater than second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.SmallerThan()
Determines whether the first double is less than the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is less than second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.EqualTo()
Determines whether the first double is equal to the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is equal to second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.GreaterThanOrEqualTo()
Determines whether the first double is greater than or equal to the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is greater than or equal to second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.SmallerThanOrEqualTo()
Determines whether the first double is less than or equal to the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is less than or equal to second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.NotEqual()
Determines whether the first double is not equal to the second double.
Parameters
| Name | Description | Default |
|---|---|---|
first |
The first double to compare. | |
second |
The second double to compare. |
Returns
true if first is not equal to second; otherwise, false.
Divooka.Platform.Types.NumberRoutines.AbsoluteValue()
Returns the absolute value of a double-precision floating-point number.
Divooka.Platform.Types.NumberRoutines.Acos()
Returns the angle whose cosine is the specified number.
Divooka.Platform.Types.NumberRoutines.Acosh()
Returns the angle whose hyperbolic cosine is the specified number.
Divooka.Platform.Types.NumberRoutines.Asin()
Returns the angle whose sine is the specified number.
Divooka.Platform.Types.NumberRoutines.Asinh()
Returns the angle whose hyperbolic sine is the specified number.
Divooka.Platform.Types.NumberRoutines.Atan()
Returns the angle whose tangent is the specified number.
Divooka.Platform.Types.NumberRoutines.Atan2()
Returns the angle whose tangent is the quotient of two specified numbers.
Divooka.Platform.Types.NumberRoutines.Atanh()
Returns the angle whose hyperbolic tangent is the specified number.
Divooka.Platform.Types.NumberRoutines.BitDecrement()
Returns the largest value that compares less than a specified value.
Divooka.Platform.Types.NumberRoutines.BitIncrement()
Returns the smallest value that compares greater than a specified value.
Divooka.Platform.Types.NumberRoutines.CubeRoot()
Returns the cube root of a specified number.
Divooka.Platform.Types.NumberRoutines.Ceiling()
Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number.
Divooka.Platform.Types.NumberRoutines.Clamp()
Returns value clamped to the inclusive range of min and max.
Divooka.Platform.Types.NumberRoutines.CopySign()
Returns a value with the magnitude of x and the sign of y.
Divooka.Platform.Types.NumberRoutines.Cos()
Returns the cosine of the specified angle.
Divooka.Platform.Types.NumberRoutines.Cosh()
Returns the hyperbolic cosine of the specified angle.
Divooka.Platform.Types.NumberRoutines.Exp()
Returns e raised to the specified power.
Divooka.Platform.Types.NumberRoutines.Floor()
Returns the largest integral value less than or equal to the specified double-precision floating-point number.
Divooka.Platform.Types.NumberRoutines.FusedMultiplyAdd()
Returns (x * y) + z, rounded as one ternary operation.
Divooka.Platform.Types.NumberRoutines.IEEERemainder()
Returns the remainder resulting from the division of a specified number by another specified number.
Divooka.Platform.Types.NumberRoutines.ILogB()
Returns the base 2 integer logarithm of a specified number.
Divooka.Platform.Types.NumberRoutines.Log()
Returns the natural (base e) logarithm of a specified number.
Divooka.Platform.Types.NumberRoutines.Log()
Returns the logarithm of a specified number in a specified base.
Divooka.Platform.Types.NumberRoutines.Log10()
Returns the base 10 logarithm of a specified number.
Divooka.Platform.Types.NumberRoutines.Log2()
Returns the base 2 logarithm of a specified number.
Divooka.Platform.Types.NumberRoutines.Max()
Returns the larger of two double-precision floating-point numbers.
Divooka.Platform.Types.NumberRoutines.MaxMagnitude()
Returns the larger magnitude of two double-precision floating-point numbers.
Divooka.Platform.Types.NumberRoutines.Min()
Returns the smaller of two double-precision floating-point numbers.
Divooka.Platform.Types.NumberRoutines.MinMagnitude()
Returns the smaller magnitude of two double-precision floating-point numbers.
Divooka.Platform.Types.NumberRoutines.ReciprocalEstimate()
Returns an estimate of the reciprocal of a specified number.
Divooka.Platform.Types.NumberRoutines.ReciprocalSqrtEstimate()
Returns an estimate of the reciprocal square root of a specified number.
Divooka.Platform.Types.NumberRoutines.Round()
Rounds a double-precision floating-point value to the nearest integral value, and rounds midpoint values to the nearest even number.
Divooka.Platform.Types.NumberRoutines.Round()
Rounds a double-precision floating-point value to a specified number of fractional digits, and rounds midpoint values to the nearest even number.
Divooka.Platform.Types.NumberRoutines.Round()
Rounds a double-precision floating-point value to a specified number of fractional digits using the specified rounding convention.
Divooka.Platform.Types.NumberRoutines.Round()
Rounds a double-precision floating-point value to an integer using the specified rounding convention.
Divooka.Platform.Types.NumberRoutines.ScaleB()
Returns x * 2^n computed efficiently.
Divooka.Platform.Types.NumberRoutines.Sign()
Returns an integer that indicates the sign of a double-precision floating-point number.
Divooka.Platform.Types.NumberRoutines.Sin()
Returns the sine of the specified angle.
Divooka.Platform.Types.NumberRoutines.SinDegrees()
Returns the sine of the specified angle.
Divooka.Platform.Types.NumberRoutines.SinCos()
Returns the sine and cosine of the specified angle.
Divooka.Platform.Types.NumberRoutines.Sinh()
Returns the hyperbolic sine of the specified angle.
Divooka.Platform.Types.NumberRoutines.SquareRoot()
Returns the square root of a specified number.
Divooka.Platform.Types.NumberRoutines.Tan()
Returns the tangent of the specified angle.
Divooka.Platform.Types.NumberRoutines.Tanh()
Returns the hyperbolic tangent of the specified angle.
Divooka.Platform.Types.NumberRoutines.Truncate()
Calculates the integral part of a specified double-precision floating-point number.
Divooka.Platform.Types.PrimitiveConverters.ConvertTo``1()
Converts the specified input to the type .
Parameters
| Name | Description | Default |
|---|---|---|
input |
The input object to convert. |
Returns
The converted value of type .
Divooka.Platform.Types.PrimitiveConverters.StringToInt()
Converts a string to an integer.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
An integer representation of the string.
Divooka.Platform.Types.PrimitiveConverters.IntToString()
Converts an integer to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The integer to convert. |
Returns
A string representation of the integer.
Divooka.Platform.Types.PrimitiveConverters.StringToBool()
Converts a string to a boolean.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A boolean value parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.BoolToString()
Converts a boolean to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The boolean value to convert. |
Returns
A string representation of the boolean.
Divooka.Platform.Types.PrimitiveConverters.StringToDouble()
Converts a string to a double.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A double parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.DoubleToString()
Converts a double to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The double value to convert. |
Returns
A string representation of the double.
Divooka.Platform.Types.PrimitiveConverters.StringToByteSizeNumber()
Converts a string to a byte-sized integer.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A byte parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.ByteSizeNumberToString()
Converts a byte to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The byte value to convert. |
Returns
A string representation of the byte.
Divooka.Platform.Types.PrimitiveConverters.UTF8StringToBytes()
Converts a UTF8 encoded string to bytes.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
Bytes from the string.
Divooka.Platform.Types.PrimitiveConverters.ByteSizeNumberToString()
Converts UTF8 bytes to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The bytes to convert. |
Returns
A string representation of the bytes.
Divooka.Platform.Types.PrimitiveConverters.StringToLong()
Converts a string to a long.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A long parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.LongToString()
Converts a long to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The long value to convert. |
Returns
A string representation of the long.
Divooka.Platform.Types.PrimitiveConverters.StringToChar()
Converts a string containing a single character to a char.
Remarks
For char conversion, we assume the input string should contain exactly one character.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. Must contain exactly one character. |
Returns
The character represented by the string.
Divooka.Platform.Types.PrimitiveConverters.CharToString()
Converts a char to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The char to convert. |
Returns
A string representation of the char.
Divooka.Platform.Types.PrimitiveConverters.StringToSignedByteNumber()
Converts a string to a signed byte (sbyte).
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
An sbyte parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.SignedByteNumberToString()
Converts an sbyte to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The sbyte to convert. |
Returns
A string representation of the sbyte.
Divooka.Platform.Types.PrimitiveConverters.StringToShort()
Converts a string to a short.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A short parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.ShortToString()
Converts a short to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The short to convert. |
Returns
A string representation of the short.
Divooka.Platform.Types.PrimitiveConverters.StringToUShort()
Converts a string to an unsigned short (ushort).
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A ushort parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.UShortToString()
Converts a ushort to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The ushort to convert. |
Returns
A string representation of the ushort.
Divooka.Platform.Types.PrimitiveConverters.StringToUInt()
Converts a string to an unsigned integer (uint).
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A uint parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.UIntToString()
Converts a uint to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The uint to convert. |
Returns
A string representation of the uint.
Divooka.Platform.Types.PrimitiveConverters.StringToULong()
Converts a string to an unsigned long (ulong).
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
An ulong parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.ULongToString()
Converts an ulong to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The ulong to convert. |
Returns
A string representation of the ulong.
Divooka.Platform.Types.PrimitiveConverters.StringToFloat()
Converts a string to a float.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A float parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.FloatToString()
Converts a float to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The float to convert. |
Returns
A string representation of the float.
Divooka.Platform.Types.PrimitiveConverters.StringToDecimal()
Converts a string to a decimal.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The string to convert. |
Returns
A decimal parsed from the string.
Divooka.Platform.Types.PrimitiveConverters.DecimalToString()
Converts a decimal to its string representation.
Parameters
| Name | Description | Default |
|---|---|---|
input |
The decimal to convert. |
Returns
A string representation of the decimal.
Divooka.Platform.Types.StringRoutines
Remarks
Should we simply expose everything under System.String instead?
TODO: Consider merge with StandardDemo.cs
Divooka.Platform.Types.StringRoutines.EscapeText()
Given plain text (like that read from a file), treat it as if it were a C# literal.
For example, the two-character sequence "\r" is converted to a carriage return.
Divooka.Platform.Types.StringRoutines.EscapeCharacter()
Given plain text representing a character literal, treat it as if it were a C# character literal.
The resulting string must represent exactly one character.
Divooka.Platform.Types.StringRoutines.Split()
Splits a string into an array using newline characters as separators, while trimming whitespace and removing empty entries.
Parameters
| Name | Description | Default |
|---|---|---|
text |
The input string. |
Returns
An array of non-empty, trimmed strings.
Divooka.Platform.Types.StringRoutines.Split()
Splits a string using a specified separator character.
Parameters
| Name | Description | Default |
|---|---|---|
text |
The input string. | |
separator |
The character used to split the string. | |
trim |
If true, trims whitespace and removes empty entries from the resulting array. |
Returns
An array of split strings.
Divooka.Platform.Types.StringRoutines.RegularExpressionReplace()
Replaces all occurrences of a specified regular expression pattern in the input string with a replacement string.
Parameters
| Name | Description | Default |
|---|---|---|
value |
The input string. | |
search |
The regular expression pattern to match. | |
replacement |
The replacement string. |
Returns
A new string with the replacements applied.