Class FileCallbackCloser

Class Documentation

class FileCallbackCloser

A class to provide callback-based file closure, to avoid passing filenames though classes where they don’t belong.

Public Types

typedef std::function<void(const std::string&)> ClosingFn

Public Static Functions

static void onClose(ClosingFn fn)

Adds a callback function which will be executed when the close function is called.

Parameters:

fn – the function to be called on file closure

static void close(const std::string &fileName)

Closes the given filename be calling all onClose callbacks.

Parameters:

filename – the filename to be closed.

static void clearAllClose()

Clears all onClose functions