Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
Loading...
Searching...
No Matches
IoUtils Namespace Reference

Enumerations

enum  Mode { APPEND , TRUNCATE }

Functions

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

◆ Mode

Enumerator
APPEND 

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

TRUNCATE 

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

Function Documentation

◆ pathExists()

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

Check if path exists.

◆ openOutput()

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

Open a file for output.

◆ writeTextFile()

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

Write a string to a file.

◆ readTextFile()

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

Read a text file as a string.