mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-09 11:17:31 +01:00
rename 'separator' to 'frac'; develop: PostgreSQLTest: missing ExecUtil class #1788
This commit is contained in:
parent
7f193697db
commit
128c5c57eb
@ -952,8 +952,8 @@ void PostgreSQLTest::recreatePersonTimeTable()
|
|||||||
|
|
||||||
void PostgreSQLTest::recreateIntsTable()
|
void PostgreSQLTest::recreateIntsTable()
|
||||||
{
|
{
|
||||||
dropTable("Ints");
|
dropTable("Strings");
|
||||||
try { *_pSession << "CREATE TABLE " << ExecUtil::ints() << " (str INTEGER)", now; }
|
try { *_pSession << "CREATE TABLE Strings (str INTEGER)", now; }
|
||||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail ("recreateIntsTable()"); }
|
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail ("recreateIntsTable()"); }
|
||||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail ("recreateIntsTable()"); }
|
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail ("recreateIntsTable()"); }
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ Var Var::parse(const std::string& val, std::string::size_type& pos)
|
|||||||
bool isNumber = false;
|
bool isNumber = false;
|
||||||
bool isSigned = false;
|
bool isSigned = false;
|
||||||
int separators = 0;
|
int separators = 0;
|
||||||
int separator = 0;
|
int frac = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
size_t size = str.size();
|
size_t size = str.size();
|
||||||
for (size_t i = 0; i < size ; ++i)
|
for (size_t i = 0; i < size ; ++i)
|
||||||
@ -432,7 +432,7 @@ Var Var::parse(const std::string& val, std::string::size_type& pos)
|
|||||||
}
|
}
|
||||||
else if (ch == '.' || ch == ',')
|
else if (ch == '.' || ch == ',')
|
||||||
{
|
{
|
||||||
separator = ch;
|
frac = ch;
|
||||||
++separators;
|
++separators;
|
||||||
if (separators > 1)
|
if (separators > 1)
|
||||||
return str;
|
return str;
|
||||||
@ -443,17 +443,17 @@ Var Var::parse(const std::string& val, std::string::size_type& pos)
|
|||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (separator && isNumber)
|
if (frac && isNumber)
|
||||||
{
|
{
|
||||||
const double number = NumberParser::parseFloat(str, separator);
|
const double number = NumberParser::parseFloat(str, frac);
|
||||||
return Var(number);
|
return Var(number);
|
||||||
}
|
}
|
||||||
else if (separator == 0 && isNumber && isSigned)
|
else if (frac == 0 && isNumber && isSigned)
|
||||||
{
|
{
|
||||||
const Poco::Int64 number = NumberParser::parse64(str);
|
const Poco::Int64 number = NumberParser::parse64(str);
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
else if (separator == 0 && isNumber && !isSigned)
|
else if (frac == 0 && isNumber && !isSigned)
|
||||||
{
|
{
|
||||||
const Poco::UInt64 number = NumberParser::parseUnsigned64(str);
|
const Poco::UInt64 number = NumberParser::parseUnsigned64(str);
|
||||||
return number;
|
return number;
|
||||||
|
Loading…
Reference in New Issue
Block a user