FastLED 3.10.8
Loading...
Searching...
No Matches
ostream.cpp.hpp
Go to the documentation of this file.
1#include "fl/stl/ostream.h"
2#include "fl/stl/charconv.h"
3#include "fl/gfx/crgb.h"
4
5namespace fl {
6
7// Global cout instance for immediate output.
8// FL_LINT_ALLOW_GLOBAL(public API surface — `fl::cout << x;` is called by name, cannot become `cout()` without a source-breaking API change. Migration deferred; see FastLED#3481 discussion of streams.)
10
11// FL_LINT_ALLOW_GLOBAL(stream manipulator tag `endl` — public API surface, empty struct, matches `hex`/`dec`/`oct` in ios.cpp.hpp)
13
15 string temp;
16 temp.append(rgb);
17 print(temp.c_str());
18 return *this;
19}
20
21// Numeric output operators with formatting support
23 char buf[64] = {0};
24 fl::itoa(static_cast<fl::i32>(n), buf, mBase);
25 print(buf);
26 return *this;
27}
28
30 char buf[64] = {0};
31 fl::utoa32(static_cast<fl::u32>(n), buf, mBase);
32 print(buf);
33 return *this;
34}
35
37 char buf[64] = {0};
38 fl::itoa(static_cast<fl::i32>(n), buf, mBase);
39 print(buf);
40 return *this;
41}
42
44 char buf[64] = {0};
45 fl::itoa(n, buf, mBase);
46 print(buf);
47 return *this;
48}
49
51 char buf[64] = {0};
52 fl::utoa32(n, buf, mBase);
53 print(buf);
54 return *this;
55}
56
57// Manipulator operator implementations (declared as friends in ostream)
59 os.mBase = 16;
60 return os;
61}
62
64 os.mBase = 10;
65 return os;
66}
67
69 os.mBase = 8;
70 return os;
71}
72
73} // namespace fl
const char * c_str() const FL_NO_EXCEPT
int mBase
Definition ostream.h:86
ostream & operator<<(const char *str) FL_NO_EXCEPT
Definition ostream.h:22
ostream()=default
string & append(const bitset_fixed< N > &bs) FL_NO_EXCEPT
Definition string.h:293
Defines the 8-bit red, green, and blue (RGB) pixel type in the fl namespace.
ostream cout
unsigned char u8
Definition stdint.h:131
int utoa32(u32 value, char *sp, int radix) FL_NO_EXCEPT
Convert unsigned 32-bit integer to string buffer in given radix.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
void print(const char *str) FL_NO_EXCEPT
const endl_t endl
ostream & operator<<(ostream &os, const hex_t &) FL_NO_EXCEPT
int itoa(i32 value, char *sp, int radix) FL_NO_EXCEPT
Convert signed 32-bit integer to string buffer in given radix.
signed char i8
Definition stdint.h:130
Base definition for an LED controller.
Definition crgb.hpp:179
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Definition crgb.h:38