Provides formatted output to stream. More...
#include <Print.h>
Public Member Functions | |||||||
virtual | ~Print () | ||||||
int | getWriteError () | ||||||
Gets last error. More... | |||||||
void | clearWriteError () | ||||||
Clears the last write error. More... | |||||||
virtual size_t | write (uint8_t c)=0 | ||||||
Writes a single character to output stream. More... | |||||||
size_t | write (const char *str) | ||||||
Writes a c-string to output stream. More... | |||||||
virtual size_t | write (const uint8_t *buffer, size_t size) | ||||||
Writes characters from a buffer to output stream. More... | |||||||
size_t | write (const char *buffer, size_t size) | ||||||
Writes characters from a buffer to output stream. More... | |||||||
size_t | print (char c) | ||||||
Prints a single character to output stream. More... | |||||||
size_t | print (const char str[]) | ||||||
Prints a c-string to output stream. More... | |||||||
size_t | print (double num, int digits=2) | ||||||
Print a floating-point number to output stream. More... | |||||||
size_t | print (const Printable &p) | ||||||
Prints a Printable object to output stream. More... | |||||||
size_t | print (const String &s) | ||||||
Prints a String to output stream. More... | |||||||
size_t | println () | ||||||
Prints a newline to output stream. More... | |||||||
size_t | println (const char str[]) | ||||||
Prints a c-string to output stream, appending newline. More... | |||||||
size_t | println (char c) | ||||||
Prints a single character to output stream, appending newline. More... | |||||||
size_t | println (double num, int digits=2) | ||||||
Print a floating-point number to output stream, appending newline. More... | |||||||
size_t | println (const Printable &p) | ||||||
Prints a Printable object to output stream, appending newline. More... | |||||||
size_t | println (const String &s) | ||||||
Prints a String to output stream, appending newline. More... | |||||||
size_t | printf (const char *fmt,...) __attribute__((format(printf | ||||||
Prints a formatted c-string to output stream. More... | |||||||
Print an integral number to output stream | |||||||
| |||||||
size_t | print (unsigned long num, int base=DEC) | ||||||
size_t | print (const unsigned long long &num, int base=DEC) | ||||||
size_t | print (long, int base=DEC) | ||||||
size_t | print (const long long &, int base=DEC) | ||||||
size_t | print (unsigned int num, int base=DEC) | ||||||
size_t | print (unsigned char num, int base=DEC) | ||||||
size_t | print (int num, int base=DEC) | ||||||
Print an integral number to output stream, appending newline | |||||||
| |||||||
size_t | println (unsigned char num, int base=DEC) | ||||||
size_t | println (unsigned int num, int base=DEC) | ||||||
size_t | println (unsigned long num, int base=DEC) | ||||||
size_t | println (const unsigned long long &num, int base=DEC) | ||||||
size_t | println (int num, int base=DEC) | ||||||
size_t | println (long num, int base=DEC) | ||||||
size_t | println (const long long &num, int base=DEC) | ||||||
Protected Member Functions | |
void | setWriteError (int err=1) |
Detailed Description
Provides formatted output to stream.
Constructor & Destructor Documentation
◆ ~Print()
|
inlinevirtual |
Member Function Documentation
◆ clearWriteError()
|
inline |
Clears the last write error.
◆ getWriteError()
|
inline |
Gets last error.
- Return values
-
int Error number of last write error
◆ print() [1/12]
|
inline |
Prints a single character to output stream.
- Parameters
-
c Character to print
- Return values
-
size_t Quantity of characters written to stream
◆ print() [2/12]
|
inline |
Prints a c-string to output stream.
- Parameters
-
str c-string to print
- Return values
-
size_t Quantity of characters written to output stream
◆ print() [3/12]
◆ print() [4/12]
◆ print() [5/12]
◆ print() [6/12]
◆ print() [7/12]
◆ print() [8/12]
◆ print() [9/12]
◆ print() [10/12]
|
inline |
Print a floating-point number to output stream.
- Parameters
-
num Number to print digits The decimal places to print (Default: 2, e.g. 21.35)
- Return values
-
size_t Quantity of characters written to stream
◆ print() [11/12]
|
inline |
Prints a Printable object to output stream.
- Parameters
-
p Object to print
- Return values
-
size_t Quantity of characters written to stream
◆ print() [12/12]
|
inline |
◆ printf()
size_t Print::printf | ( | const char * | fmt, |
... | |||
) |
Prints a formatted c-string to output stream.
- Parameters
-
fmt Pointer to formated c-string to print ... Parameters for placeholders within formated string
- Return values
-
size_t Quantity of characters written to stream
- Note
- Use standard printf placeholders, e.g. d for integer, s for c-string, etc.
◆ println() [1/13]
|
inline |
Prints a newline to output stream.
- Return values
-
size_t Quantity of characters written to stream
◆ println() [2/13]
|
inline |
Prints a c-string to output stream, appending newline.
- Parameters
-
str c-string to print
- Return values
-
size_t Quantity of characters written to stream
◆ println() [3/13]
|
inline |
Prints a single character to output stream, appending newline.
- Parameters
-
c Character to print
- Return values
-
size_t Quantity of characters written to stream
◆ println() [4/13]
◆ println() [5/13]
◆ println() [6/13]
◆ println() [7/13]
◆ println() [8/13]
◆ println() [9/13]
◆ println() [10/13]
◆ println() [11/13]
|
inline |
Print a floating-point number to output stream, appending newline.
- Parameters
-
num Number to print digits The decimal places to print (Default: 2, e.g. 21.35)
- Return values
-
size_t Quantity of characters written to stream
◆ println() [12/13]
|
inline |
Prints a Printable object to output stream, appending newline.
- Parameters
-
p Object to print
- Return values
-
size_t Quantity of characters written to stream
◆ println() [13/13]
|
inline |
◆ setWriteError()
|
inlineprotected |
◆ write() [1/4]
|
pure virtual |
Writes a single character to output stream.
- Parameters
-
c Character to write to output stream
- Return values
-
size_t Quantity of characters written to output stream
Implemented in IDataSourceStream, DebugClass, CircularBuffer, TwoWire, CommandOutput, and ReadWriteStream.
◆ write() [2/4]
|
inline |
Writes a c-string to output stream.
- Parameters
-
str Pointer to c-string
- Return values
-
size_t Quantity of characters written to stream
◆ write() [3/4]
|
virtual |
Writes characters from a buffer to output stream.
- Parameters
-
buffer Pointer to character buffer size Quantity of characters to write
- Return values
-
size_t Quantity of characters written to stream
Reimplemented in HardwareSerial, CircularBuffer, OtaUpgrade::BasicStream, LimitedMemoryStream, MemoryDataStream, IFS::FileStream, TwoWire, EndlessMemoryStream, Storage::PartitionStream, OtaUpgrade::EncryptedStream, and ReadWriteStream.
◆ write() [4/4]
|
inline |
Writes characters from a buffer to output stream.
- Parameters
-
buffer Pointer to character buffer size Quantity of characters to write
- Return values
-
size_t Quantity of characters written to stream
The documentation for this class was generated from the following file: