libosmscout  0.1
osmscout::FileWriter Class Referencefinal

#include <FileWriter.h>

Public Member Functions

void Close ()
 
void CloseFailsafe ()
 
 FileWriter ()=default
 
void Flush ()
 
void FlushCurrentBlockWithZeros (size_t blockSize)
 
std::string GetFilename () const
 
FileOffset GetPos ()
 Returns the current position of the writing cursor in relation to the begining of the file. More...
 
void GotoBegin ()
 Moves the writing cursor to the start of the file (offset 0) More...
 
bool HasError () const
 
bool IsOpen () const
 
void Open (const std::string &filename)
 
void SetPos (FileOffset pos)
 Moves the writing cursor to the given file position. More...
 
void Write (bool boolean)
 
void Write (const char *buffer, size_t bytes)
 
void Write (const Color &color)
 
void Write (const MagnificationLevel &level)
 
void Write (const ObjectFileRef &ref)
 
void Write (const std::string &value)
 
void Write (const std::vector< GeoCoord > &nodes)
 
void Write (const std::vector< Point > &nodes, bool writeIds)
 
void Write (int16_t number)
 
void Write (int32_t number)
 
void Write (int64_t number)
 
void Write (int8_t number)
 
void Write (std::byte byteValue)
 
void Write (uint16_t number)
 
void Write (uint16_t number, size_t bytes)
 
void Write (uint32_t number)
 
void Write (uint32_t number, size_t bytes)
 
void Write (uint64_t number)
 
void Write (uint64_t number, size_t bytes)
 
void Write (uint8_t number)
 
void WriteBox (const GeoBox &bbox)
 Writes GeoBox instance. More...
 
void WriteCoord (const GeoCoord &coord)
 Writes GeoCoord instance. More...
 
void WriteFileOffset (FileOffset offset)
 
void WriteFileOffset (FileOffset offset, size_t bytes)
 
void WriteInvalidCoord ()
 
void WriteNumber (const MagnificationLevel &level)
 
void WriteNumber (int16_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteNumber (int32_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteNumber (int64_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteNumber (uint16_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteNumber (uint32_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteNumber (uint64_t number)
 Write a numeric value to the file using some internal encoding to reduce storage size. More...
 
void WriteTypeId (TypeId id, uint8_t maxBytes)
 
 ~FileWriter ()
 

Static Public Attributes

static const uint64_t MAX_NODES =0x03FFFFFFu
 

Detailed Description

FileScanner implements platform independent writing to data in files. It uses C standard library FILE internally and wraps it to offer a number of convenience methods.

Constructor & Destructor Documentation

◆ FileWriter()

osmscout::FileWriter::FileWriter ( )
default

◆ ~FileWriter()

osmscout::FileWriter::~FileWriter ( )

Member Function Documentation

◆ Close()

void osmscout::FileWriter::Close ( )

◆ CloseFailsafe()

void osmscout::FileWriter::CloseFailsafe ( )

◆ Flush()

void osmscout::FileWriter::Flush ( )
Exceptions
IOException

References HasError().

◆ FlushCurrentBlockWithZeros()

void osmscout::FileWriter::FlushCurrentBlockWithZeros ( size_t  blockSize)
Exceptions
IOException

References GetPos(), and HasError().

◆ GetFilename()

std::string osmscout::FileWriter::GetFilename ( ) const

◆ GetPos()

FileOffset osmscout::FileWriter::GetPos ( )

Returns the current position of the writing cursor in relation to the begining of the file.

Exceptions
IOException

References HasError().

Referenced by FlushCurrentBlockWithZeros().

◆ GotoBegin()

void osmscout::FileWriter::GotoBegin ( )

Moves the writing cursor to the start of the file (offset 0)

Exceptions
IOException

References SetPos().

◆ HasError()

bool osmscout::FileWriter::HasError ( ) const
inline

◆ IsOpen()

bool osmscout::FileWriter::IsOpen ( ) const
inline

◆ Open()

void osmscout::FileWriter::Open ( const std::string &  filename)

◆ SetPos()

void osmscout::FileWriter::SetPos ( FileOffset  pos)

Moves the writing cursor to the given file position.

Exceptions
IOException

References HasError().

Referenced by GotoBegin().

◆ Write() [1/20]

void osmscout::FileWriter::Write ( bool  boolean)
Exceptions
IOException

References HasError().

◆ Write() [2/20]

void osmscout::FileWriter::Write ( const char *  buffer,
size_t  bytes 
)

◆ Write() [3/20]

void osmscout::FileWriter::Write ( const Color color)

◆ Write() [4/20]

void osmscout::FileWriter::Write ( const MagnificationLevel level)
inline

◆ Write() [5/20]

void osmscout::FileWriter::Write ( const ObjectFileRef ref)

◆ Write() [6/20]

void osmscout::FileWriter::Write ( const std::string &  value)
Exceptions
IOException

References HasError().

◆ Write() [7/20]

void osmscout::FileWriter::Write ( const std::vector< GeoCoord > &  nodes)

◆ Write() [8/20]

void osmscout::FileWriter::Write ( const std::vector< Point > &  nodes,
bool  writeIds 
)

◆ Write() [9/20]

void osmscout::FileWriter::Write ( int16_t  number)
Exceptions
IOException

References HasError().

◆ Write() [10/20]

void osmscout::FileWriter::Write ( int32_t  number)
Exceptions
IOException

References HasError().

◆ Write() [11/20]

void osmscout::FileWriter::Write ( int64_t  number)
Exceptions
IOException

References HasError().

◆ Write() [12/20]

void osmscout::FileWriter::Write ( int8_t  number)
Exceptions
IOException

References HasError().

◆ Write() [13/20]

void osmscout::FileWriter::Write ( std::byte  byteValue)
Exceptions
IOException

References HasError().

◆ Write() [14/20]

void osmscout::FileWriter::Write ( uint16_t  number)
Exceptions
IOException

References HasError().

◆ Write() [15/20]

void osmscout::FileWriter::Write ( uint16_t  number,
size_t  bytes 
)
Exceptions
IOException

References HasError().

◆ Write() [16/20]

void osmscout::FileWriter::Write ( uint32_t  number)
Exceptions
IOException

References HasError().

◆ Write() [17/20]

void osmscout::FileWriter::Write ( uint32_t  number,
size_t  bytes 
)
Exceptions
IOException

References HasError().

◆ Write() [18/20]

void osmscout::FileWriter::Write ( uint64_t  number)
Exceptions
IOException

References HasError().

◆ Write() [19/20]

void osmscout::FileWriter::Write ( uint64_t  number,
size_t  bytes 
)
Exceptions
IOException

References HasError().

◆ Write() [20/20]

void osmscout::FileWriter::Write ( uint8_t  number)
Exceptions
IOException

References HasError().

◆ WriteBox()

void osmscout::FileWriter::WriteBox ( const GeoBox bbox)

◆ WriteCoord()

void osmscout::FileWriter::WriteCoord ( const GeoCoord coord)

◆ WriteFileOffset() [1/2]

void osmscout::FileWriter::WriteFileOffset ( FileOffset  fileOffset)
Exceptions
IOException

References HasError().

Referenced by Write().

◆ WriteFileOffset() [2/2]

void osmscout::FileWriter::WriteFileOffset ( FileOffset  fileOffset,
size_t  bytes 
)
Exceptions
IOException

References HasError().

◆ WriteInvalidCoord()

void osmscout::FileWriter::WriteInvalidCoord ( )
Exceptions
IOException

References osmscout::coordByteSize, and HasError().

◆ WriteNumber() [1/7]

void osmscout::FileWriter::WriteNumber ( const MagnificationLevel level)
inline

◆ WriteNumber() [2/7]

void osmscout::FileWriter::WriteNumber ( int16_t  number)

◆ WriteNumber() [3/7]

void osmscout::FileWriter::WriteNumber ( int32_t  number)

Write a numeric value to the file using some internal encoding to reduce storage size.

Note that this works only if the average number is small.

Exceptions
IOException

References osmscout::EncodeNumber(), and HasError().

◆ WriteNumber() [4/7]

void osmscout::FileWriter::WriteNumber ( int64_t  number)

Write a numeric value to the file using some internal encoding to reduce storage size.

Note that this works only if the average number is small.

Exceptions
IOException

References osmscout::EncodeNumber(), and HasError().

◆ WriteNumber() [5/7]

void osmscout::FileWriter::WriteNumber ( uint16_t  number)

Write a numeric value to the file using some internal encoding to reduce storage size.

Note that this works only if the average number is small.

Exceptions
IOException

References osmscout::EncodeNumber(), and HasError().

◆ WriteNumber() [6/7]

void osmscout::FileWriter::WriteNumber ( uint32_t  number)

Write a numeric value to the file using some internal encoding to reduce storage size.

Note that this works only if the average number is small.

Exceptions
IOException

References osmscout::EncodeNumber(), and HasError().

◆ WriteNumber() [7/7]

void osmscout::FileWriter::WriteNumber ( uint64_t  number)

Write a numeric value to the file using some internal encoding to reduce storage size.

Note that this works only if the average number is small.

Exceptions
IOException

References osmscout::EncodeNumber(), and HasError().

◆ WriteTypeId()

Member Data Documentation

◆ MAX_NODES

const uint64_t osmscout::FileWriter::MAX_NODES =0x03FFFFFFu
static

Referenced by Write().


The documentation for this class was generated from the following files: