Ian Wienand 7a00f832f9 Add a mixed mode parser to string_to_bytes
This proposes a "mixed" parsing type that interprets the IEC-ish "i"
units as power-of-two and the SI-style "non-i" units as power-of-ten.
This is a round-about way of saying it is basically making it the same
as the way GNU parted interprets such strings [1].

While I'd be the first to admit it's a bit ugly, I think it could
serve a role for people who have to interpret such strings for
compatability reasons.  In particuarly within diskimage-builder, we've
accepted these strings for partition creation (being modeled on
parted) and I'd certainly like to not have our own unit parser if we
can help it.

[1] https://www.gnu.org/software/parted/manual/html_node/unit.html

Change-Id: I772bcb6651484d68afabd1965e5db033439c6257
2017-09-13 21:10:39 +10:00
..
2016-06-17 07:51:19 +03:00
2015-01-16 16:19:54 -06:00
2016-06-17 07:51:19 +03:00
2016-10-28 14:55:18 +02:00
2016-06-17 07:51:19 +03:00
2016-06-17 07:51:19 +03:00