//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Reflection;
using System.Globalization;

#if !WASM
namespace CommonHelpers {
#else
namespace CommonHelpers.WASM {
#endif

//**************************************************************************************************
partial class HNumParser {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static bool TryParse<T>( string src, NumberStyles styles,
                                out T dst ) where T: struct
   { return TryParse(src,styles,NumberFormatInfo.CurrentInfo,out dst); }
public static bool TryParse<T>( string src, NumberStyles styles, T def,
                                out T dst ) where T: struct
   { return TryParse(src,styles,NumberFormatInfo.CurrentInfo,def,out dst); }

public static bool TryParse<T>( string src, NumberStyles styles, IFormatProvider provider,
                                out T dst ) where T: struct
   { return HValueParser.TryParse(src,new object[]{styles,provider},out dst); }
public static bool TryParse<T>( string src, NumberStyles styles,
                                IFormatProvider provider, T def,
                                out T dst ) where T: struct
   { return HValueParser.TryParse(src,new object[]{styles,provider},def,out dst); }

//--------------------------------------------------------------------------------------------------

public static bool TryParseInvariant<T>(string src,out T dst) where T: struct
   { return HValueParser.TryParse(src,NumberFormatInfo.InvariantInfo,out dst); }
public static bool TryParseInvariant<T>(string src,T def,out T dst) where T: struct
   { return HValueParser.TryParse(src,NumberFormatInfo.InvariantInfo,def,out dst); }

public static bool TryParseInvariant<T>( string src, NumberStyles styles,
                                         out T dst ) where T: struct
   { return TryParse(src,styles,NumberFormatInfo.InvariantInfo,out dst); }
public static bool TryParseInvariant<T>( string src, NumberStyles styles, T def,
                                         out T dst ) where T: struct
   { return TryParse(src,styles,NumberFormatInfo.InvariantInfo,def,out dst); }

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HNumParser
//**************************************************************************************************

} // CommonHelpers (.WASM)
