chore(deprecated): Describe deprecation reasons and alternatives.

This commit is contained in:
Matej Kenda
2025-09-11 09:25:01 +02:00
parent 8249c68885
commit e6f661d313
11 changed files with 24 additions and 18 deletions

View File

@@ -67,7 +67,7 @@ public:
/// Creates the SessionImpl. Opens a connection to the database. /// Creates the SessionImpl. Opens a connection to the database.
/// Throws NotConnectedException if connection was not succesful. /// Throws NotConnectedException if connection was not succesful.
POCO_DEPRECATED("") SessionImpl(const std::string& connect, POCO_DEPRECATED("Use other constructors.") SessionImpl(const std::string& connect,
Poco::Any maxFieldSize = ODBC_MAX_FIELD_SIZE, Poco::Any maxFieldSize = ODBC_MAX_FIELD_SIZE,
bool enforceCapability=false, bool enforceCapability=false,
bool autoBind = true, bool autoBind = true,

View File

@@ -198,9 +198,6 @@ bool SessionImpl::isConnected() const
inline void SessionImpl::setCursorUse(const std::string&, const Poco::Any& value) inline void SessionImpl::setCursorUse(const std::string&, const Poco::Any& value)
{ {
#if POCO_OS == POCO_OS_WINDOWS_NT
#pragma warning (disable : 4995) // ignore marked as deprecated
#endif
int cursorUse = static_cast<int>(Poco::AnyCast<CursorUse>(value)); int cursorUse = static_cast<int>(Poco::AnyCast<CursorUse>(value));
int rc = 0; int rc = 0;
switch (cursorUse) switch (cursorUse)
@@ -217,9 +214,6 @@ inline void SessionImpl::setCursorUse(const std::string&, const Poco::Any& value
default: default:
throw Poco::InvalidArgumentException(Poco::format("SessionImpl::setCursorUse(%d)", cursorUse)); throw Poco::InvalidArgumentException(Poco::format("SessionImpl::setCursorUse(%d)", cursorUse));
} }
#if POCO_OS == POCO_OS_WINDOWS_NT
#pragma warning (default : 4995)
#endif
if (Utility::isError(rc)) if (Utility::isError(rc))
{ {
throw Poco::Data::ODBC::HandleException<SQLHDBC, SQL_HANDLE_DBC>(_db, Poco::format("SessionImpl::setCursorUse(%d)", cursorUse)); throw Poco::Data::ODBC::HandleException<SQLHDBC, SQL_HANDLE_DBC>(_db, Poco::format("SessionImpl::setCursorUse(%d)", cursorUse));

View File

@@ -217,7 +217,7 @@ public:
static const std::string PROP_TABLE; static const std::string PROP_TABLE;
static const std::string PROP_ARCHIVE_TABLE; static const std::string PROP_ARCHIVE_TABLE;
static const std::string PROP_MAX_AGE; static const std::string PROP_MAX_AGE;
POCO_DEPRECATED("") static const std::string PROP_ASYNC; POCO_DEPRECATED("Not used, pending removal.") static const std::string PROP_ASYNC;
static const std::string PROP_TIMEOUT; static const std::string PROP_TIMEOUT;
static const std::string PROP_MIN_BATCH; static const std::string PROP_MIN_BATCH;
static const std::string PROP_MAX_BATCH; static const std::string PROP_MAX_BATCH;

View File

@@ -482,7 +482,6 @@ public:
POCO_DEPRECATED("Use clear() instead") POCO_DEPRECATED("Use clear() instead")
void empty(); void empty();
/// Empties Var. /// Empties Var.
/// This function is deprecated and will be removed.
/// Please use clear(). /// Please use clear().
void clear(); void clear();

View File

@@ -17,8 +17,13 @@
#ifndef Foundation_DynamicAny_INCLUDED #ifndef Foundation_DynamicAny_INCLUDED
#define Foundation_DynamicAny_INCLUDED #define Foundation_DynamicAny_INCLUDED
//@ deprecated
#include "Poco/Dynamic/Var.h" #include "Poco/Dynamic/Var.h"
namespace {
POCO_DEPRECATED("Deprecated header: include Poco/Dynamic/Var.h instead")
constexpr static int dynamicany_hpp_is_deprecated {0xBAD};
constexpr static int please_dont_use_badheader_hpp = dynamicany_hpp_is_deprecated;
}
#endif // Foundation_DynamicAny_INCLUDED #endif // Foundation_DynamicAny_INCLUDED

View File

@@ -17,8 +17,13 @@
#ifndef Foundation_DynamicAnyHolder_INCLUDED #ifndef Foundation_DynamicAnyHolder_INCLUDED
#define Foundation_DynamicAnyHolder_INCLUDED #define Foundation_DynamicAnyHolder_INCLUDED
//@ deprecated
#include "Poco/Dynamic/VarHolder.h" #include "Poco/Dynamic/VarHolder.h"
namespace {
POCO_DEPRECATED("Deprecated header: include Poco/Dynamic/VarHolder.h instead")
constexpr static int dynamicanyholder_hpp_is_deprecated {0xBAD};
constexpr static int please_dont_use_badheader_hpp = dynamicanyholder_hpp_is_deprecated;
}
#endif // Foundation_DynamicAnyHolder_INCLUDED #endif // Foundation_DynamicAnyHolder_INCLUDED

View File

@@ -17,8 +17,12 @@
#ifndef Foundation_DynamicStruct_INCLUDED #ifndef Foundation_DynamicStruct_INCLUDED
#define Foundation_DynamicStruct_INCLUDED #define Foundation_DynamicStruct_INCLUDED
//@ deprecated
#include "Poco/Dynamic/Struct.h" #include "Poco/Dynamic/Struct.h"
namespace {
POCO_DEPRECATED("Deprecated header: include Poco/Dynamic/Struct.h instead")
constexpr static int dynamicstruct_hpp_is_deprecated {0xBAD};
constexpr static int please_dont_use_badheader_hpp = dynamicstruct_hpp_is_deprecated;
}
#endif // Foundation_DynamicStruct_INCLUDED #endif // Foundation_DynamicStruct_INCLUDED

View File

@@ -24,7 +24,7 @@
namespace Poco { namespace Poco {
class POCO_DEPRECATED("") HashStatistic; class POCO_DEPRECATED("Not supported since 2006, use Hash.") HashStatistic;
class Foundation_API HashStatistic class Foundation_API HashStatistic
/// HashStatistic class bundles statistical information on the current state of a HashTable /// HashStatistic class bundles statistical information on the current state of a HashTable

View File

@@ -80,11 +80,11 @@ public:
HTTP_LENGTH_REQUIRED = 411, HTTP_LENGTH_REQUIRED = 411,
HTTP_PRECONDITION_FAILED = 412, HTTP_PRECONDITION_FAILED = 412,
HTTP_REQUEST_ENTITY_TOO_LARGE = 413, HTTP_REQUEST_ENTITY_TOO_LARGE = 413,
HTTP_REQUESTENTITYTOOLARGE POCO_DEPRECATED("") = 413, HTTP_REQUESTENTITYTOOLARGE POCO_DEPRECATED("Use HTTP_REQUEST_ENTITY_TOO_LARGE") = 413,
HTTP_REQUEST_URI_TOO_LONG = 414, HTTP_REQUEST_URI_TOO_LONG = 414,
HTTP_REQUESTURITOOLONG POCO_DEPRECATED("") = 414, HTTP_REQUESTURITOOLONG POCO_DEPRECATED("Use HTTP_REQUEST_URI_TOO_LONG") = 414,
HTTP_UNSUPPORTED_MEDIA_TYPE = 415, HTTP_UNSUPPORTED_MEDIA_TYPE = 415,
HTTP_UNSUPPORTEDMEDIATYPE POCO_DEPRECATED("") = 415, HTTP_UNSUPPORTEDMEDIATYPE POCO_DEPRECATED("Use HTTP_UNSUPPORTED_MEDIA_TYPE") = 415,
HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416, HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
HTTP_EXPECTATION_FAILED = 417, HTTP_EXPECTATION_FAILED = 417,
HTTP_IM_A_TEAPOT = 418, HTTP_IM_A_TEAPOT = 418,

View File

@@ -61,7 +61,7 @@ class Net_API NetworkInterface
{ {
public: public:
using List = std::vector<NetworkInterface>; using List = std::vector<NetworkInterface>;
using NetworkInterfaceList POCO_DEPRECATED("") = List; using NetworkInterfaceList POCO_DEPRECATED("Use NetworkInterface::List") = List;
using Map = std::map<unsigned int, NetworkInterface>; using Map = std::map<unsigned int, NetworkInterface>;
using AddressTuple = Poco::Tuple<IPAddress, IPAddress, IPAddress>; using AddressTuple = Poco::Tuple<IPAddress, IPAddress, IPAddress>;
using AddressList = std::vector<AddressTuple>; using AddressList = std::vector<AddressTuple>;

View File

@@ -96,7 +96,6 @@ public:
std::size_t size() const; std::size_t size() const;
/// Returns the number of sockets monitored. /// Returns the number of sockets monitored.
//@ deprecated
POCO_DEPRECATED("Use size() instead") int count() const; POCO_DEPRECATED("Use size() instead") int count() const;
/// Returns the number of sockets monitored. /// Returns the number of sockets monitored.
/// This method is deprecated. Use size() instead. /// This method is deprecated. Use size() instead.