jaffarCommon
Loading...
Searching...
No Matches
Functions
stdio.hpp File Reference

Contains common functions related to output and logging using stdio. More...

#include "../string.hpp"
#include <stdarg.h>
#include <stdexcept>
#include <stdio.h>
Include dependency graph for stdio.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename... Args>
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::log (const char *f, Args... args)
 
__JAFFAR_COMMON__INLINE__ int jaffarCommon::logger::waitForKeyPress ()
 
__JAFFAR_COMMON__INLINE__ int jaffarCommon::logger::getKeyPress ()
 
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::initializeTerminal ()
 
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::clearTerminal ()
 
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::finalizeTerminal ()
 
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::refreshTerminal ()
 

Detailed Description

Contains common functions related to output and logging using stdio.

Function Documentation

◆ clearTerminal()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::clearTerminal ( )

Clears the NCurses terminal

◆ finalizeTerminal()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::finalizeTerminal ( )

Finalizes the NCurses terminal

◆ getKeyPress()

__JAFFAR_COMMON__INLINE__ int jaffarCommon::logger::getKeyPress ( )

Returns any pending key pressed.

Note
This function returns immediately
Returns
Which key was pressed, the macro ERR if no key was pressed

◆ initializeTerminal()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::initializeTerminal ( )

Initializes the NCurses terminal

◆ log()

template<typename... Args>
__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::log ( const char *  f,
Args...  args 
)

Prints the specified formatted string to the NCurses or normal terminal, as configured

Parameters
[in]fThe formatted string
[in]argsThe arguments to the formatted string

◆ refreshTerminal()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::logger::refreshTerminal ( )

Refreshes the NCurses terminal. This is necessary after every logging operation to update the screen.

◆ waitForKeyPress()

__JAFFAR_COMMON__INLINE__ int jaffarCommon::logger::waitForKeyPress ( )

Stalls execution until a key is pressed. It will only return upon the first key press and will report which key it was

Note
This function employs active polling so should be used sparringly
Returns
Which key was pressed