diff options
author | Tobias Markmann <tm@ayena.de> | 2016-11-23 07:09:39 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-11-23 11:30:02 (GMT) |
commit | e405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch) | |
tree | 9118ef838ebfaec1df90ec24761944b5d833774c /Swift/Controllers/Storages/VCardFileStorage.cpp | |
parent | 8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff) | |
download | swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.zip swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.tar.bz2 |
Migrate remaining Swiften/Base/foreach.h use to range-based for loop
Test-Information:
Build on macOS 10.12.1 and all tests pass.
Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
Diffstat (limited to 'Swift/Controllers/Storages/VCardFileStorage.cpp')
-rw-r--r-- | Swift/Controllers/Storages/VCardFileStorage.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/Swift/Controllers/Storages/VCardFileStorage.cpp b/Swift/Controllers/Storages/VCardFileStorage.cpp index dbb6799..2fdadf6 100644 --- a/Swift/Controllers/Storages/VCardFileStorage.cpp +++ b/Swift/Controllers/Storages/VCardFileStorage.cpp @@ -1,46 +1,45 @@ /* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/Controllers/Storages/VCardFileStorage.h> #include <iostream> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <Swiften/Base/Path.h> #include <Swiften/Base/String.h> -#include <Swiften/Base/foreach.h> #include <Swiften/Crypto/CryptoProvider.h> #include <Swiften/Elements/VCard.h> #include <Swiften/Entity/GenericPayloadPersister.h> #include <Swiften/JID/JID.h> #include <Swiften/Parser/PayloadParsers/UnitTest/PayloadParserTester.h> #include <Swiften/Parser/PayloadParsers/VCardParser.h> #include <Swiften/Serializer/PayloadSerializers/VCardSerializer.h> #include <Swiften/StringCodecs/Hexify.h> using namespace Swift; typedef GenericPayloadPersister<VCard, VCardParser, VCardSerializer> VCardPersister; VCardFileStorage::VCardFileStorage(boost::filesystem::path dir, CryptoProvider* crypto) : VCardStorage(crypto), vcardsPath(dir), crypto(crypto) { cacheFile = vcardsPath / "phashes"; if (boost::filesystem::exists(cacheFile)) { try { boost::filesystem::ifstream file(cacheFile); std::string line; if (file.is_open()) { while (!file.eof()) { getline(file, line); std::pair<std::string, std::string> r = String::getSplittedAtFirst(line, ' '); JID jid(r.second); if (jid.isValid()) { photoHashes.insert(std::make_pair(jid, r.first)); } else if (!r.first.empty() || !r.second.empty()) { std::cerr << "Invalid entry in phashes file" << std::endl; } |