Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Jzon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,15 @@ namespace Jzon
}
}
#define GET_NUMBER(T) \
if (isNumber())\
if (isValue())\
{\
std::stringstream sstr(data->valueStr);\
T val;\
double val;\
std::string remain;\
sstr >> val;\
return val;\
if(sstr.fail()) return def;\
sstr >> remain;\
return remain.empty() ? val : def;\
}\
else\
{\
Expand Down
1 change: 1 addition & 0 deletions Jzon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ THE SOFTWARE.
#include <istream>
#include <ostream>


#ifndef JZON_API
# ifdef JZON_DLL
# if defined _WIN32 || defined __CYGWIN__
Expand Down