20#include "platform/platform.h"
21#include "platform/FileLike.h"
22#include "platform/NonCopyable.h"
23#include "platform/mbed_toolchain.h"
36extern void mbed_set_unbuffered_stream(std::FILE *_file);
45 Stream(
const char *name = NULL);
48#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
50 int puts(
const char *s);
52 char *gets(
char *s,
int size);
53 int printf(
const char *format, ...) MBED_PRINTF_METHOD(1, 2);
54 int scanf(
const char *format, ...) MBED_SCANF_METHOD(1, 2);
55 int vprintf(
const char *format, std::va_list args) MBED_PRINTF_METHOD(1, 0);
56 int vscanf(
const char *format, std::va_list args) MBED_SCANF_METHOD(1, 0);
58 operator std::FILE *()
65 virtual ssize_t
write(
const void *buffer,
size_t length);
66 virtual ssize_t
read(
void *buffer,
size_t length);
67 virtual off_t
seek(off_t offset,
int whence);
75 virtual int _putc(
int c) = 0;
76 virtual int _getc() = 0;
78#if !MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY
Prevents generation of copy constructor and copy assignment operator in derived classes.
virtual off_t seek(off_t offset, int whence)
Move the file position to a given offset from from a given location.
virtual ssize_t write(const void *buffer, size_t length)
Write the contents of a buffer to a file.
virtual int close()
Close a file.
virtual ssize_t read(void *buffer, size_t length)
Read the contents of a file into a buffer.
virtual off_t tell()
Get the file position of the file.
virtual int isatty()
Check if the file in an interactive terminal device.
virtual int sync()
Flush any buffers associated with the file.
virtual off_t size()
Get the size of the file.
virtual void lock()
Acquire exclusive access to this object.
virtual void unlock()
Release exclusive access to this object.
virtual void rewind()
Rewind the file position to the beginning of the file.