forked from organicmaps/organicmaps
[coding] FileContainer::Write(void const *, size_t, Tag)
This commit is contained in:
parent
44a51b838f
commit
5e39f8a55c
3 changed files with 10 additions and 5 deletions
|
@ -448,16 +448,20 @@ void FilesContainerW::Write(ModelReaderPtr reader, Tag const & tag)
|
|||
rw::ReadAndWrite(src, *writer);
|
||||
}
|
||||
|
||||
void FilesContainerW::Write(void const * buffer, size_t size, Tag const & tag)
|
||||
{
|
||||
if (size != 0)
|
||||
GetWriter(tag)->Write(buffer, size);
|
||||
}
|
||||
|
||||
void FilesContainerW::Write(vector<char> const & buffer, Tag const & tag)
|
||||
{
|
||||
if (!buffer.empty())
|
||||
GetWriter(tag)->Write(buffer.data(), buffer.size());
|
||||
Write(buffer.data(), buffer.size(), tag);
|
||||
}
|
||||
|
||||
void FilesContainerW::Write(vector<uint8_t> const & buffer, Tag const & tag)
|
||||
{
|
||||
if (!buffer.empty())
|
||||
GetWriter(tag)->Write(buffer.data(), buffer.size());
|
||||
Write(buffer.data(), buffer.size(), tag);
|
||||
}
|
||||
|
||||
void FilesContainerW::Finish()
|
||||
|
|
|
@ -245,6 +245,7 @@ public:
|
|||
|
||||
void Write(std::string const & fPath, Tag const & tag);
|
||||
void Write(ModelReaderPtr reader, Tag const & tag);
|
||||
void Write(void const * buffer, size_t size, Tag const & tag);
|
||||
void Write(std::vector<char> const & buffer, Tag const & tag);
|
||||
void Write(std::vector<uint8_t> const & buffer, Tag const & tag);
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ bool BuildLocalityIndexFromDataFile(string const & dataFile,
|
|||
|
||||
FilesContainerW writer(outFileName, FileWriter::OP_WRITE_TRUNCATE);
|
||||
writer.Write(idxFileName, localityIndexFileTag);
|
||||
writer.Write(std::vector<char>(dataVersionJson.begin(), dataVersionJson.end()), dataVersionTag);
|
||||
writer.Write(dataVersionJson.c_str(), dataVersionJson.size(), dataVersionTag);
|
||||
FileWriter::DeleteFileX(idxFileName);
|
||||
}
|
||||
catch (Reader::Exception const & e)
|
||||
|
|
Loading…
Add table
Reference in a new issue