rm dummy sha1

This commit is contained in:
LaGrunge 2019-10-29 03:08:21 +03:00 committed by cc-engineering
parent 7b61ba4bb0
commit bb337ffbae
6 changed files with 0 additions and 75 deletions

View file

@ -60,8 +60,6 @@ set(
reader_wrapper.hpp
reader_writer_ops.cpp
reader_writer_ops.hpp
sha1.cpp
sha1.hpp
simple_dense_coding.cpp
simple_dense_coding.hpp
string_utf8_multilang.cpp

View file

@ -1,35 +0,0 @@
#include "coding/sha1.hpp"
namespace coding
{
// static
SHA1::Hash SHA1::Calculate(std::string const & /*filePath*/)
{
return {};
}
// static
std::string SHA1::CalculateBase64(std::string const & /*filePath*/)
{
return {};
}
// static
SHA1::Hash SHA1::CalculateForString(std::string const & /*str*/)
{
return {};
}
// static
std::string SHA1::CalculateForStringFormatted(std::string const & /*str*/)
{
return {};
}
// static
std::string SHA1::CalculateBase64ForString(std::string const & /*str*/)
{
return {};
}
} // coding

View file

@ -1,23 +0,0 @@
#pragma once
#pragma message("sha1.hpp is dummy header, delete it or suffer the warning")
#include <array>
#include <string>
namespace coding
{
class SHA1
{
public:
static size_t constexpr kHashSizeInBytes = 20;
using Hash = std::array<uint8_t, kHashSizeInBytes>;
static Hash Calculate(std::string const & filePath);
static std::string CalculateBase64(std::string const & filePath);
static Hash CalculateForString(std::string const & str);
// String representation of 40-number hex digit.
static std::string CalculateForStringFormatted(std::string const & str);
static std::string CalculateBase64ForString(std::string const & str);
};
} // coding

View file

@ -25,9 +25,6 @@ public:
void SetRemoteSizes(MwmSize mapSize, MwmSize routingSize);
MwmSize GetRemoteSize(MapOptions file) const;
void SetSha1(std::string const & base64Sha1) { m_sha1 = base64Sha1; }
std::string const & GetSha1() const { return m_sha1; }
inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; }
inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; }
inline bool operator!=(const CountryFile & rhs) const { return !(*this == rhs); }
@ -39,8 +36,6 @@ private:
std::string m_name;
MwmSize m_mapSize = 0;
MwmSize m_routingSize = 0;
/// \note SHA1 is encoded to base64.
std::string m_sha1;
};
/// \returns This method returns file name with extension. For example Abkhazia.mwm or

View file

@ -4,7 +4,6 @@
#include "platform/platform.hpp"
#include "coding/internal/file_data.hpp"
#include "coding/sha1.hpp"
#include "base/file_name_utils.hpp"
#include "base/logging.hpp"
@ -109,13 +108,6 @@ bool LocalCountryFile::operator==(LocalCountryFile const & rhs) const
m_version == rhs.m_version && m_files == rhs.m_files;
}
bool LocalCountryFile::ValidateIntegrity() const
{
auto calculatedSha1 = coding::SHA1::CalculateBase64(GetPath(MapOptions::Map));
ASSERT_EQUAL(calculatedSha1, m_countryFile.GetSha1(), ("Integrity failure"));
return calculatedSha1 == m_countryFile.GetSha1();
}
// static
LocalCountryFile LocalCountryFile::MakeForTesting(string const & countryFileName, int64_t version)
{

View file

@ -77,8 +77,6 @@ public:
bool operator==(LocalCountryFile const & rhs) const;
bool operator!=(LocalCountryFile const & rhs) const { return !(*this == rhs); }
bool ValidateIntegrity() const;
// Creates LocalCountryFile for test purposes, for a country region
// with countryFileName (without any extensions). Automatically
// performs sync with disk.