[coding] Rename non-empty string serialization.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-02 22:05:34 -03:00
committed by Konstantin Pastbin
parent 7b4862b442
commit 1d29e7816a
8 changed files with 24 additions and 36 deletions

View File

@@ -22,7 +22,7 @@ BoundaryPostcodesEnricher::BoundaryPostcodesEnricher(std::string const & boundar
while (src.Size() > 0)
{
std::string postcode;
utils::ReadString(src, postcode);
rw::ReadNonEmpty(src, postcode);
std::vector<m2::PointD> geometry;
rw::ReadVectorOfPOD(src, geometry);
CHECK(!postcode.empty() && !geometry.empty(), ());

View File

@@ -57,7 +57,7 @@ void BoundaryPostcodeCollector::Save()
FileWriter writer(GetFilename());
for (auto const & p : m_data)
{
utils::WriteString(writer, p.first);
rw::WriteNonEmpty(writer, p.first);
rw::WriteVectorOfPOD(writer, p.second);
}
}

View File

@@ -91,7 +91,7 @@ unordered_map<string, vector<m2::PointD>> Read(string const & dumpFilename)
while (src.Size() > 0)
{
string postcode;
utils::ReadString(src, postcode);
rw::ReadNonEmpty(src, postcode);
vector<m2::PointD> geometry;
rw::ReadVectorOfPOD(src, geometry);
result.emplace(std::move(postcode), std::move(geometry));

View File

@@ -14,7 +14,6 @@
#include <optional>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
namespace routing
@@ -74,7 +73,7 @@ void Save(Sink & sink, ConditionalRAVectorT const & ac)
for (auto const & e : ac)
{
Save(sink, e.m_accessType);
utils::WriteString(sink, e.m_openingHours);
rw::WriteNonEmpty(sink, e.m_openingHours);
}
}
@@ -86,7 +85,7 @@ void Load(Source & src, ConditionalRAVectorT & vec)
for (uint32_t i = 0; i < count; ++i)
{
Load(src, vec[i].m_accessType);
utils::ReadString(src, vec[i].m_openingHours);
rw::ReadNonEmpty(src, vec[i].m_openingHours);
}
}