]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/api/Stream.h
1 /* mbed Microcontroller Library
2 * Copyright (c) 2006-2013 ARM Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
24 extern void mbed_set_unbuffered_stream(FILE *_file
);
25 extern int mbed_getc(FILE *_file
);
26 extern char* mbed_gets(char *s
, int size
, FILE *_file
);
28 class Stream
: public FileLike
{
31 Stream(const char *name
=NULL
);
35 int puts(const char *s
);
37 char *gets(char *s
, int size
);
38 int printf(const char* format
, ...);
39 int scanf(const char* format
, ...);
41 operator std::FILE*() {return _file
;}
45 virtual ssize_t
write(const void* buffer
, size_t length
);
46 virtual ssize_t
read(void* buffer
, size_t length
);
47 virtual off_t
lseek(off_t offset
, int whence
);
52 virtual int _putc(int c
) = 0;
53 virtual int _getc() = 0;
57 /* disallow copy constructor and assignment operators */
59 Stream(const Stream
&);
60 Stream
& operator = (const Stream
&);