Allow inlining simple PasswordFile methods

This commit is contained in:
Marius Kittler 2018-12-21 17:33:05 +01:00
parent 70f62bf94a
commit 35b09d73b2
2 changed files with 89 additions and 89 deletions

View File

@ -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.
*/

View File

@ -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().