Generic code and definitions used in many Jaypha projects.
To use this package, put the following dependency into your project's dependencies section:
This project contains generic code that is used in many of my projects and is provided separately to avoid repetition. The code in this package is usable on its own.
The functions here generally extend the functionality provided by Phobos.
See docs/docs.html for reference documentation.
altIndexOf - A quick and dirty alternative to indexOf. Only works with ASCII.
isDigits - Are all characters digits?
splitUp - Splits a string into substrings based on a group of possible delimiters.
toCamelCase - Converts a string to camel case.
fromJSON - Alternative ways to extract from a
munch - Consumes the front of the range as long the elements are inside pattern.
grab - Grabs as much of the given range, until a character is found that is in a supplied pattern.
meld - Map-like algorithm that merges the index and values of an associative array.
rtMap - Similar to std.algorithm.map except that the mapping function provide at run-time rather than compile time.
diff - Returns everything in one array that is not in another.
findSplit - Alternative to std.alogrithm.findSplit usable with non-rewindable ranges.
drain - Consume the rest of the range. ByChunk - Splits a range into chunks of given size. Doesn't work with narrow strings. ByLines - Splits a range into lines. Buffered - Buffered output range decorator. UnPopable - Provides an 'ungetc' like functionality for input ranges.
rnd - A wrapper for rndGen to prevent copying, provided by monarch_dodra.
rndHex - A randomly generated string of hex characters. Useful for filenames.
rndId - A random string of lower case ASCII letters.
rndString - A random string of ASCII printable characters. Useful for passwords.
binToHex - Converts an unsigned interger into a hex string.
bitsToList - Extract the bits from a number and puts them into an array.
listToBits - Reduces an array to a single value by bit-or-ing them together.
Hash - Hash container.
Queue - Simple queue
Set - Simple set
IndexableSet - Set whose elements can be accessed by index.
Stack - Simple stack
print - Functions that perform
write like functionality, but with ranges rather than files.
serialize - Converting data to and from compact strings for easy storage and transfer.
BinaryWriter - Adaptor for writing binary data to a file as an output range.
Distributed under the Boost Software License, Version 1.0.
Many functions could do with polishing, but are usable in the current state.
Documentation is an ongoing task.
- Registered by Jason den Dulk