From 35b09d73b2e60577d76c1a39a09fef258e7feefe Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Fri, 21 Dec 2018 17:33:05 +0100 Subject: [PATCH] Allow inlining simple PasswordFile methods --- io/passwordfile.cpp | 89 --------------------------------------------- io/passwordfile.h | 89 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/io/passwordfile.cpp b/io/passwordfile.cpp index 31802d2..65e1dbe 100644 --- a/io/passwordfile.cpp +++ b/io/passwordfile.cpp @@ -671,14 +671,6 @@ void PasswordFile::close() m_file.clear(); } -/*! - * \brief Returns the current file path. - */ -const string &PasswordFile::path() const -{ - return m_path; -} - /*! * \brief Sets the current file path. Closes the file if currently opened. */ @@ -693,47 +685,6 @@ void PasswordFile::setPath(const string &value) } } -/*! - * \brief Clears the current path. Causes the file to be closed if currently opened. - */ -void PasswordFile::clearPath() -{ - close(); - m_path.clear(); -} - -/*! - * \brief Returns the current password. It will be used when loading or saving using encryption. - */ -const std::string &PasswordFile::password() const -{ - return m_password; -} - -/*! - * \brief Sets the current password. It will be used when loading an encrypted file or when saving using encryption. - */ -void PasswordFile::setPassword(const string &password) -{ - m_password = password; -} - -/*! - * \brief Sets the current password. It will be used when loading an encrypted file or when saving using encryption. - */ -void PasswordFile::setPassword(const char *password, const size_t passwordSize) -{ - m_password.assign(password, passwordSize); -} - -/*! - * \brief Clears the current password. - */ -void PasswordFile::clearPassword() -{ - m_password.clear(); -} - /*! * \brief Returns an indication whether encryption is used if the file is open; returns always false otherwise. */ @@ -760,46 +711,6 @@ bool PasswordFile::isEncryptionUsed() } } -/*! - * \brief Returns an indication whether the file is open. - */ -bool PasswordFile::isOpen() const -{ - return m_file.is_open(); -} - -/*! - * \brief Returns the extended header. - */ -string &PasswordFile::extendedHeader() -{ - return m_extendedHeader; -} - -/*! - * \brief Returns the extended header. - */ -const string &PasswordFile::extendedHeader() const -{ - return m_extendedHeader; -} - -/*! - * \brief Returns the encrypted extended header. - */ -string &PasswordFile::encryptedExtendedHeader() -{ - return m_encryptedExtendedHeader; -} - -/*! - * \brief Returns the encrypted extended header. - */ -const string &PasswordFile::encryptedExtendedHeader() const -{ - return m_encryptedExtendedHeader; -} - /*! * \brief Returns the size of the file if the file is open; otherwise returns zero. */ diff --git a/io/passwordfile.h b/io/passwordfile.h index b5f8277..4e70cde 100644 --- a/io/passwordfile.h +++ b/io/passwordfile.h @@ -135,6 +135,95 @@ inline IoUtilities::NativeFileStream &PasswordFile::fileStream() return m_file; } +/*! + * \brief Returns the current file path. + */ +inline const std::string &PasswordFile::path() const +{ + return m_path; +} + +/*! + * \brief Clears the current path. Causes the file to be closed if currently opened. + */ +inline void PasswordFile::clearPath() +{ + close(); + m_path.clear(); +} + +/*! + * \brief Returns the current password. It will be used when loading or saving using encryption. + */ +inline const std::string &PasswordFile::password() const +{ + return m_password; +} + +/*! + * \brief Sets the current password. It will be used when loading an encrypted file or when saving using encryption. + */ +inline void PasswordFile::setPassword(const std::string &password) +{ + m_password = password; +} + +/*! + * \brief Sets the current password. It will be used when loading an encrypted file or when saving using encryption. + */ +inline void PasswordFile::setPassword(const char *password, const size_t passwordSize) +{ + m_password.assign(password, passwordSize); +} + +/*! + * \brief Clears the current password. + */ +inline void PasswordFile::clearPassword() +{ + m_password.clear(); +} + +/*! + * \brief Returns an indication whether the file is open. + */ +inline bool PasswordFile::isOpen() const +{ + return m_file.is_open(); +} + +/*! + * \brief Returns the extended header. + */ +inline std::string &PasswordFile::extendedHeader() +{ + return m_extendedHeader; +} + +/*! + * \brief Returns the extended header. + */ +inline const std::string &PasswordFile::extendedHeader() const +{ + return m_extendedHeader; +} + +/*! + * \brief Returns the encrypted extended header. + */ +inline std::string &PasswordFile::encryptedExtendedHeader() +{ + return m_encryptedExtendedHeader; +} + +/*! + * \brief Returns the encrypted extended header. + */ +inline const std::string &PasswordFile::encryptedExtendedHeader() const +{ + return m_encryptedExtendedHeader; +} + /*! * \brief Returns the file version used the last time when saving the file (the version of the file as it is on the disk). * \remarks The version might change when re-saving with different options. See mininumVersion().