mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
50
coding/file_writer.cpp
Normal file
50
coding/file_writer.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#include "coding/file_writer.hpp"
|
||||
#include "coding/internal/file_data.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
FileWriter::FileWriter(std::string const & fileName, FileWriter::Op op)
|
||||
: m_pFileData(std::make_unique<base::FileData>(fileName, static_cast<base::FileData::Op>(op)))
|
||||
{
|
||||
}
|
||||
|
||||
FileWriter::~FileWriter() noexcept(false)
|
||||
{
|
||||
// Note: FileWriter::Flush will be called (like non virtual method).
|
||||
Flush();
|
||||
}
|
||||
|
||||
uint64_t FileWriter::Pos() const
|
||||
{
|
||||
return m_pFileData->Pos();
|
||||
}
|
||||
|
||||
void FileWriter::Seek(uint64_t pos)
|
||||
{
|
||||
m_pFileData->Seek(pos);
|
||||
}
|
||||
|
||||
void FileWriter::Write(void const * p, size_t size)
|
||||
{
|
||||
m_pFileData->Write(p, size);
|
||||
}
|
||||
|
||||
std::string const & FileWriter::GetName() const
|
||||
{
|
||||
return m_pFileData->GetName();
|
||||
}
|
||||
|
||||
uint64_t FileWriter::Size() const
|
||||
{
|
||||
return m_pFileData->Size();
|
||||
}
|
||||
|
||||
void FileWriter::Flush() noexcept(false)
|
||||
{
|
||||
m_pFileData->Flush();
|
||||
}
|
||||
|
||||
void FileWriter::DeleteFileX(std::string const & fName)
|
||||
{
|
||||
UNUSED_VALUE(base::DeleteFileX(fName));
|
||||
}
|
||||
Reference in New Issue
Block a user