sta-core/include/sta/debug/printing/printable_printf.hpp

40 lines
1006 B
C++

#ifndef STA_CORE_PRINTABLE_PRINTF_HPP
#define STA_CORE_PRINTABLE_PRINTF_HPP
#include <sta/debug/printing/printable.hpp>
namespace sta
{
/**
* @brief A formatted printable class that prints to stdout.
*
* @ingroup sta_core
*/
class PrintablePrintf : public Printable
{
public:
/**
* @brief Construct a new Printable Printf object
*/
PrintablePrintf();
/**
* @brief Print string.
*
* @param str String buffer
* @param length String length
* @param newline If true, send a \r\n to start a new line.
*/
void print(const char * str, size_t length, bool newline = false) override;
/**
* @brief Read bytes.
*
* @param buffer Byte buffer
* @param length Buffer length
*/
void read(uint8_t * buffer, size_t length) override;
};
} // namespace sta
#endif // STA_CORE_PRINTABLE_PRINTF_HPP