Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michael-fadely/dlang-utils
Some common things I use in my D projects.
https://github.com/michael-fadely/dlang-utils
Last synced: about 1 month ago
JSON representation
Some common things I use in my D projects.
- Host: GitHub
- URL: https://github.com/michael-fadely/dlang-utils
- Owner: michael-fadely
- License: mit
- Created: 2016-09-26T20:11:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T18:38:54.000Z (4 months ago)
- Last Synced: 2024-11-03T18:16:44.289Z (3 months ago)
- Language: D
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dlang-utils
Some common things I use in my D projects.# Module Overview
## util.array
when `std.algorithm.searching` just won't do the job## util.modifiable
Contains a template structure `Modifiable!YourType` that raises a flag when the value of members marked with the `@Modifier` attribute in your structure have changed. The field `bool modified;` indicates the modified state of your structure. This can be useful, for example, to determine when to serialize a structure to disk.## util.sizesuffix
### `sizeSuffix`
Takes an input "size" in bytes and returns a size-suffix string. e.g `sizeSuffix(1024)` returns the string `1.00 KB`.## util.string
### `wildToRegex`
Converts your typical wildcard pattern string (containing `*` for any-character match, and `?` for single-character match) into a regular expression.### `match`
Checks for a wildcard match in the target by converting the pattern to a regular expression using `wildToRegex`, and then running `std.regex.matchAll` on the target.### `tokenize`
Converts a string into an array of strings split by space, except where escape characters are concerned.For example, given this string:
`` `This is my string "with \"substring\"" and\ escape\ characters` ``
This function will return the array:
`` [ `This`, `is`, `my`, `string`, `with "substring"`, `and escape characters` ]``