numparse ~master

Parsing numbers library


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

NUMPARSE

Library for parsing numbers from string. nothrow, @nogc, pure, @trusted and betterC compatible.

Provide:

enum ParseError
{
    none,
    wrongSymbol,
    valueLimit,
    elementCount
}

pure @nogc nothrow @trusted
ParseError parseUintNumber(int base, T)(ref T dst, scope const(char)[] str, uint* pow=null)
    if (isIntegral!T && isUnsigned!T);

pure @nogc nothrow @trusted
ParseError parseIntNumber(int base, T)(ref T dst, scope const(char)[] str, uint* pow=null)
    if (isIntegral!T && isSigned!T);

pure @nogc nothrow @trusted
ParseError parseSimpleFloatNumber(int base, T)(ref T dst, scope const(char)[] str, char sep='.')
    if (isFloatingPoint!T);

base must be >=2 and <=16

Authors:
  • deviator
Dependencies:
none
Versions:
0.1.0 2020-Sep-10
~master 2020-Sep-13
Show all 2 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 6 downloads total

Score:
0.8
Short URL:
numparse.dub.pm