OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
File.h File Reference

A selection of helper methods for File I/O. More...

#include <iostream>
#include <string>
#include "../../Shared/types.h"
+ Include dependency graph for File.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 File_Namespace
 

Macros

#define MAPD_FILE_EXT   ".mapd"
 
#define MAX_FILE_N_PAGES   256
 
#define MAX_FILE_N_METADATA_PAGES   4096
 

Functions

FILE * File_Namespace::create (const std::string &basePath, const int fileId, const size_t pageSize, const size_t numPages)
 
FILE * File_Namespace::create (const std::string &fullPath, const size_t requestedFileSize)
 
FILE * File_Namespace::open (int fileId)
 Opens/creates the file with the given id; returns NULL on error. More...
 
FILE * File_Namespace::open (const std::string &path)
 
void File_Namespace::close (FILE *f)
 Closes the file pointed to by the FILE pointer. More...
 
bool File_Namespace::removeFile (const std::string basePath, const std::string filename)
 Deletes the file pointed to by the FILE pointer. More...
 
size_t File_Namespace::read (FILE *f, const size_t offset, const size_t size, int8_t *buf)
 Reads the specified number of bytes from the offset position in file f into buf. More...
 
size_t File_Namespace::write (FILE *f, const size_t offset, const size_t size, int8_t *buf)
 Writes the specified number of bytes to the offset position in file f from buf. More...
 
size_t File_Namespace::append (FILE *f, const size_t size, int8_t *buf)
 Appends the specified number of bytes to the end of the file f from buf. More...
 
size_t File_Namespace::readPage (FILE *f, const size_t pageSize, const size_t pageNum, int8_t *buf)
 Reads the specified page from the file f into buf. More...
 
size_t File_Namespace::writePage (FILE *f, const size_t pageSize, const size_t pageNum, int8_t *buf)
 Writes a page from buf to the file. More...
 
size_t File_Namespace::appendPage (FILE *f, const size_t pageSize, int8_t *buf)
 Appends a page from buf to the file. More...
 
size_t File_Namespace::fileSize (FILE *f)
 Returns the size of the specified file. More...
 
void File_Namespace::renameForDelete (const std::string directoryName)
 Renames a directory to DELETE_ME_<EPOCH>_<oldname>. More...
 

Detailed Description

A selection of helper methods for File I/O.

Author
Steven Stewart steve.nosp@m.@map.nosp@m.-d.co.nosp@m.m

Definition in file File.h.

Macro Definition Documentation

#define MAPD_FILE_EXT   ".mapd"
#define MAX_FILE_N_METADATA_PAGES   4096
#define MAX_FILE_N_PAGES   256