21 #ifndef COSA_IOSTREAM_HH 22 #define COSA_IOSTREAM_HH 33 static const int EOF = -1;
36 static const char CR[] PROGMEM;
37 static const char LF[] PROGMEM;
38 static const char CRLF[] PROGMEM;
49 } __attribute__((packed));
58 } __attribute__((packed));
146 virtual int puts(
const char* s);
164 virtual int write(
const void* buf,
size_t size);
173 virtual int write_P(
const void* buf,
size_t size);
214 virtual char*
gets(
char *s,
size_t count);
223 virtual int read(
void* buf,
size_t size);
244 virtual void empty();
368 void print(
unsigned int value, uint8_t digits,
Base base);
376 void print(
unsigned long int value, uint8_t digits,
Base base);
388 void print(
double value, int8_t
width, uint8_t prec);
398 void print(uint32_t src,
const void *ptr,
size_t size,
399 Base base =
dec, uint8_t max = 16);
408 void print(
const void *ptr,
size_t size,
409 Base base =
dec, uint8_t max = 16)
411 print((uint32_t) ptr, ptr, size, base, max);
438 __attribute__((always_inline))
448 __attribute__((always_inline))
459 __attribute__((always_inline))
468 __attribute__((always_inline))
490 va_start(args, format);
505 __attribute__((always_inline))
517 char*
scan(
char *s,
size_t count);
530 char*
readline(
char* buf,
size_t size,
bool echo =
true);
547 return (func(*
this));
707 #if !defined(COSA_IOSTREAM_STDLIB_DTOA) 709 static char*
ultoa(
unsigned long __val,
char *__s,
int base);
710 static char*
ltoa(
long __val,
char *__s,
int base);
711 static char*
utoa(
unsigned int __val,
char *__s,
int base);
712 static char*
itoa(
int __val,
char *__s,
int base);
IOStream &(* Manipulator)(IOStream &)
virtual int write_P(const void *buf, size_t size)
char * scan(char *s, size_t count)
virtual int putchar(char c)
virtual int puts(const char *s)
IOStream & ends(IOStream &outs)
IOStream & operator<<(const iovec_t *vec)
IOStream & operator<<(IOStream &buffer)
void print(int value, Base base=dec)
int8_t m_width
Minimum width of output string.
virtual int write(const void *buf, size_t size)
virtual int read(void *buf, size_t size)
IOStream & operator<<(void *ptr)
IOStream & operator<<(str_P s)
IOStream & operator<<(int n)
IOStream & operator<<(Manipulator func)
IOStream & operator<<(const void *ptr)
IOStream & tab(IOStream &outs)
uint8_t precision(uint8_t value)
static char * ltoa(long __val, char *__s, int base)
void print(const void *ptr, size_t size, Base base=dec, uint8_t max=16)
IOStream & operator<<(unsigned long int n)
void printf(str_P format,...)
int8_t width(int8_t value)
void print_prefix(Base base)
IOStream & operator<<(unsigned int n)
char * readline(char *buf, size_t size, bool echo=true)
IOStream & operator<<(const char *s)
const class prog_str * str_P
static char * itoa(int __val, char *__s, int base)
static char * utoa(unsigned int __val, char *__s, int base)
IOStream & operator<<(long int n)
Base m_base
Base for next output operator.
IOStream & endl(IOStream &outs)
IOStream & operator<<(char c)
virtual char * gets(char *s, size_t count)
IOStream & operator<<(char *s)
void print(const char *s)
IOStream & clear(IOStream &outs)
IOStream & operator<<(double n)
Device * m_dev
Delegated device.
Device * device(Device *dev)
static const size_t BUF_MAX
void print(const void *ptr)
void vprintf(str_P format, va_list args)
str_P m_eols
End of line string (program memory).
uint8_t m_prec
Number of digits after decimal sign.
static char * ultoa(unsigned long __val, char *__s, int base)