Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Enumerations | Functions
IoUtils Namespace Reference


enum  Mode { APPEND, TRUNCATE }


bool pathExists (const std::string &path)
std::ofstream openOutput (const std::string &path, Mode mode=TRUNCATE)
int writeTextFile (const std::string &path, const std::string &content, Mode mode=TRUNCATE)
std::string readTextFile (const std::string &path)

Detailed Description

Utilities to perform file I/O.

Enumeration Type Documentation


When opening a file for writing, append to the existing content of the file.


When opening a file for writing, truncate the existing content of the file.

Function Documentation

bool IoUtils::pathExists ( const std::string &  path)

Check if path exists.

std::ofstream IoUtils::openOutput ( const std::string &  path,
Mode  mode = TRUNCATE 

Open a file for output.

int IoUtils::writeTextFile ( const std::string &  path,
const std::string &  content,
Mode  mode = TRUNCATE 

Write a string to a file.

std::string IoUtils::readTextFile ( const std::string &  path)

Read a text file as a string.