lib3mf 2.5 :

- aggiornamento versione
- utilizzate le nostre librerie esterne libzip e zlib e non quelle incluse in lib3mf.
This commit is contained in:
SaraP
2026-08-25 12:44:11 +02:00
parent ea6efc1e36
commit 513f08e691
544 changed files with 52634 additions and 30760 deletions
+15 -8
View File
@@ -38,6 +38,7 @@ correctly and Exception-safe
#include <cmath>
#include <string.h>
#include <vector>
#include <charconv>
namespace NMR {
@@ -153,18 +154,24 @@ namespace NMR {
__NMRASSERT(pwszValue);
nfDouble dResult = 0.0;
// Convert to double and make a input and range check!
nfChar * pEndPtr;
//skip leading whitespaces
for (; *pszValue && *pszValue == ' '; pszValue++);
dResult = strtod(pszValue, &pEndPtr);
// Convert to double and make a input and range check!
auto answer = fast_float::from_chars(pszValue, pszValue + strlen(pszValue), dResult);
// Check if any conversion happened
if ((pEndPtr == pszValue) || (!pEndPtr))
if (answer.ec != std::errc())
{
throw CNMRException(NMR_ERROR_EMPTYSTRINGTODOUBLECONVERSION);
if ((*pEndPtr != '\0') && (*pEndPtr != ' '))
throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION);
}
else if (answer.ptr) // Invalidate comma as decimal separator
{
if (answer.ptr[0] == ',')
{
throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION);
}
}
if ((dResult == HUGE_VAL) || (dResult == -HUGE_VAL))
throw CNMRException(NMR_ERROR_STRINGTODOUBLECONVERSIONOUTOFRANGE);