本文整理汇总了C++中Poco::decimalSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ Poco::decimalSeparator方法的具体用法?C++ Poco::decimalSeparator怎么用?C++ Poco::decimalSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poco
的用法示例。
在下文中一共展示了Poco::decimalSeparator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testParseError
void NumberParserTest::testParseError()
{
char dp = decimalSeparator();
if (dp == 0) dp = '.';
char ts = thousandSeparator();
if (ts == 0) ts = ',';
assert (dp != ts);
try
{
NumberParser::parse("");
NumberParser::parseBool("");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parse(" ");
NumberParser::parseBool("");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parse("1 1");
NumberParser::parseBool("");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parse("asd");
NumberParser::parseBool("asd");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseUnsigned("a123");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex("z23");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex("23z");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
#if defined(POCO_HAVE_INT64)
try
{
NumberParser::parse64("asd");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseUnsigned64("");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex64("zaz");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex64("12345z");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex64(format("123%c45", ts));
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
#endif // POCO_HAVE_INT64
#ifndef POCO_NO_FPENVIRONMENT
try
{
NumberParser::parseFloat(format("a12%c3", dp));
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
#endif // POCO_NO_FPENVIRONMENT
}