SdFat
Macros | Functions
PrintTemplates.h File Reference

templates for printf More...

#include <stdarg.h>
#include "FmtNumber.h"
Include dependency graph for PrintTemplates.h:

Macros

#define isDigit(d)   ('0' <= (d) && (d) <= '9')
 
#define PRINTF_USE_FLOAT   2
 

Functions

template<typename T >
int fprintf (T *file, const char *fmt,...)
 
template<typename F >
int mprintf (F *file, const __FlashStringHelper *ifsh,...)
 
template<typename T >
int mprintf (T *file, const char *fmt,...)
 
template<typename F >
int vfprintf (F *file, const char *fmt, va_list ap)
 
template<typename F >
int vmprintf (F *file, const char *fmt, va_list ap)
 

Detailed Description

templates for printf

Copyright (c) 2011-2019 Bill Greiman This file is part of the SdFat library for SD memory cards.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Macro Definition Documentation

◆ isDigit

#define isDigit (   d)    ('0' <= (d) && (d) <= '9')

test for digit

◆ PRINTF_USE_FLOAT

#define PRINTF_USE_FLOAT   2

control for supported floating formats

Function Documentation

◆ fprintf()

template<typename T >
int fprintf ( T *  file,
const char *  fmt,
  ... 
)

Formatted print.

Parameters
[in]filedestination file or device.
[in]fmtformat string.
Returns
number of character printed for success else a negative value.

◆ mprintf() [1/2]

template<typename F >
int mprintf ( F file,
const __FlashStringHelper *  ifsh,
  ... 
)

Minimal formatted print.

Parameters
[in]filedestination file or device.
[in]ifshformat string using F() macro.
Returns
number of character printed for success else a negative value.

◆ mprintf() [2/2]

template<typename T >
int mprintf ( T *  file,
const char *  fmt,
  ... 
)

Minimal formatted print.

Parameters
[in]filedestination file or device.
[in]fmtformat string.
Returns
number of character printed for success else a negative value.

◆ vfprintf()

template<typename F >
int vfprintf ( F file,
const char *  fmt,
va_list  ap 
)

Formatted print.

Parameters
[in]filedestination file or device.
[in]fmtformat string.
[in]apargument list.
Returns
number of character printed for success else a negative value.

◆ vmprintf()

template<typename F >
int vmprintf ( F file,
const char *  fmt,
va_list  ap 
)

Minimal formatted print.

Parameters
[in]filedestination file or device.
[in]fmtformat string.
[in]apargument list.
Returns
number of character printed for success else a negative value.