Skip to content
Draft
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
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions ActiveRecord/Compiler/src/CodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "CodeGenerator.h"
#include "Poco/StringTokenizer.h"
#include <set>
#include <utility>


using namespace std::string_literals;
Expand All @@ -21,8 +22,8 @@ namespace ActiveRecord {
namespace Compiler {


CodeGenerator::CodeGenerator(const std::string& source, std::ostream& stream):
_source(source),
CodeGenerator::CodeGenerator(std::string source, std::ostream& stream):
_source(std::move(source)),
_stream(stream)
{
}
Expand Down
2 changes: 1 addition & 1 deletion ActiveRecord/Compiler/src/CodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Compiler {
class CodeGenerator
{
public:
CodeGenerator(const std::string& source, std::ostream& stream);
CodeGenerator(std::string source, std::ostream& stream);

static std::vector<std::string> splitNameSpace(const std::string& nameSpace);

Expand Down
9 changes: 4 additions & 5 deletions ActiveRecord/Compiler/src/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ class CompilerApp: public Application
{
public:
CompilerApp()
{
}
= default;

protected:
void initialize(Application& self)
void initialize(Application& self) override
{
loadConfiguration(); // load default configuration files, if present
Application::initialize(self);
}

void defineOptions(OptionSet& options)
void defineOptions(OptionSet& options) override
{
Application::defineOptions(options);

Expand Down Expand Up @@ -197,7 +196,7 @@ class CompilerApp: public Application
}
}

int main(const ArgVec& args)
int main(const ArgVec& args) override
{
if (!_helpRequested)
{
Expand Down
6 changes: 3 additions & 3 deletions ActiveRecord/Compiler/src/HeaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace ActiveRecord {
namespace Compiler {


HeaderGenerator::HeaderGenerator(const std::string& source, std::ostream& stream, const Class& clazz, const ClassMap& classes):
CodeGenerator(source, stream),
_class(clazz),
HeaderGenerator::HeaderGenerator(std::string source, std::ostream& stream, Class clazz, const ClassMap& classes):
CodeGenerator(std::move(source), stream),
_class(std::move(clazz)),
_classes(classes)
{
}
Expand Down
2 changes: 1 addition & 1 deletion ActiveRecord/Compiler/src/HeaderGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Compiler {
class HeaderGenerator: public CodeGenerator
{
public:
HeaderGenerator(const std::string& source, std::ostream& stream, const Class& clazz, const ClassMap& classes);
HeaderGenerator(std::string source, std::ostream& stream, Class clazz, const ClassMap& classes);

void generate() const;
void writeClass() const;
Expand Down
6 changes: 4 additions & 2 deletions ActiveRecord/Compiler/src/ImplGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@


#include "ImplGenerator.h"

#include "Poco/Exception.h"
#include <utility>


using namespace std::string_literals;
Expand All @@ -20,9 +22,9 @@ namespace ActiveRecord {
namespace Compiler {


ImplGenerator::ImplGenerator(const std::string& source, std::ostream& stream, const Class& clazz, const ClassMap& classes):
ImplGenerator::ImplGenerator(const std::string& source, std::ostream& stream, Class clazz, const ClassMap& classes):
CodeGenerator(source, stream),
_class(clazz),
_class(std::move(clazz)),
_classes(classes)
{
}
Expand Down
2 changes: 1 addition & 1 deletion ActiveRecord/Compiler/src/ImplGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Compiler {
class ImplGenerator: public CodeGenerator
{
public:
ImplGenerator(const std::string& source, std::ostream& stream, const Class& clazz, const ClassMap& classes);
ImplGenerator(const std::string& source, std::ostream& stream, Class clazz, const ClassMap& classes);

void generate() const;
void writeClassMembers() const;
Expand Down
7 changes: 3 additions & 4 deletions ActiveRecord/Compiler/src/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ namespace Compiler {


Parser::Parser()
{
}
= default;


ClassMap Parser::parse(const std::string& systemId, std::istream& stream)
Expand Down Expand Up @@ -90,7 +89,7 @@ void Parser::startElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLS

void Parser::endElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLString& localName, const Poco::XML::XMLString& qname)
{
poco_assert (_elemStack.size() > 0);
poco_assert (!_elemStack.empty());

if (qname == "class")
{
Expand Down Expand Up @@ -250,7 +249,7 @@ std::string Parser::convertCamelCase(const std::string& name)
{
if (Poco::Ascii::isUpper(c))
{
if (!(result.empty() || result.back() == '_'))
if (!result.empty() && result.back() != '_')
{
result += '_';
}
Expand Down
6 changes: 3 additions & 3 deletions ActiveRecord/Compiler/src/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Parser: protected Poco::XML::DefaultHandler

protected:
// ContentHandler
void setDocumentLocator(const Poco::XML::Locator* pLocator);
void startElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLString& localName, const Poco::XML::XMLString& qname, const Poco::XML::Attributes& attributes);
void endElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLString& localName, const Poco::XML::XMLString& qname);
void setDocumentLocator(const Poco::XML::Locator* pLocator) override;
void startElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLString& localName, const Poco::XML::XMLString& qname, const Poco::XML::Attributes& attributes) override;
void endElement(const Poco::XML::XMLString& uri, const Poco::XML::XMLString& localName, const Poco::XML::XMLString& qname) override;
void handleProject(const Poco::XML::Attributes& attributes);
void handleClass(const Poco::XML::Attributes& attributes);
void handleProperty(const Poco::XML::Attributes& attributes);
Expand Down
10 changes: 5 additions & 5 deletions ActiveRecord/include/Poco/ActiveRecord/ActiveRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ActiveRecordLib_API ActiveRecordBase: public Poco::RefCountedObject

protected:
ActiveRecordBase() = default;
~ActiveRecordBase() = default;
~ActiveRecordBase() override = default;

template <typename T>
static Poco::AutoPtr<T> withContext(Poco::AutoPtr<T> pObj, Context::Ptr pContext)
Expand Down Expand Up @@ -110,13 +110,13 @@ class ActiveRecord: public ActiveRecordBase
/// Returns the unique ID of the object.

// ActiveRecordBase
std::string toString() const;
bool isValid() const;
std::string toString() const override;
bool isValid() const override;

protected:
ActiveRecord() = default;
ActiveRecord(ID id): _id(id) {};
~ActiveRecord() = default;
~ActiveRecord() override = default;

ActiveRecord(const ActiveRecord& other):
_id(other._id)
Expand Down Expand Up @@ -171,7 +171,7 @@ class ActiveRecordLib_API KeylessActiveRecord: public ActiveRecordBase
using Ptr = Poco::AutoPtr<KeylessActiveRecord>;

// ActiveRecordBase
std::string toString() const;
std::string toString() const override;

protected:
template <typename AR>
Expand Down
4 changes: 2 additions & 2 deletions ActiveRecord/include/Poco/ActiveRecord/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class ActiveRecordLib_API Context: public Poco::RefCountedObject
public:
using Ptr = Poco::AutoPtr<Context>;

explicit Context(const Poco::Data::Session& session);
explicit Context(Poco::Data::Session session);
/// Creates the Context from an existing Poco::Data::Session.

Context(const std::string& connector, const std::string& connectionString);
/// Creates the Context from a connector name and connection string.

~Context() = default;
~Context() override = default;
/// Destroys the Context.

Poco::Data::Session& session();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ class ActiveRecordLib_API StatementPlaceholderProvider
class ActiveRecordLib_API DefaultStatementPlaceholderProvider: public StatementPlaceholderProvider
{
public:
void reset();
std::string next();
void reset() override;
std::string next() override;
};


class ActiveRecordLib_API PostgresStatementPlaceholderProvider: public StatementPlaceholderProvider
{
public:
void reset();
std::string next();
void reset() override;
std::string next() override;

private:
int _n = 1;
Expand Down
6 changes: 4 additions & 2 deletions ActiveRecord/src/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
//


#include <utility>

#include "Poco/ActiveRecord/Context.h"


namespace Poco {
namespace ActiveRecord {


Context::Context(const Poco::Data::Session& session):
_session(session)
Context::Context(Poco::Data::Session session):
_session(std::move(session))
{
}

Expand Down
3 changes: 1 addition & 2 deletions ActiveRecord/src/StatementPlaceholderProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ namespace ActiveRecord {


StatementPlaceholderProvider::~StatementPlaceholderProvider()
{
}
= default;


void DefaultStatementPlaceholderProvider::reset()
Expand Down
2 changes: 1 addition & 1 deletion Crypto/include/Poco/Crypto/Cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class Crypto_API Cipher: public Poco::RefCountedObject
ENC_BINHEX_NO_LF = 0x82 /// BinHex-encoded output, no linefeeds
};

virtual ~Cipher();
~Cipher() override;
/// Destroys the Cipher.

virtual const std::string& name() const = 0;
Expand Down
10 changes: 5 additions & 5 deletions Crypto/include/Poco/Crypto/CipherImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ class CipherImpl: public Cipher
/// An implementation of the Cipher class for OpenSSL's crypto library.
{
public:
CipherImpl(const CipherKey& key);
CipherImpl(CipherKey key);
/// Creates a new CipherImpl object for the given CipherKey.

virtual ~CipherImpl();
~CipherImpl() override;
/// Destroys the CipherImpl.

const std::string& name() const;
const std::string& name() const override;
/// Returns the name of the cipher.

CryptoTransform::Ptr createEncryptor();
CryptoTransform::Ptr createEncryptor() override;
/// Creates an encryptor object.

CryptoTransform::Ptr createDecryptor();
CryptoTransform::Ptr createDecryptor() override;
/// Creates a decryptor object.

private:
Expand Down
8 changes: 4 additions & 4 deletions Crypto/include/Poco/Crypto/CipherKeyImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ class CipherKeyImpl: public RefCountedObject
/// and iteration count.

CipherKeyImpl(const std::string& name,
const ByteVec& key,
const ByteVec& iv);
ByteVec key,
ByteVec iv);
/// Creates a new CipherKeyImpl object, using the
/// given cipher name, key and initialization vector.

CipherKeyImpl(const std::string& name);
/// Creates a new CipherKeyImpl object. Autoinitializes key
/// and initialization vector.

virtual ~CipherKeyImpl();
~CipherKeyImpl() override;
/// Destroys the CipherKeyImpl.

const std::string& name() const;
Expand Down Expand Up @@ -107,7 +107,7 @@ class CipherKeyImpl: public RefCountedObject
/// Returns the cipher object

private:
void generateKey(const std::string& passphrase,
void generateKey(const std::string& password,
const std::string& salt,
int iterationCount);
/// Generates key and IV from a password and optional salt string.
Expand Down
2 changes: 1 addition & 1 deletion Crypto/include/Poco/Crypto/Crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ inline std::string& getError(std::string& msg)
while ((err = ERR_get_error()))
{
if (!msg.empty()) msg.append(1, '\n');
msg.append(ERR_error_string(err, 0));
msg.append(ERR_error_string(err, nullptr));
}
return msg;
}
Expand Down
10 changes: 5 additions & 5 deletions Crypto/include/Poco/Crypto/CryptoException.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class Crypto_API OpenSSLException : public CryptoException
OpenSSLException(const std::string& msg, const std::string& arg, int code = 0);
OpenSSLException(const std::string& msg, const Poco::Exception& exc, int code = 0);
OpenSSLException(const OpenSSLException& exc);
~OpenSSLException() noexcept;
~OpenSSLException() noexcept override;
OpenSSLException& operator = (const OpenSSLException& exc);
const char* name() const noexcept;
const char* className() const noexcept;
Poco::Exception* clone() const;
void rethrow() const;
const char* name() const noexcept override;
const char* className() const noexcept override;
Poco::Exception* clone() const override;
void rethrow() const override;

private:
void setExtMessage();
Expand Down
Loading