mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
latest changes from main rep
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NumberParser.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/NumberParser.cpp#11 $
|
||||
// $Id: //poco/Main/Foundation/src/NumberParser.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <cstdio>
|
||||
#include <cctype>
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
@@ -65,7 +65,7 @@ int NumberParser::parse(const std::string& s)
|
||||
bool NumberParser::tryParse(const std::string& s, int& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%d%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%d%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ unsigned NumberParser::parseUnsigned(const std::string& s)
|
||||
bool NumberParser::tryParseUnsigned(const std::string& s, unsigned& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%u%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%u%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ unsigned NumberParser::parseHex(const std::string& s)
|
||||
bool NumberParser::tryParseHex(const std::string& s, unsigned& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%x%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%x%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ Int64 NumberParser::parse64(const std::string& s)
|
||||
bool NumberParser::tryParse64(const std::string& s, Int64& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%"I64_FMT"d%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%"I64_FMT"d%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ UInt64 NumberParser::parseUnsigned64(const std::string& s)
|
||||
bool NumberParser::tryParseUnsigned64(const std::string& s, UInt64& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%"I64_FMT"u%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%"I64_FMT"u%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ UInt64 NumberParser::parseHex64(const std::string& s)
|
||||
bool NumberParser::tryParseHex64(const std::string& s, UInt64& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%"I64_FMT"x%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%"I64_FMT"x%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ double NumberParser::parseFloat(const std::string& s)
|
||||
bool NumberParser::tryParseFloat(const std::string& s, double& value)
|
||||
{
|
||||
char temp;
|
||||
return sscanf(s.c_str(), "%lf%c", &value, &temp) == 1;
|
||||
return std::sscanf(s.c_str(), "%lf%c", &value, &temp) == 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user