mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-07 19:44:45 +02:00
fixes for macos/clang
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient
|
||||
SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient
|
||||
INCLUDE += -I/usr/local/include/mysql/ -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include
|
||||
SYSFLAGS += -DTHREADSAFE -DNO_TCL
|
||||
|
||||
|
@@ -64,16 +64,12 @@ public:
|
||||
virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir);
|
||||
/// Binds an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN);
|
||||
/// Binds a long.
|
||||
|
||||
virtual void bind(std::size_t pos, const unsigned long& val, Direction dir = PD_IN);
|
||||
/// Binds an unsigned long.
|
||||
|
||||
#endif // POCO_LONG_IS_64_BIT
|
||||
|
||||
virtual void bind(std::size_t pos, const bool& val, Direction dir);
|
||||
/// Binds a boolean.
|
||||
|
||||
|
@@ -72,13 +72,11 @@ public:
|
||||
virtual bool extract(std::size_t pos, Poco::UInt64& val);
|
||||
/// Extracts an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual bool extract(std::size_t pos, long& val);
|
||||
/// Extracts a long. Returns false if null was received.
|
||||
|
||||
virtual bool extract(std::size_t pos, unsigned long& val);
|
||||
/// Extracts an unsigned long. Returns false if null was received.
|
||||
#endif
|
||||
|
||||
virtual bool extract(std::size_t pos, bool& val);
|
||||
/// Extracts a boolean.
|
||||
@@ -198,7 +196,6 @@ public:
|
||||
virtual bool extract(std::size_t pos, std::list<Poco::UInt64>& val);
|
||||
/// Extracts an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual bool extract(std::size_t pos, std::vector<long>& val);
|
||||
/// Extracts a long vector.
|
||||
|
||||
@@ -207,7 +204,6 @@ public:
|
||||
|
||||
virtual bool extract(std::size_t pos, std::list<long>& val);
|
||||
/// Extracts a long list.
|
||||
#endif
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<bool>& val);
|
||||
/// Extracts a boolean vector.
|
||||
|
@@ -91,8 +91,6 @@ void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
void Binder::bind(std::size_t pos, const long& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
@@ -106,8 +104,6 @@ void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir)
|
||||
realBind(pos, MYSQL_TYPE_LONG, &val, 0, true);
|
||||
}
|
||||
|
||||
#endif // POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const bool& val, Direction dir)
|
||||
{
|
||||
|
@@ -80,7 +80,6 @@ bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
|
||||
@@ -91,7 +90,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, bool& val)
|
||||
@@ -401,7 +399,6 @@ bool Extractor::extract(std::size_t , std::list<Poco::UInt64>& )
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t , std::vector<long>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
@@ -418,7 +415,6 @@ bool Extractor::extract(std::size_t , std::list<long>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<bool>& )
|
||||
|
@@ -9,7 +9,7 @@ include $(POCO_BASE)/build/rules/global
|
||||
INCLUDE += -I./../include -I/usr/local/include/mysql -I/usr/include/mysql/ -I/usr/mysql/include/mysql -I/usr/local/mysql/include
|
||||
|
||||
# Note: linking order is important, do not change it.
|
||||
SYSLIBS += -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -lz -lpthread -ldl
|
||||
SYSLIBS += -L/usr/local/lib -L/usr/local/lib$(LIB64SUFFIX)/mysql -L/usr/lib$(LIB64SUFFIX)/mysql -L/usr/mysql/lib$(LIB64SUFFIX) -L/usr/mysql/lib$(LIB64SUFFIX)/mysql -L/usr/local/mysql/lib$(LIB64SUFFIX) -lmysqlclient -lz -lpthread -ldl
|
||||
|
||||
objects = MySQLTestSuite Driver MySQLTest SQLExecutor
|
||||
|
||||
|
@@ -42,11 +42,11 @@ Poco::SharedPtr<SQLExecutor> MySQLTest::_pExecutor = 0;
|
||||
|
||||
//
|
||||
// Parameters for barebone-test
|
||||
#define MYSQL_USER "root"
|
||||
#define MYSQL_PWD "poco"
|
||||
#define MYSQL_USER "pocotest"
|
||||
#define MYSQL_PWD "pocotest"
|
||||
#define MYSQL_HOST "127.0.0.1"
|
||||
#define MYSQL_PORT 3306
|
||||
#define MYSQL_DB "pocotestdb"
|
||||
#define MYSQL_DB "pocotest"
|
||||
|
||||
//
|
||||
// Connection string
|
||||
|
@@ -65,13 +65,11 @@ public:
|
||||
void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir);
|
||||
/// Binds an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void bind(std::size_t pos, const long &val, Direction dir);
|
||||
/// Binds a long
|
||||
|
||||
void bind(std::size_t pos, const unsigned long &val, Direction dir);
|
||||
/// Binds an unsigned long
|
||||
#endif
|
||||
|
||||
void bind(std::size_t pos, const bool &val, Direction dir);
|
||||
/// Binds a boolean.
|
||||
|
@@ -78,13 +78,11 @@ public:
|
||||
bool extract(std::size_t pos, Poco::UInt64& val);
|
||||
/// Extracts an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool extract(std::size_t pos, long& val);
|
||||
/// Extracts a long.
|
||||
|
||||
bool extract(std::size_t pos, unsigned long& val);
|
||||
/// Extracts an unsigned long.
|
||||
#endif
|
||||
|
||||
bool extract(std::size_t pos, bool& val);
|
||||
/// Extracts a boolean.
|
||||
|
@@ -56,7 +56,6 @@ void Binder::bind(std::size_t pos, const Poco::Int64 &val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void Binder::bind(std::size_t pos, const long &val, Direction dir)
|
||||
{
|
||||
long tmp = static_cast<long>(val);
|
||||
@@ -70,7 +69,6 @@ void Binder::bind(std::size_t pos, const unsigned long &val, Direction dir)
|
||||
int rc = sqlite3_bind_int(_pStmt, (int) pos, tmp);
|
||||
checkReturn(rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const double &val, Direction dir)
|
||||
|
@@ -63,7 +63,6 @@ bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
@@ -78,7 +77,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val)
|
||||
val = sqlite3_column_int(_pStmt, (int) pos);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, double& val)
|
||||
|
@@ -165,7 +165,6 @@ public:
|
||||
virtual void bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir = PD_IN);
|
||||
/// Binds an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN) = 0;
|
||||
/// Binds a long.
|
||||
|
||||
@@ -180,7 +179,6 @@ public:
|
||||
|
||||
virtual void bind(std::size_t pos, const std::list<long>& val, Direction dir = PD_IN);
|
||||
/// Binds a long list.
|
||||
#endif
|
||||
|
||||
virtual void bind(std::size_t pos, const bool& val, Direction dir = PD_IN) = 0;
|
||||
/// Binds a boolean.
|
||||
|
@@ -155,7 +155,6 @@ public:
|
||||
virtual bool extract(std::size_t pos, std::list<Poco::UInt64>& val);
|
||||
/// Extracts an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual bool extract(std::size_t pos, long& val) = 0;
|
||||
/// Extracts a long. Returns false if null was received.
|
||||
|
||||
@@ -170,7 +169,6 @@ public:
|
||||
|
||||
virtual bool extract(std::size_t pos, std::list<long>& val);
|
||||
/// Extracts a long list.
|
||||
#endif
|
||||
|
||||
virtual bool extract(std::size_t pos, bool& val) = 0;
|
||||
/// Extracts a boolean. Returns false if null was received.
|
||||
|
@@ -161,7 +161,6 @@ public:
|
||||
virtual void prepare(std::size_t pos, const std::list<Poco::UInt64>& val);
|
||||
/// Prepares an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual void prepare(std::size_t pos, const long&) = 0;
|
||||
/// Prepares a long.
|
||||
|
||||
@@ -176,7 +175,6 @@ public:
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<long>& val);
|
||||
/// Prepares a long list.
|
||||
#endif
|
||||
|
||||
virtual void prepare(std::size_t pos, const bool&) = 0;
|
||||
/// Prepares a boolean.
|
||||
|
@@ -211,16 +211,14 @@ inline void swap(LOB<T>& b1, LOB<T>& b2)
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1,
|
||||
Poco::Data::BLOB& b2)
|
||||
inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1, Poco::Data::BLOB& b2) noexcept
|
||||
/// Full template specalization of std:::swap for BLOB
|
||||
{
|
||||
b1.swap(b2);
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void swap<Poco::Data::CLOB>(Poco::Data::CLOB& c1,
|
||||
Poco::Data::CLOB& c2)
|
||||
inline void swap<Poco::Data::CLOB>(Poco::Data::CLOB& c1, Poco::Data::CLOB& c2) noexcept
|
||||
/// Full template specalization of std:::swap for CLOB
|
||||
{
|
||||
c1.swap(c2);
|
||||
|
@@ -144,8 +144,7 @@ inline bool RowIterator::operator != (const RowIterator& other) const
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
inline void swap<Poco::Data::RowIterator>(Poco::Data::RowIterator& s1,
|
||||
Poco::Data::RowIterator& s2)
|
||||
inline void swap<Poco::Data::RowIterator>(Poco::Data::RowIterator& s1, Poco::Data::RowIterator& s2) noexcept
|
||||
/// Full template specalization of std:::swap for RowIterator
|
||||
{
|
||||
s1.swap(s2);
|
||||
|
@@ -489,8 +489,7 @@ inline void swap(Session& s1, Session& s2)
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
inline void swap<Poco::Data::Session>(Poco::Data::Session& s1,
|
||||
Poco::Data::Session& s2)
|
||||
inline void swap<Poco::Data::Session>(Poco::Data::Session& s1, Poco::Data::Session& s2) noexcept
|
||||
/// Full template specalization of std:::swap for Session
|
||||
{
|
||||
s1.swap(s2);
|
||||
|
@@ -258,13 +258,12 @@ public:
|
||||
Statement& operator , (Poco::Int32 value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
Statement& operator , (long value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
|
||||
Statement& operator , (unsigned long value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
#endif
|
||||
|
||||
Statement& operator , (Poco::UInt64 value);
|
||||
/// Adds the value to the list of values to be supplied to the SQL string formatting function.
|
||||
|
||||
@@ -573,7 +572,6 @@ inline Statement& Statement::operator , (Poco::Int32 value)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
inline Statement& Statement::operator , (long value)
|
||||
{
|
||||
return commaPODImpl(value);
|
||||
@@ -584,7 +582,6 @@ inline Statement& Statement::operator , (unsigned long value)
|
||||
{
|
||||
return commaPODImpl(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
inline Statement& Statement::operator , (Poco::UInt64 value)
|
||||
@@ -815,8 +812,7 @@ inline void swap(Statement& s1, Statement& s2)
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
inline void swap<Poco::Data::Statement>(Poco::Data::Statement& s1,
|
||||
Poco::Data::Statement& s2)
|
||||
inline void swap<Poco::Data::Statement>(Poco::Data::Statement& s1, Poco::Data::Statement& s2) noexcept
|
||||
/// Full template specalization of std:::swap for Statement
|
||||
{
|
||||
s1.swap(s2);
|
||||
|
@@ -180,7 +180,6 @@ void AbstractBinder::bind(std::size_t pos, const std::list<Poco::UInt64>& val, D
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<long>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::vector binder must be implemented.");
|
||||
@@ -197,7 +196,6 @@ void AbstractBinder::bind(std::size_t pos, const std::list<long>& val, Direction
|
||||
{
|
||||
throw NotImplementedException("std::list binder must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<bool>& val, Direction dir)
|
||||
@@ -464,10 +462,8 @@ void AbstractBinder::bind(std::size_t pos, const Any& val, Direction dir)
|
||||
bind(pos, RefAnyCast<BLOB>(val), dir);
|
||||
else if (type == typeid(void))
|
||||
bind(pos, Keywords::null, dir);
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
else if (type == typeid(long))
|
||||
bind(pos, RefAnyCast<long>(val), dir);
|
||||
#endif
|
||||
else
|
||||
throw UnknownTypeException(std::string(val.type().name()));
|
||||
}
|
||||
@@ -515,10 +511,8 @@ void AbstractBinder::bind(std::size_t pos, const Poco::Dynamic::Var& val, Direct
|
||||
bind(pos, val.extract<BLOB>(), dir);
|
||||
else if (type == typeid(void))
|
||||
bind(pos, Keywords::null, dir);
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
else if (type == typeid(long))
|
||||
bind(pos, val.extract<long>(), dir);
|
||||
#endif
|
||||
else
|
||||
throw UnknownTypeException(std::string(val.type().name()));
|
||||
}
|
||||
|
@@ -174,7 +174,6 @@ bool AbstractExtractor::extract(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
@@ -191,7 +190,6 @@ bool AbstractExtractor::extract(std::size_t pos, std::list<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<bool>& val)
|
||||
|
@@ -175,7 +175,6 @@ void AbstractPreparator::prepare(std::size_t pos, const std::list<Poco::UInt64>&
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
@@ -192,7 +191,6 @@ void AbstractPreparator::prepare(std::size_t pos, const std::list<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<bool>& val)
|
||||
|
@@ -68,7 +68,6 @@ void Binder::bind(std::size_t pos, const Poco::UInt64 &val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void Binder::bind(std::size_t pos, const long& val, Direction dir)
|
||||
{
|
||||
}
|
||||
@@ -77,7 +76,6 @@ void Binder::bind(std::size_t pos, const long& val, Direction dir)
|
||||
void Binder::bind(std::size_t pos, const unsigned long& val, Direction dir)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const bool &val, Direction dir)
|
||||
|
@@ -56,13 +56,11 @@ public:
|
||||
void bind(std::size_t pos, const Poco::UInt64 &val, Direction dir);
|
||||
/// Binds an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void bind(std::size_t pos, const long& val, Direction dir);
|
||||
/// Binds a long.
|
||||
|
||||
void bind(std::size_t pos, const unsigned long& val, Direction dir);
|
||||
/// Binds an unsigned long.
|
||||
#endif
|
||||
|
||||
void bind(std::size_t pos, const bool &val, Direction dir);
|
||||
/// Binds a boolean.
|
||||
|
@@ -77,7 +77,6 @@ bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
{
|
||||
val = 0;
|
||||
@@ -90,7 +89,6 @@ bool Extractor::extract(std::size_t pos, unsigned long& val)
|
||||
val = 0;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
|
@@ -62,13 +62,11 @@ public:
|
||||
bool extract(std::size_t pos, Poco::Dynamic::Var& val);
|
||||
/// Extracts a Var.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool extract(std::size_t pos, long& val);
|
||||
/// Extracts a long.
|
||||
|
||||
bool extract(std::size_t pos, unsigned long& val);
|
||||
/// Extracts an unsigned long.
|
||||
#endif
|
||||
|
||||
bool extract(std::size_t pos, bool& val);
|
||||
/// Extracts a boolean.
|
||||
|
@@ -68,7 +68,6 @@ void Preparator::prepare(std::size_t pos, const Poco::UInt64&)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void Preparator::prepare(std::size_t pos, const long&)
|
||||
{
|
||||
}
|
||||
@@ -77,7 +76,6 @@ void Preparator::prepare(std::size_t pos, const long&)
|
||||
void Preparator::prepare(std::size_t pos, const unsigned long&)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const bool&)
|
||||
|
@@ -57,13 +57,11 @@ public:
|
||||
void prepare(std::size_t pos, const Poco::UInt64&);
|
||||
/// Prepares an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void prepare(std::size_t pos, const long&);
|
||||
/// Prepares a long.
|
||||
|
||||
void prepare(std::size_t pos, const unsigned long&);
|
||||
/// Prepares an unsigned long.
|
||||
#endif
|
||||
|
||||
void prepare(std::size_t pos, const bool&);
|
||||
/// Prepares a boolean.
|
||||
|
@@ -75,7 +75,7 @@ public:
|
||||
BinaryReader& operator >> (float& value);
|
||||
BinaryReader& operator >> (double& value);
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
BinaryReader& operator >> (Int64& value);
|
||||
BinaryReader& operator >> (UInt64& value);
|
||||
#endif
|
||||
|
@@ -80,7 +80,7 @@ public:
|
||||
BinaryWriter& operator << (float value);
|
||||
BinaryWriter& operator << (double value);
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
BinaryWriter& operator << (Int64 value);
|
||||
BinaryWriter& operator << (UInt64 value);
|
||||
#endif
|
||||
|
@@ -2123,9 +2123,6 @@ inline bool operator != (const char* other, const Var& da)
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
inline long operator + (const long& other, const Var& da)
|
||||
/// Addition operator for adding Var to long
|
||||
{
|
||||
@@ -2334,9 +2331,6 @@ inline bool operator >= (const unsigned long& other, const Var& da)
|
||||
}
|
||||
|
||||
|
||||
#endif // POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
} // namespace Dynamic
|
||||
|
||||
|
||||
|
@@ -178,26 +178,12 @@ public:
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long& val) const;
|
||||
/// Calls convert(Int32).
|
||||
|
||||
void convert(unsigned long& val) const;
|
||||
/// Calls convert(UInt32).
|
||||
|
||||
#else
|
||||
|
||||
virtual void convert(long long& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// specialization in order to suport the conversion.
|
||||
|
||||
virtual void convert(unsigned long long & val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// specialization in order to suport the conversion.
|
||||
|
||||
#endif
|
||||
|
||||
virtual void convert(bool& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
@@ -519,7 +505,6 @@ inline void VarHolder::convert(Timestamp& /*val*/) const
|
||||
throw BadCastException("Can not convert to Timestamp");
|
||||
}
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
inline void VarHolder::convert(long& val) const
|
||||
{
|
||||
@@ -536,20 +521,6 @@ inline void VarHolder::convert(unsigned long& val) const
|
||||
val = tmp;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline void VarHolder::convert(long long& /*val*/) const
|
||||
{
|
||||
throw BadCastException("Can not convert to long long");
|
||||
}
|
||||
|
||||
|
||||
inline void VarHolder::convert(unsigned long long& /*val*/) const
|
||||
{
|
||||
throw BadCastException("Can not convert to unsigned long long");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline void VarHolder::convert(bool& /*val*/) const
|
||||
{
|
||||
@@ -788,20 +759,6 @@ public:
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -944,20 +901,6 @@ public:
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1098,20 +1041,6 @@ public:
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1250,20 +1179,6 @@ public:
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1417,20 +1332,6 @@ public:
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = static_cast<long long>(_val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1569,20 +1470,6 @@ public:
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = static_cast<long long>(_val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1721,20 +1608,6 @@ public:
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -1873,20 +1746,6 @@ public:
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
@@ -2046,20 +1905,6 @@ public:
|
||||
val = static_cast<UInt64>(_val ? 1 : 0);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = static_cast<long long>(_val ? 1 : 0);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = static_cast<unsigned long long>(_val ? 1 : 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = _val;
|
||||
@@ -2196,20 +2041,6 @@ public:
|
||||
convertSignedFloatToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
convertToSmaller(_val, val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedFloatToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = !(_val <= std::numeric_limits<float>::min() &&
|
||||
@@ -2349,20 +2180,6 @@ public:
|
||||
convertSignedFloatToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
convertToSmaller(_val, val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedFloatToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = !(_val <= std::numeric_limits<double>::min() &&
|
||||
@@ -2508,20 +2325,6 @@ public:
|
||||
val = static_cast<UInt8>(_val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = static_cast<long long>(_val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = static_cast<unsigned long long>(_val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != '\0');
|
||||
@@ -2666,20 +2469,6 @@ public:
|
||||
val = NumberParser::parseUnsigned64(_val);
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = NumberParser::parse64(_val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = NumberParser::parseUnsigned64(_val);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
if (_val.empty())
|
||||
@@ -2858,20 +2647,6 @@ public:
|
||||
val = NumberParser::parseUnsigned64(toStdString());
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = NumberParser::parse64(toStdString());
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = NumberParser::parseUnsigned64(toStdString());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
static const std::string VAL_FALSE("false");
|
||||
@@ -2995,9 +2770,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<long>: public VarHolder
|
||||
{
|
||||
@@ -3274,308 +3046,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#else // if defined (POCO_LONG_IS_64_BIT)
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<long long>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(long long val): _val(val)
|
||||
{
|
||||
}
|
||||
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(long long);
|
||||
}
|
||||
|
||||
void convert(Int8& val) const
|
||||
{
|
||||
convertToSmaller(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int16& val) const
|
||||
{
|
||||
convertToSmaller(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int32& val) const
|
||||
{
|
||||
convertToSmaller(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int64& val) const
|
||||
{
|
||||
val = static_cast<Int64>(_val);
|
||||
}
|
||||
|
||||
void convert(UInt8& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt16& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt32& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt64& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
convertSignedToUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
}
|
||||
|
||||
void convert(float& val) const
|
||||
{
|
||||
val = static_cast<float>(_val);
|
||||
}
|
||||
|
||||
void convert(double& val) const
|
||||
{
|
||||
val = static_cast<double>(_val);
|
||||
}
|
||||
|
||||
void convert(char& val) const
|
||||
{
|
||||
UInt8 tmp;
|
||||
convert(tmp);
|
||||
val = static_cast<char>(tmp);
|
||||
}
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = NumberFormatter::format(_val);
|
||||
}
|
||||
|
||||
VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
const long long& value() const
|
||||
{
|
||||
return _val;
|
||||
}
|
||||
|
||||
bool isArray() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isStruct() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isInteger() const
|
||||
{
|
||||
return std::numeric_limits<long long>::is_integer;
|
||||
}
|
||||
|
||||
bool isSigned() const
|
||||
{
|
||||
return std::numeric_limits<long long>::is_signed;
|
||||
}
|
||||
|
||||
bool isNumeric() const
|
||||
{
|
||||
return std::numeric_limits<long long>::is_specialized;
|
||||
}
|
||||
|
||||
bool isBoolean() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isString() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
VarHolderImpl& operator = (const VarHolderImpl&);
|
||||
|
||||
long long _val;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<unsigned long long>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(unsigned long long val): _val(val)
|
||||
{
|
||||
}
|
||||
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(unsigned long long);
|
||||
}
|
||||
|
||||
void convert(Int8& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int16& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int32& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(Int64& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt8& val) const
|
||||
{
|
||||
convertToSmallerUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt16& val) const
|
||||
{
|
||||
convertToSmallerUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt32& val) const
|
||||
{
|
||||
convertToSmallerUnsigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(UInt64& val) const
|
||||
{
|
||||
val = static_cast<UInt64>(_val);
|
||||
}
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
convertUnsignedToSigned(_val, val);
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val;
|
||||
}
|
||||
|
||||
void convert(bool& val) const
|
||||
{
|
||||
val = (_val != 0);
|
||||
}
|
||||
|
||||
void convert(float& val) const
|
||||
{
|
||||
val = static_cast<float>(_val);
|
||||
}
|
||||
|
||||
void convert(double& val) const
|
||||
{
|
||||
val = static_cast<double>(_val);
|
||||
}
|
||||
|
||||
void convert(char& val) const
|
||||
{
|
||||
UInt8 tmp;
|
||||
convert(tmp);
|
||||
val = static_cast<char>(tmp);
|
||||
}
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = NumberFormatter::format(_val);
|
||||
}
|
||||
|
||||
VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
const unsigned long long& value() const
|
||||
{
|
||||
return _val;
|
||||
}
|
||||
|
||||
bool isArray() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isStruct() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isInteger() const
|
||||
{
|
||||
return std::numeric_limits<unsigned long long>::is_integer;
|
||||
}
|
||||
|
||||
bool isSigned() const
|
||||
{
|
||||
return std::numeric_limits<unsigned long long>::is_signed;
|
||||
}
|
||||
|
||||
bool isNumeric() const
|
||||
{
|
||||
return std::numeric_limits<unsigned long long>::is_specialized;
|
||||
}
|
||||
|
||||
bool isBoolean() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isString() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
VarHolderImpl& operator = (const VarHolderImpl&);
|
||||
|
||||
unsigned long long _val;
|
||||
};
|
||||
|
||||
|
||||
#endif // 64bit
|
||||
|
||||
|
||||
template <typename T>
|
||||
class VarHolderImpl<std::vector<T>>: public VarHolder
|
||||
{
|
||||
@@ -3823,20 +3293,6 @@ public:
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
|
||||
@@ -3953,20 +3409,6 @@ public:
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val.timestamp().epochMicroseconds();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
|
||||
@@ -4083,20 +3525,6 @@ public:
|
||||
val = _val.epochMicroseconds();
|
||||
}
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
void convert(long long& val) const
|
||||
{
|
||||
val = _val.epochMicroseconds();
|
||||
}
|
||||
|
||||
void convert(unsigned long long& val) const
|
||||
{
|
||||
val = _val.epochMicroseconds();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = DateTimeFormatter::format(_val, Poco::DateTimeFormat::ISO8601_FORMAT);
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
_isNull(other._isNull),
|
||||
_null()
|
||||
{
|
||||
other.isNull = true;
|
||||
other._isNull = true;
|
||||
}
|
||||
|
||||
~Nullable()
|
||||
|
@@ -152,58 +152,6 @@ public:
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
static std::string format(long long value);
|
||||
/// Formats a 64-bit integer value in decimal notation.
|
||||
|
||||
static std::string format(long long value, int width);
|
||||
/// Formats a 64-bit integer value in decimal notation,
|
||||
/// right justified in a field having at least the specified width.
|
||||
|
||||
static std::string format0(long long value, int width);
|
||||
/// Formats a 64-bit integer value in decimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
|
||||
static std::string formatHex(long long value, bool prefix = false);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation.
|
||||
/// If prefix is true, "0x" prefix is prepended to the
|
||||
/// resulting string.
|
||||
/// The value is treated as unsigned.
|
||||
|
||||
static std::string formatHex(long long value, int width, bool prefix = false);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
/// The value is treated as unsigned.
|
||||
/// If prefix is true, "0x" prefix is prepended to the resulting string.
|
||||
|
||||
static std::string format(unsigned long long value);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation.
|
||||
|
||||
static std::string format(unsigned long long value, int width);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation,
|
||||
/// right justified in a field having at least the specified width.
|
||||
|
||||
static std::string format0(unsigned long long value, int width);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation,
|
||||
/// right justified and zero-padded in a field having at least the
|
||||
/// specified width.
|
||||
|
||||
static std::string formatHex(unsigned long long value, bool prefix = false);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation.
|
||||
/// If prefix is true, "0x" prefix is prepended to the
|
||||
/// resulting string.
|
||||
|
||||
static std::string formatHex(unsigned long long value, int width, bool prefix = false);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width. If prefix is true, "0x" prefix is
|
||||
/// prepended to the resulting string.
|
||||
|
||||
#else // ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
static std::string format(Int64 value);
|
||||
/// Formats a 64-bit integer value in decimal notation.
|
||||
|
||||
@@ -252,8 +200,6 @@ public:
|
||||
/// the specified width. If prefix is true, "0x" prefix is
|
||||
/// prepended to the resulting string.
|
||||
|
||||
#endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
static std::string format(float value);
|
||||
@@ -381,52 +327,6 @@ public:
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
static void append(std::string& str, long long value);
|
||||
/// Formats a 64-bit integer value in decimal notation.
|
||||
|
||||
static void append(std::string& str, long long value, int width);
|
||||
/// Formats a 64-bit integer value in decimal notation,
|
||||
/// right justified in a field having at least the specified width.
|
||||
|
||||
static void append0(std::string& str, long long value, int width);
|
||||
/// Formats a 64-bit integer value in decimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
|
||||
static void appendHex(std::string& str, long long value);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation.
|
||||
/// The value is treated as unsigned.
|
||||
|
||||
static void appendHex(std::string& str, long long value, int width);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
/// The value is treated as unsigned.
|
||||
|
||||
static void append(std::string& str, unsigned long long value);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation.
|
||||
|
||||
static void append(std::string& str, unsigned long long value, int width);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation,
|
||||
/// right justified in a field having at least the specified width.
|
||||
|
||||
static void append0(std::string& str, unsigned long long value, int width);
|
||||
/// Formats an unsigned 64-bit integer value in decimal notation,
|
||||
/// right justified and zero-padded in a field having at least the
|
||||
/// specified width.
|
||||
|
||||
static void appendHex(std::string& str, unsigned long long value);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation.
|
||||
|
||||
static void appendHex(std::string& str, unsigned long long value, int width);
|
||||
/// Formats a 64-bit integer value in hexadecimal notation,
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
|
||||
#else // ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
static void append(std::string& str, Int64 value);
|
||||
/// Formats a 64-bit integer value in decimal notation.
|
||||
|
||||
@@ -469,8 +369,6 @@ public:
|
||||
/// right justified and zero-padded in a field having at least
|
||||
/// the specified width.
|
||||
|
||||
#endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
static void append(std::string& str, float value);
|
||||
@@ -674,91 +572,6 @@ inline std::string NumberFormatter::formatHex(unsigned long value, int width, bo
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(long long value)
|
||||
{
|
||||
std::string result;
|
||||
intToStr(value, 10, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(long long value, int width)
|
||||
{
|
||||
std::string result;
|
||||
intToStr(value, 10, result, false, width, ' ');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format0(long long value, int width)
|
||||
{
|
||||
std::string result;
|
||||
intToStr(value, 10, result, false, width, '0');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::formatHex(long long value, bool prefix)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, prefix);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::formatHex(long long value, int width, bool prefix)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, prefix, width, '0');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(unsigned long long value)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(value, 10, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(unsigned long long value, int width)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(value, 10, result, false, width, ' ');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format0(unsigned long long value, int width)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(value, 10, result, false, width, '0');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::formatHex(unsigned long long value, bool prefix)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(value, 0x10, result, prefix);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
inline std::string NumberFormatter::formatHex(unsigned long long value, int width, bool prefix)
|
||||
{
|
||||
std::string result;
|
||||
uIntToStr(value, 0x10, result, prefix, width, '0');
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#else // ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(Int64 value)
|
||||
{
|
||||
@@ -840,8 +653,6 @@ inline std::string NumberFormatter::formatHex(UInt64 value, int width, bool pref
|
||||
}
|
||||
|
||||
|
||||
#endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
|
||||
|
@@ -34,10 +34,8 @@
|
||||
#include <locale>
|
||||
#endif
|
||||
|
||||
#ifndef uintmax_t
|
||||
#if defined(POCO_NOINTMAX)
|
||||
typedef Poco::UInt64 uintmax_t;
|
||||
#endif
|
||||
#ifndef intmax_t
|
||||
typedef Poco::Int64 intmax_t;
|
||||
#endif
|
||||
#if !defined (INTMAX_MAX)
|
||||
|
@@ -170,7 +170,7 @@ BinaryReader& BinaryReader::operator >> (double& value)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
BinaryReader& BinaryReader::operator >> (Int64& value)
|
||||
|
@@ -212,7 +212,7 @@ BinaryWriter& BinaryWriter::operator << (double value)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
|
||||
|
||||
BinaryWriter& BinaryWriter::operator << (Int64 value)
|
||||
|
@@ -236,101 +236,6 @@ void NumberFormatter::appendHex(std::string& str, unsigned long value, int width
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
#ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append0(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
intToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(static_cast<unsigned long long>(value), 0x10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, unsigned long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::append0(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, unsigned long long value)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 0x10, result, sz);
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
void NumberFormatter::appendHex(std::string& str, unsigned long long value, int width)
|
||||
{
|
||||
char result[NF_MAX_INT_STRING_LEN];
|
||||
std::size_t sz = NF_MAX_INT_STRING_LEN;
|
||||
uIntToStr(value, 0x10, result, sz, false, width, '0');
|
||||
str.append(result, sz);
|
||||
}
|
||||
|
||||
|
||||
#else // ifndef POCO_LONG_IS_64_BIT
|
||||
|
||||
|
||||
void NumberFormatter::append(std::string& str, Int64 value)
|
||||
{
|
||||
@@ -422,8 +327,6 @@ void NumberFormatter::appendHex(std::string& str, UInt64 value, int width)
|
||||
}
|
||||
|
||||
|
||||
#endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
|
||||
|
@@ -1077,8 +1077,8 @@ std::string Path::transcode(const std::string& path)
|
||||
return std::string(buffer.begin(), buffer.size());
|
||||
}
|
||||
}
|
||||
return path;
|
||||
#endif
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -70,7 +70,7 @@ void ChannelTest::testSplitter()
|
||||
void ChannelTest::testAsync()
|
||||
{
|
||||
AutoPtr<TestChannel> pChannel = new TestChannel;
|
||||
AutoPtr<AsyncChannel> pAsync = new AsyncChannel(pChannel.get());
|
||||
AutoPtr<AsyncChannel> pAsync = new AsyncChannel(pChannel);
|
||||
pAsync->open();
|
||||
Message msg;
|
||||
pAsync->log(msg);
|
||||
@@ -84,7 +84,7 @@ void ChannelTest::testFormatting()
|
||||
{
|
||||
AutoPtr<TestChannel> pChannel = new TestChannel;
|
||||
AutoPtr<Formatter> pFormatter = new SimpleFormatter;
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel);
|
||||
Message msg("Source", "Text", Message::PRIO_INFORMATION);
|
||||
pFormatterChannel->log(msg);
|
||||
assertTrue (pChannel->list().size() == 1);
|
||||
@@ -96,7 +96,7 @@ void ChannelTest::testConsole()
|
||||
{
|
||||
AutoPtr<ConsoleChannel> pChannel = new ConsoleChannel;
|
||||
AutoPtr<Formatter> pFormatter = new SimpleFormatter;
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel);
|
||||
Message msg("Source", "Text", Message::PRIO_INFORMATION);
|
||||
pFormatterChannel->log(msg);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void ChannelTest::testStream()
|
||||
std::ostringstream str;
|
||||
AutoPtr<StreamChannel> pChannel = new StreamChannel(str);
|
||||
AutoPtr<Formatter> pFormatter = new SimpleFormatter;
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel.get());
|
||||
AutoPtr<FormattingChannel> pFormatterChannel = new FormattingChannel(pFormatter, pChannel);
|
||||
Message msg("Source", "Text", Message::PRIO_INFORMATION);
|
||||
pFormatterChannel->log(msg);
|
||||
assertTrue (str.str().find("Source: Text") == 0);
|
||||
|
@@ -233,23 +233,23 @@ void JSONTest::testNumber64Property()
|
||||
Var test = object.get("test");
|
||||
assertTrue (test.isInteger());
|
||||
Poco::Int64 value = test;
|
||||
assertTrue (value == -5000000000000000);
|
||||
assertTrue (value == -5000000000000000ll);
|
||||
|
||||
DynamicStruct ds = object;
|
||||
assertTrue (!ds["test"].isEmpty());
|
||||
assertTrue (ds["test"].isNumeric());
|
||||
assertTrue (ds["test"].isInteger());
|
||||
assertTrue (ds["test"] == -5000000000000000);
|
||||
assertTrue (ds["test"] == -5000000000000000ll);
|
||||
value = ds["test"];
|
||||
assertTrue (value == -5000000000000000);
|
||||
assertTrue (value == -5000000000000000ll);
|
||||
|
||||
const DynamicStruct& rds = object;
|
||||
assertTrue (!rds["test"].isEmpty());
|
||||
assertTrue (rds["test"].isNumeric());
|
||||
assertTrue (rds["test"].isInteger());
|
||||
assertTrue (rds["test"] == -5000000000000000);
|
||||
assertTrue (rds["test"] == -5000000000000000ll);
|
||||
value = rds["test"];
|
||||
assertTrue (value == -5000000000000000);
|
||||
assertTrue (value == -5000000000000000ll);
|
||||
}
|
||||
|
||||
|
||||
@@ -277,12 +277,11 @@ void JSONTest::testUnsignedNumber64Property()
|
||||
assertTrue (test.isInteger());
|
||||
Poco::UInt64 value = test;
|
||||
assertTrue (value == -1);
|
||||
/* TODO: clang has trouble here
|
||||
DynamicStruct ds = *object;
|
||||
assertTrue (!ds["test"].isEmpty());
|
||||
assertTrue (ds["test"].isNumeric());
|
||||
assertTrue (ds["test"].isInteger());
|
||||
assertTrue (ds["test"] == 18446744073709551615);
|
||||
assertTrue (ds["test"] == 18446744073709551615ull);
|
||||
value = ds["test"];
|
||||
assertTrue (value == -1);
|
||||
|
||||
@@ -290,10 +289,9 @@ void JSONTest::testUnsignedNumber64Property()
|
||||
assertTrue (!rds["test"].isEmpty());
|
||||
assertTrue (rds["test"].isNumeric());
|
||||
assertTrue (rds["test"].isInteger());
|
||||
assertTrue (rds["test"] == 18446744073709551615);
|
||||
assertTrue (rds["test"] == 18446744073709551615ull);
|
||||
value = rds["test"];
|
||||
assertTrue (value == -1);
|
||||
*/
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -696,7 +696,7 @@ void ServerApplication::handleUMask(const std::string& name, const std::string&
|
||||
for (const auto ch: value)
|
||||
{
|
||||
mask *= 8;
|
||||
if (*it >= '0' && ch <= '7')
|
||||
if (ch >= '0' && ch <= '7')
|
||||
mask += ch - '0';
|
||||
else
|
||||
throw Poco::InvalidArgumentException("umask contains non-octal characters", value);
|
||||
|
Reference in New Issue
Block a user