SdFat

Public Member Functions | List of all members
BufferedPrint< WriteClass, BUF_DIM > Class Template Reference

Fast buffered print template. More...

`#include <BufferedPrint.h>`

## Public Member Functions
void | begin (WriteClass *wr)
| BufferedPrint (WriteClass *wr)
void | flush ()
size_t | print (double d, uint8_t prec=2)
size_t | print (float f, uint8_t prec=2)
template<typename Type >
size_t | print (Type v)
size_t | printField (char c, char term)
size_t | printField (const __FlashStringHelper *fsh, char term)
size_t | printField (const char *str, char term)
size_t | printField (double d, char term, uint8_t prec=2)
size_t | printField (float f, char term, uint8_t prec=2)
template<typename Type >
size_t | printField (Type n, char term)
size_t | println ()
size_t | println (double d, uint8_t prec=2)
size_t | println (float f, uint8_t prec)
template<typename Type >
size_t | println (Type v)
bool | sync ()
size_t | write (const void *src, size_t n)

## Detailed Description

### template<typename WriteClass, uint8_t BUF_DIM>
class BufferedPrint< WriteClass, BUF_DIM >

Fast buffered print template.

## Constructor & Destructor Documentation

## ◆ BufferedPrint()

template<typename WriteClass , uint8_t BUF_DIM>

BufferedPrint< WriteClass, BUF_DIM >::BufferedPrint | ( | WriteClass * | wr | ) |
| inline explicit

BufferedPrint constructor.

Parameters

  [in] | wr | Print destination.

## Member Function Documentation

## ◆ begin()

template<typename WriteClass , uint8_t BUF_DIM>

void BufferedPrint< WriteClass, BUF_DIM >::begin | ( | WriteClass * | wr | ) |
| inline

Initialize the BuffedPrint class.

Parameters

  [in] | wr | Print destination.

## ◆ flush()

template<typename WriteClass , uint8_t BUF_DIM>

void BufferedPrint< WriteClass, BUF_DIM >::flush | ( |  | ) |
| inline

Flush the buffer - same as sync() with no status return.

## ◆ print() [1/3]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::print | ( | double | d,
|  | uint8_t | prec = `2`
| ) |  |
| inline

Print a double.

Parameters

  [in] | d | The number to be printed.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ print() [2/3]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::print | ( | float | f,
|  | uint8_t | prec = `2`
| ) |  |
| inline

Print a float.

Parameters

  [in] | f | The number to be printed.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ print() [3/3]

template<typename WriteClass , uint8_t BUF_DIM>
template<typename Type >

size_t BufferedPrint< WriteClass, BUF_DIM >::print | ( | Type | v | ) |
| inline

Print character, string, or number.

Parameters

  [in] | v | item to print.

Returns
  true for success or false if an error occurs.

## ◆ printField() [1/6]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | char | c,
|  | char | term
| ) |  |
| inline

Print a character followed by a field terminator.

Parameters

  [in] | c | character to print.
  [in] | term | The field terminator. Use '\n' for CR LF.

Returns
  true for success or false if an error occurs.

## ◆ printField() [2/6]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | const __FlashStringHelper * | fsh,
|  | char | term
| ) |  |
| inline

Print a string stored in AVR flash followed by a field terminator.

Parameters

  [in] | fsh | string to print.
  [in] | term | The field terminator. Use '\n' for CR LF.

Returns
  true for success or false if an error occurs.

## ◆ printField() [3/6]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | const char * | str,
|  | char | term
| ) |  |
| inline

Print a string followed by a field terminator.

Parameters

  [in] | str | string to print.
  [in] | term | The field terminator. Use '\n' for CR LF.

Returns
  true for success or false if an error occurs.

## ◆ printField() [4/6]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | double | d,
|  | char | term,
|  | uint8_t | prec = `2`
| ) |  |
| inline

Print a double followed by a field terminator.

Parameters

  [in] | d | The number to be printed.
  [in] | term | The field terminator. Use '\n' for CR LF.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ printField() [5/6]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | float | f,
|  | char | term,
|  | uint8_t | prec = `2`
| ) |  |
| inline

Print a float followed by a field terminator.

Parameters

  [in] | f | The number to be printed.
  [in] | term | The field terminator. Use '\n' for CR LF.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ printField() [6/6]

template<typename WriteClass , uint8_t BUF_DIM>
template<typename Type >

size_t BufferedPrint< WriteClass, BUF_DIM >::printField | ( | Type | n,
|  | char | term
| ) |  |
| inline

Print an integer value for 8, 16, and 32 bit signed and unsigned types.

Parameters

  [in] | n | The value to print.
  [in] | term | The field terminator. Use '\n' for CR LF.

Returns
  true for success or false if an error occurs.

## ◆ println() [1/4]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::println | ( |  | ) |
| inline

Print CR LF.

Returns
  true for success or false if an error occurs.

## ◆ println() [2/4]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::println | ( | double | d,
|  | uint8_t | prec = `2`
| ) |  |
| inline

Print a double followed by CR LF.

Parameters

  [in] | d | The number to be printed.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ println() [3/4]

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::println | ( | float | f,
|  | uint8_t | prec
| ) |  |
| inline

Print a float followed by CR LF.

Parameters

  [in] | f | The number to be printed.
  [in] | prec | Number of digits after decimal point.

Returns
  true for success or false if an error occurs.

## ◆ println() [4/4]

template<typename WriteClass , uint8_t BUF_DIM>
template<typename Type >

size_t BufferedPrint< WriteClass, BUF_DIM >::println | ( | Type | v | ) |
| inline

Print character, string, or number followed by CR LF.

Parameters

  [in] | v | item to print.

Returns
  true for success or false if an error occurs.

## ◆ sync()

template<typename WriteClass , uint8_t BUF_DIM>

bool BufferedPrint< WriteClass, BUF_DIM >::sync | ( |  | ) |
| inline

Flush the buffer.

Returns
  true for success or false if an error occurs.

## ◆ write()

template<typename WriteClass , uint8_t BUF_DIM>

size_t BufferedPrint< WriteClass, BUF_DIM >::write | ( | const void * | src,
|  | size_t | n
| ) |  |
| inline

Write data to an open file.

Parameters

  [in] | src | Pointer to the location of the data to be written.
  [in] | n | Number of bytes to write.

Returns
  For success write() returns the number of bytes written, always n.

The documentation for this class was generated from the following file:

- Arduino/libraries/SdFat/src/BufferedPrint.h