Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reader.cpp « coding - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf3cf668b01bbf2a182dbb91ef79f532e2b97e81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "coding/reader.hpp"

#include "base/string_utils.hpp"

void Reader::ReadAsString(std::string & s) const
{
  s.clear();
  size_t const sz = static_cast<size_t>(Size());
  s.resize(sz);
  Read(0, &s[0], sz);
}

std::vector<uint8_t> Reader::ReadAsBytes() const
{
  std::vector<uint8_t> contents;
  contents.resize(Size());
  Read(0 /* pos */, contents.data(), contents.size());
  return contents;
}

bool Reader::IsEqual(std::string const & name1, std::string const & name2)
{
#if defined(OMIM_OS_WINDOWS)
  return strings::EqualNoCase(name1, name2);
#else
  return (name1 == name2);
#endif
}