diff options
Diffstat (limited to 'Swift/Controllers/Storages')
-rw-r--r-- | Swift/Controllers/Storages/AvatarFileStorage.cpp | 4 | ||||
-rw-r--r-- | Swift/Controllers/Storages/CertificateFileStorage.cpp | 4 | ||||
-rw-r--r-- | Swift/Controllers/Storages/VCardFileStorage.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Swift/Controllers/Storages/AvatarFileStorage.cpp b/Swift/Controllers/Storages/AvatarFileStorage.cpp index 288f6fd..b39e586 100644 --- a/Swift/Controllers/Storages/AvatarFileStorage.cpp +++ b/Swift/Controllers/Storages/AvatarFileStorage.cpp @@ -59,7 +59,7 @@ void AvatarFileStorage::addAvatar(const std::string& hash, const ByteArray& avat } } boost::filesystem::ofstream file(avatarPath, boost::filesystem::ofstream::binary|boost::filesystem::ofstream::out); - file.write(reinterpret_cast<const char*>(avatar.getData()), static_cast<std::streamsize>(avatar.getSize())); + file.write(reinterpret_cast<const char*>(vecptr(avatar)), static_cast<std::streamsize>(avatar.size())); file.close(); } @@ -69,7 +69,7 @@ boost::filesystem::path AvatarFileStorage::getAvatarPath(const std::string& hash ByteArray AvatarFileStorage::getAvatar(const std::string& hash) const { ByteArray data; - data.readFromFile(getAvatarPath(hash).string()); + readByteArrayFromFile(data, getAvatarPath(hash).string()); return data; } diff --git a/Swift/Controllers/Storages/CertificateFileStorage.cpp b/Swift/Controllers/Storages/CertificateFileStorage.cpp index 31af949..a4a95c7 100644 --- a/Swift/Controllers/Storages/CertificateFileStorage.cpp +++ b/Swift/Controllers/Storages/CertificateFileStorage.cpp @@ -23,7 +23,7 @@ bool CertificateFileStorage::hasCertificate(Certificate::ref certificate) const boost::filesystem::path certificatePath = getCertificatePath(certificate); if (boost::filesystem::exists(certificatePath)) { ByteArray data; - data.readFromFile(certificatePath.string()); + readByteArrayFromFile(data, certificatePath.string()); Certificate::ref storedCertificate = certificateFactory->createCertificateFromDER(data); if (storedCertificate && storedCertificate->toDER() == certificate->toDER()) { return true; @@ -50,7 +50,7 @@ void CertificateFileStorage::addCertificate(Certificate::ref certificate) { } boost::filesystem::ofstream file(certificatePath, boost::filesystem::ofstream::binary|boost::filesystem::ofstream::out); ByteArray data = certificate->toDER(); - file.write(reinterpret_cast<const char*>(data.getData()), data.getSize()); + file.write(reinterpret_cast<const char*>(vecptr(data)), data.size()); file.close(); } diff --git a/Swift/Controllers/Storages/VCardFileStorage.cpp b/Swift/Controllers/Storages/VCardFileStorage.cpp index 4933d0c..5f657a4 100644 --- a/Swift/Controllers/Storages/VCardFileStorage.cpp +++ b/Swift/Controllers/Storages/VCardFileStorage.cpp @@ -79,7 +79,7 @@ std::string VCardFileStorage::getPhotoHash(const JID& jid) const { std::string VCardFileStorage::getAndUpdatePhotoHash(const JID& jid, VCard::ref vCard) const { std::string hash; - if (vCard && !vCard->getPhoto().isEmpty()) { + if (vCard && !vCard->getPhoto().empty()) { hash = Hexify::hexify(SHA1::getHash(vCard->getPhoto())); } std::pair<PhotoHashMap::iterator, bool> r = photoHashes.insert(std::make_pair(jid, hash)); |