LCOV - code coverage report
Current view: top level - src/AH/PrintStream - PrintStream.hpp (source / functions) Hit Total Coverage
Test: e224b347cd670555e44f06608ac41bd1ace9d9d8 Lines: 4 4 100.0 %
Date: 2020-09-08 17:44:46 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             :  * @brief   [PrintStream library](https://github.com/tttapa/Arduino-PrintStream/blob/6a9e0d365be0b3d84187daa2a8a7bda8d541472e/src/PrintStream.h)
       3             :  */
       4             : 
       5             : #ifndef PrintStream_h
       6             : #define PrintStream_h
       7             : 
       8             : #include<AH/Settings/NamespaceSettings.hpp>
       9             : #include <AH/Settings/Warnings.hpp>
      10             : AH_DIAGNOSTIC_WERROR() // Enable errors on warnings
      11             : 
      12             : AH_DIAGNOSTIC_EXTERNAL_HEADER()
      13             : #include <AH/Arduino-Wrapper.h> // Print
      14             : AH_DIAGNOSTIC_POP()
      15             : 
      16             : BEGIN_AH_NAMESPACE
      17             : 
      18             : /// @addtogroup  AH_PrintStream
      19             : /// @{
      20             : 
      21             : typedef Print &manipulator(Print &);
      22             : 
      23             : Print &endl(Print &printer);
      24             : Print &flush(Print &printer);
      25             : Print &hex(Print &printer);
      26             : Print &bin(Print &printer);
      27             : Print &dec(Print &printer);
      28             : /* Print &oct(Print &printer); */
      29             : Print &boolalpha(Print &printer);
      30             : Print &noboolalpha(Print &printer);
      31             : Print &leadingzeros(Print &printer);
      32             : Print &noleadingzeros(Print &printer);
      33             : Print &uppercase(Print &printer);
      34             : Print &nouppercase(Print &printer);
      35             : Print &showbase(Print &printer);
      36             : Print &noshowbase(Print &printer);
      37             : 
      38             : Print &operator<<(Print &printer, const __FlashStringHelper *s);
      39             : #ifdef ARDUINO
      40             : Print &operator<<(Print &printer, const String &s);
      41             : #endif
      42             : Print &operator<<(Print &printer, const char s[]);
      43             : Print &operator<<(Print &printer, char c);
      44             : Print &operator<<(Print &printer, unsigned char c);
      45             : Print &operator<<(Print &printer, int i);
      46             : Print &operator<<(Print &printer, unsigned int i);
      47             : Print &operator<<(Print &printer, int8_t i);
      48             : Print &operator<<(Print &printer, long i);
      49             : Print &operator<<(Print &printer, unsigned long i);
      50             : Print &operator<<(Print &printer, double d);
      51             : Print &operator<<(Print &printer, const Printable &p);
      52             : Print &operator<<(Print &printer, bool b);
      53             : 
      54             : Print &operator<<(Print &printer, manipulator pf);
      55             : 
      56             : struct Setbase {
      57             :     uint8_t M_base;
      58             : };
      59             : Setbase setbase(uint8_t base);
      60             : Print &operator<<(Print &printer, Setbase f);
      61             : 
      62             : struct Setprecision {
      63             :     int M_n;
      64             : };
      65             : Setprecision setprecision(int n);
      66             : Print &operator<<(Print &printer, Setprecision f);
      67             : 
      68             : struct Setbytesep {
      69             :     char M_bytesep;
      70             : };
      71             : Setbytesep setbytesep(char bytesep);
      72             : Print &operator<<(Print &printer, Setbytesep f);
      73             : 
      74             : /// @}
      75             : 
      76             : #ifndef ARDUINO
      77             : 
      78             : #include <iomanip>
      79             : #include <iostream>
      80             : 
      81             : // TODO: check conflicts between Arduino version and C++ STL version
      82             : using std::endl;
      83             : // using std::setbase;
      84             : // using std::setprecision;
      85             : using std::boolalpha;
      86             : using std::dec;
      87             : using std::flush;
      88             : using std::hex;
      89             : using std::noboolalpha;
      90             : using std::noshowbase;
      91             : using std::nouppercase;
      92             : using std::showbase;
      93             : using std::uppercase;
      94             : 
      95           4 : inline std::ostream &operator<<(std::ostream &os, uint8_t u) {
      96             :     // I'm lazy, I should probably implement one for uint8_t to get the leading
      97             :     // zeros right
      98           4 :     return os << static_cast<unsigned short>(u);
      99             : }
     100             : 
     101          46 : inline std::ostream &operator<<(std::ostream &os,
     102             :                                 const __FlashStringHelper *s) {
     103          46 :     return os << reinterpret_cast<const char *>(s);
     104             : }
     105             : 
     106             : #endif
     107             : 
     108             : END_AH_NAMESPACE
     109             : 
     110             : AH_DIAGNOSTIC_POP()
     111             : 
     112             : #include <Settings/NamespaceSettings.hpp>
     113             : 
     114             : BEGIN_CS_NAMESPACE
     115             : using AH::operator<<;
     116             : using AH::manipulator;
     117             : using AH::endl;
     118             : using AH::flush;
     119             : using AH::hex;
     120             : using AH::bin;
     121             : using AH::dec;
     122             : using AH::boolalpha;
     123             : using AH::noboolalpha;
     124             : using AH::leadingzeros;
     125             : using AH::noleadingzeros;
     126             : using AH::uppercase;
     127             : using AH::nouppercase;
     128             : using AH::showbase;
     129             : using AH::noshowbase;
     130             : using AH::setbase;
     131             : using AH::setprecision;
     132             : using AH::setbytesep;
     133             : END_CS_NAMESPACE
     134             : 
     135             : #endif // PrintStream_h

Generated by: LCOV version 1.14-6-g40580cd