NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Namespaces | Functions
be_io_utility.h File Reference
#include <sys/stat.h>
#include <cstdint>
#include <fstream>
#include <string>
#include <be_error_exception.h>
#include <be_memory_autoarray.h>
#include <be_sysdeps.h>

Go to the source code of this file.

Namespaces

namespace  BiometricEvaluation
 This software was developed at the National Institute of Standards and Technology (NIST) by employees of the Federal Government in the course of their official duties.
 
namespace  BiometricEvaluation::IO
 Input/Output functionality.
 
namespace  BiometricEvaluation::IO::Utility
 A class containing utility functions used for IO operations.
 

Functions

void BiometricEvaluation::IO::Utility::removeDirectory (const std::string &directory, const std::string &prefix)
 Remove a directory using directory name and parent pathname. More...
 
void BiometricEvaluation::IO::Utility::removeDirectory (const std::string &pathname)
 Remove a directory using a complete pathname. More...
 
void BiometricEvaluation::IO::Utility::copyDirectoryContents (const std::string &sourcepath, const std::string &targetpath, const bool removesource=false)
 Copy the contents of a directory, optionally deleting the source directory contents when done. More...
 
void BiometricEvaluation::IO::Utility::setAsideName (const std::string &name)
 Set aside a file or directory name. More...
 
uint64_t BiometricEvaluation::IO::Utility::getFileSize (const std::string &pathname)
 Get the size of a file. More...
 
uint64_t BiometricEvaluation::IO::Utility::sumDirectoryUsage (const std::string &pathname)
 Get the sum of the sizes of all files and directories in a given path. More...
 
bool BiometricEvaluation::IO::Utility::fileExists (const std::string &pathname)
 Indicate whether a file exists. More...
 
bool BiometricEvaluation::IO::Utility::pathIsDirectory (const std::string &pathname)
 
int BiometricEvaluation::IO::Utility::makePath (const std::string &path, const mode_t mode)
 Create an entire directory tree. More...
 
Memory::uint8Array BiometricEvaluation::IO::Utility::readFile (const std::string &path, std::ios_base::openmode mode=std::ios_base::binary)
 Read the contents of a file into an 8-bit AutoArray. More...
 
void BiometricEvaluation::IO::Utility::writeFile (const uint8_t *data, const size_t size, const std::string &path, std::ios_base::openmode mode=std::ios_base::binary)
 Write the contents of a buffer to a file. More...
 
void BiometricEvaluation::IO::Utility::writeFile (const Memory::uint8Array data, const std::string &path, std::ios_base::openmode mode=std::ios_base::binary)
 Write the contents of an 8-bit AutoArray to a file. More...
 
void BiometricEvaluation::IO::Utility::readPipe (void *data, size_t size, int pipeFD)
 Read from an open pipe into a buffer. More...
 
void BiometricEvaluation::IO::Utility::readPipe (Memory::uint8Array &data, int pipeFD)
 Read from an open pipe into an 8-bit AutoArray. More...
 
void BiometricEvaluation::IO::Utility::writePipe (const void *data, size_t size, int pipeFD)
 Write the contents of a buffer to a pipe. More...
 
void BiometricEvaluation::IO::Utility::writePipe (const Memory::uint8Array &data, int pipeFD)
 Write the contents of an 8-bit AutoArray to a pipe. More...
 
bool BiometricEvaluation::IO::Utility::isReadable (const std::string &pathname)
 Determine if the real user has read access permissions to this file. More...
 
bool BiometricEvaluation::IO::Utility::isWritable (const std::string &pathname)
 Determine if the real user has write access permissions to this file. More...
 
std::string BiometricEvaluation::IO::Utility::createTemporaryFile (const std::string &prefix="", const std::string &parentDir="/tmp")
 Create a temporary file. More...
 
FILE * BiometricEvaluation::IO::Utility::createTemporaryFile (std::string &path, const std::string &prefix="", const std::string &parentDir="/tmp")
 Create a temporary file. More...
 
uint64_t BiometricEvaluation::IO::Utility::countLines (const std::string &path)
 Count the number of newline characters in a text file. More...
 
uint64_t BiometricEvaluation::IO::Utility::countLines (const Memory::uint8Array &textBuffer)
 Count the number of newline characters in a buffer of a text file. More...