Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions ActiveRecord/include/Poco/ActiveRecord/ActiveRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ActiveRecordLib_API ActiveRecordBase: public Poco::RefCountedObject
public:
using Ptr = Poco::AutoPtr<ActiveRecordBase>;

[[nodiscard]]
virtual std::string toString() const = 0;
/// Returns a string representation of the object for
/// debugging purposes. The default implementation returns the ID.
Expand All @@ -59,14 +60,17 @@ class ActiveRecordLib_API ActiveRecordBase: public Poco::RefCountedObject
void detach();
/// Detaches the object from its Context.

[[nodiscard]]
Context::Ptr context() const;
/// Returns the Context this object is attached to,
/// or a null pointer if the object has not been
/// attached to a Context.

[[nodiscard]]
virtual bool isValid() const;
/// Returns true iff the object is valid ID, otherwise false.

[[nodiscard]]
bool isAttached() const;
/// Returns true iff the object has been attached to a Context, otherwise false.

Expand Down
2 changes: 2 additions & 0 deletions ActiveRecord/include/Poco/ActiveRecord/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class ActiveRecordLib_API Context: public Poco::RefCountedObject
~Context() = default;
/// Destroys the Context.

[[nodiscard]]
Poco::Data::Session& session();
/// Returns the database session.

[[nodiscard]]
StatementPlaceholderProvider::Ptr statementPlaceholderProvider() const;
/// Returns a new StatementPlaceholderProvider.

Expand Down
16 changes: 16 additions & 0 deletions ActiveRecord/include/Poco/ActiveRecord/IDTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ class IDTraits<Poco::UInt64>
public:
static constexpr Poco::UInt64 INVALID_ID = std::numeric_limits<Poco::UInt64>::max();

[[nodiscard]]
static bool isValid(Poco::UInt64 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::UInt64 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -57,11 +59,13 @@ class IDTraits<Poco::Int64>
public:
static constexpr Poco::Int64 INVALID_ID = std::numeric_limits<Poco::Int64>::max();

[[nodiscard]]
static bool isValid(Poco::Int64 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::Int64 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -75,11 +79,13 @@ class IDTraits<Poco::UInt32>
public:
static constexpr Poco::UInt32 INVALID_ID = std::numeric_limits<Poco::UInt32>::max();

[[nodiscard]]
static bool isValid(Poco::UInt32 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::UInt32 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -93,11 +99,13 @@ class IDTraits<Poco::Int32>
public:
static const Poco::Int32 INVALID_ID = std::numeric_limits<Poco::Int32>::max();

[[nodiscard]]
static bool isValid(Poco::Int32 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::Int32 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -111,11 +119,13 @@ class IDTraits<Poco::UInt16>
public:
static constexpr Poco::UInt16 INVALID_ID = std::numeric_limits<Poco::UInt16>::max();

[[nodiscard]]
static bool isValid(Poco::UInt16 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::UInt16 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -129,11 +139,13 @@ class IDTraits<Poco::Int16>
public:
static constexpr Poco::Int16 INVALID_ID = std::numeric_limits<Poco::Int16>::max();

[[nodiscard]]
static bool isValid(Poco::Int16 id)
{
return id != INVALID_ID;
}

[[nodiscard]]
static std::string toString(Poco::Int16 id)
{
return Poco::NumberFormatter::format(id);
Expand All @@ -147,11 +159,13 @@ class IDTraits<std::string>
public:
static ActiveRecordLib_API const std::string INVALID_ID;

[[nodiscard]]
static bool isValid(const std::string& id)
{
return !id.empty();
}

[[nodiscard]]
static std::string toString(const std::string& id)
{
return id;
Expand All @@ -165,11 +179,13 @@ class IDTraits<Poco::UUID>
public:
static ActiveRecordLib_API const Poco::UUID INVALID_ID;

[[nodiscard]]
static bool isValid(const Poco::UUID& id)
{
return !id.isNull();
}

[[nodiscard]]
static std::string toString(const Poco::UUID& id)
{
return id.toString();
Expand Down
2 changes: 2 additions & 0 deletions ActiveRecord/include/Poco/ActiveRecord/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Query
return *this;
}

[[nodiscard]]
std::vector<typename ActRec::Ptr> execute()
/// Execute the query and return a vector with the
/// results.
Expand Down Expand Up @@ -147,6 +148,7 @@ class Query
return result;
}

[[nodiscard]]
std::size_t totalResults() const
/// In case of a paged query, returns the total number of results
/// that would be returned without paging.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class ActiveRecordLib_API StatementPlaceholderProvider
using Ptr = std::unique_ptr<StatementPlaceholderProvider>;

virtual void reset() = 0;

[[nodiscard]]
virtual std::string next() = 0;

virtual ~StatementPlaceholderProvider();
Expand All @@ -40,6 +42,8 @@ class ActiveRecordLib_API DefaultStatementPlaceholderProvider: public StatementP
{
public:
void reset();

[[nodiscard]]
std::string next();
};

Expand All @@ -48,6 +52,8 @@ class ActiveRecordLib_API PostgresStatementPlaceholderProvider: public Statement
{
public:
void reset();

[[nodiscard]]
std::string next();

private:
Expand Down
2 changes: 2 additions & 0 deletions ApacheConnector/include/ApacheApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class ApacheApplication: public Poco::Util::Application
/// Initializes the application if called for the first
/// time; does nothing in later calls.

[[nodiscard]]
ApacheRequestHandlerFactory& factory();
/// Returns the ApacheRequestHandlerFactory.

[[nodiscard]]
static ApacheApplication& instance();
/// Returns the application instance.

Expand Down
2 changes: 2 additions & 0 deletions ApacheConnector/include/ApacheConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ApacheRequestRec
ApacheRequestRec(request_rec* _pRec);
/// Creates the ApacheRequestRec;

[[nodiscard]]
bool haveRequestBody();
/// Returns true if the request contains a body.

Expand Down Expand Up @@ -56,6 +57,7 @@ class ApacheRequestRec
/// Copies the request uri and header fields from the Apache request
/// to the ApacheServerRequest.

[[nodiscard]]
bool secure();
/// Returns true if the request is using a secure
/// connection. Returns false if no secure connection
Expand Down
2 changes: 2 additions & 0 deletions ApacheConnector/include/ApacheRequestHandlerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ class ApacheRequestHandlerFactory: public Poco::Net::HTTPRequestHandlerFactory
~ApacheRequestHandlerFactory();
/// Destructor of the ApacheRequestHandlerFactory

[[nodiscard]]
Poco::Net::HTTPRequestHandler* createRequestHandler(const Poco::Net::HTTPServerRequest& request);
/// Creates a new request handler for the given HTTP request.

[[nodiscard]]
bool mustHandle(const std::string& uri);
/// Returns 1 if the given uri must be handled by the
/// poco_mapper module, 0 otherwise.
Expand Down
7 changes: 7 additions & 0 deletions ApacheConnector/include/ApacheServerRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,36 @@ class ApacheServerRequest: public Poco::Net::HTTPServerRequest
~ApacheServerRequest();
/// Destroys the ApacheServerRequest.

[[nodiscard]]
std::istream& stream();
/// Returns the input stream for reading
/// the request body.
///
/// The stream is valid until the HTTPServerRequest
/// object is destroyed.

[[nodiscard]]
bool expectContinue() const;
/// Returns true if the client expects a
/// 100 Continue response.

[[nodiscard]]
const Poco::Net::SocketAddress& clientAddress() const;
/// Returns the client's address.

[[nodiscard]]
const Poco::Net::SocketAddress& serverAddress() const;
/// Returns the server's address.

[[nodiscard]]
const Poco::Net::HTTPServerParams& serverParams() const;
/// Returns a reference to the server parameters.

[[nodiscard]]
Poco::Net::HTTPServerResponse& response() const;
/// Returns a reference to the associated response

[[nodiscard]]
bool secure() const;
/// Returns true if the request is using a secure
/// connection. Returns false if no secure connection
Expand Down
1 change: 1 addition & 0 deletions ApacheConnector/include/ApacheServerResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class ApacheServerResponse: public Poco::Net::HTTPServerResponse
/// and sets the "WWW-Authenticate" header field
/// according to the given realm.

[[nodiscard]]
bool sent() const;
/// Returns true if the response (header) has been sent.

Expand Down
1 change: 1 addition & 0 deletions ApacheConnector/include/ApacheStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class ApacheIOS: public virtual std::ios
///
/// Flushes the buffer, but does not close the socket.

[[nodiscard]]
ApacheStreamBuf* rdbuf();
/// Returns a pointer to the internal ApacheStreamBuf.

Expand Down
12 changes: 12 additions & 0 deletions CppParser/include/Poco/CppParser/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,43 @@ class CppParser_API Attributes
Attributes& operator = (const Attributes& attrs);
/// Assignment operator.

[[nodiscard]]
bool has(const std::string& name) const;
/// Returns true if an attribute with the given name exists.

[[nodiscard]]
std::string getString(const std::string& name) const;
/// Returns the attribute's value as a string.
///
/// Throws a Poco::NotFoundException if the attribute does not exist.

[[nodiscard]]
std::string getString(const std::string& name, const std::string& defaultValue) const;
/// Returns the attribute's value as a string, if it exists.
/// Returns the defaultValue if the attribute does not exist.

[[nodiscard]]
int getInt(const std::string& name) const;
/// Returns the attribute's value as an integer.
///
/// Throws a Poco::NotFoundException if the attribute does not exist.
/// Throws a Poco::SyntaxException if the stored value is not an integer.

[[nodiscard]]
int getInt(const std::string& name, int defaultValue) const;
/// Returns the attribute's value as an integer, if it exists.
/// Returns the defaultValue if the attribute does not exist.
///
/// Throws a Poco::SyntaxException if the stored value is not an integer.

[[nodiscard]]
bool getBool(const std::string& name) const;
/// Returns the attribute's value as a boolean.
/// The returned value is 'true', iff the stored value is not "false".
///
/// Throws a Poco::NotFoundException if the attribute does not exist.

[[nodiscard]]
bool getBool(const std::string& name, bool defaultValue) const;
/// Returns the attribute's value as a boolean, if it exists.
/// The returned value is 'true', iff the stored value is not "false".
Expand All @@ -87,10 +94,15 @@ class CppParser_API Attributes
/// Removes the attribute with the given name.
/// Does nothing if the attribute does not exist.

[[nodiscard]]
const std::string& operator [] (const std::string& name) const;

[[nodiscard]]
std::string& operator [] (const std::string& name);

[[nodiscard]]
Iterator begin() const;
[[nodiscard]]
Iterator end() const;

void clear();
Expand Down
5 changes: 5 additions & 0 deletions CppParser/include/Poco/CppParser/AttributesParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ class CppParser_API AttributesParser
const Poco::Token* parseComplexAttribute(const Token* pNext, const std::string& id);
const Poco::Token* parseIdentifier(const Poco::Token* pNext, std::string& id);
const Poco::Token* next();

[[nodiscard]]
static bool isIdentifier(const Poco::Token* pToken);
[[nodiscard]]
static bool isOperator(const Poco::Token* pToken, int kind);
[[nodiscard]]
static bool isLiteral(const Poco::Token* pToken);
[[nodiscard]]
static bool isEOF(const Poco::Token* pToken);

private:
Expand Down
2 changes: 2 additions & 0 deletions CppParser/include/Poco/CppParser/BuiltIn.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class CppParser_API BuiltIn: public Symbol
~BuiltIn();
/// Destroys the BuiltIn.

[[nodiscard]]
Symbol::Kind kind() const;
[[nodiscard]]
std::string toString() const;
};

Expand Down
Loading
Loading