libosmscout 0.1
Loading...
Searching...
No Matches
Platform independent file access

Classes and methods related to low-level platform independent access to files on disk. More...

Classes

class  osmscout::FileScanner
 FileScanner implements platform independent sequential scanning-like access to data in files. More...
 
class  osmscout::FileWriter
 FileScanner implements platform independent writing to data in files. More...
 
class  osmscout::HTMLWriter
 HTMLWriter allows easy generation of HTML web pages containing OSM based reports. More...
 

Functions

std::string osmscout::AppendFileToDir (const std::string &dir, const std::string &file)
 Append the filename 'name' to the directory name 'name' correctly adding directory delimiter if necessary.
 
uint8_t osmscout::BytesNeededToAddressFileData (const std::string &filename)
 Number of bytes needed to address the complete content of the given file.
 
bool osmscout::ExistsInFilesystem (const std::string &filename)
 Returns true of the given filename exists in the filesystem.
 
std::string osmscout::GetDirectory (const std::string &file)
 Return everything (including the delimiter) before the last path delimiter.
 
FileOffset osmscout::GetFileSize (const std::string &filename)
 Return the size of the file in the parameter size.
 
bool osmscout::IsDirectory (const std::string &filename)
 Returns true of the given filename points to a directory.
 
bool osmscout::RemoveFile (const std::string &filename)
 Deletes the given file.
 
bool osmscout::RenameFile (const std::string &oldFilename, const std::string &newFilename)
 Rename a file.
 

Detailed Description

Classes and methods related to low-level platform independent access to files on disk.

Function Documentation

◆ AppendFileToDir()

◆ BytesNeededToAddressFileData()

uint8_t osmscout::BytesNeededToAddressFileData ( const std::string &  filename)
extern

Number of bytes needed to address the complete content of the given file.

Exceptions
IOException

References osmscout::BytesNeededToEncodeNumber(), and osmscout::GetFileSize().

◆ ExistsInFilesystem()

bool osmscout::ExistsInFilesystem ( const std::string &  filename)
extern

Returns true of the given filename exists in the filesystem.

Else it returns false.

Note that this function returns, does not tell you anything about the type of the filesystem entry. It you still be a regular file, a directory, a pipe or something completely different.

Also not ethat there is no differenciation in error codes. If there was an error during access to the file entry while though the file entry does in fact exists, false ist still returned.

Exceptions
IOExceptionif the function is not implemented.

Referenced by osmscout::LoadShaderSource(), and osmscout::ReadFile().

◆ GetDirectory()

std::string osmscout::GetDirectory ( const std::string &  file)
extern

Return everything (including the delimiter) before the last path delimiter.

Returns empty string, if there is no delimiter.

Referenced by osmscout::oss::Parser::IMPORT(), and osmscout::ost::Parser::IMPORT().

◆ GetFileSize()

FileOffset osmscout::GetFileSize ( const std::string &  filename)
extern

◆ IsDirectory()

bool osmscout::IsDirectory ( const std::string &  filename)
extern

Returns true of the given filename points to a directory.

Else it returns false.

Exceptions
IOExceptionif there was an error or if the function is not implemented.

◆ RemoveFile()

bool osmscout::RemoveFile ( const std::string &  filename)
extern

Deletes the given file.

◆ RenameFile()

bool osmscout::RenameFile ( const std::string &  oldFilename,
const std::string &  newFilename 
)
extern

Rename a file.