UniversityRadioYork/ury-playd — pull request #44 by CaptainHayashi (2014-09-14 15:11:39+00:00)
Title: Simplify TimeParser. (attempt 2)

__Note:__ This was originally #43, but I failed at git and accidentally poisoned the commit log with all sorts of crap. Rather than rewriting history, I've decided to close and re-open the pull request. See #43 for previous discussion.

To simplify the codebase a bit, TimeParser is now:

* No longer constructed with a customisable unit map; the units are mapped to multipliers by an internal `if` statement.
* No longer a template parameterised over the types involved; the output type is now fixed to an alias of `std::uint64_t`.
* No longer accepting _long-form_ units (`sec`, `mins`, etc). Use `us`, `ms`, `s`, `m`, and `h` instead.

This pull request also contains some unit tests for checking that TimeParser handles _valid_ time-strings. This is not a complete test suite, as it does not check exceptions. Currently, I'm unsure how to use Catch for exception tests, so we only check the 'valid' cases.