Numworks Epsilon
1.4.1
Graphing Calculator Operating System
console_line.cpp
Go to the documentation of this file.
1
#include <
ion.h
>
2
3
namespace
Ion
{
4
namespace
Console {
5
6
char
readChar
();
7
void
writeChar
(
char
c
);
8
9
void
writeLine
(
const
char
* line) {
10
while
(*line != 0) {
11
writeChar
(*line++);
12
}
13
writeChar
(
'\r'
);
14
writeChar
(
'\n'
);
15
}
16
17
void
readLine
(
char
* line,
int
maxLineLength) {
18
if
(maxLineLength <= 0) {
19
return
;
20
}
21
char
* cursor = line;
22
char
* last = line+maxLineLength-1;
23
while
(
true
) {
24
*cursor =
readChar
();
25
if
(*cursor ==
'\r'
|| cursor == last) {
26
*cursor = 0;
27
return
;
28
}
29
cursor++;
30
}
31
}
32
33
}
34
}
Ion::Console::readChar
char readChar()
Definition:
console.cpp:10
ion.h
Ion::Console::writeLine
void writeLine(const char *line)
Definition:
console_line.cpp:9
c
c(generic_all_nodes)
Ion::Console::readLine
void readLine(char *line, int maxLineLength)
Definition:
console_line.cpp:17
Ion::Console::writeChar
void writeChar(char c)
Definition:
console.cpp:16
Ion
Definition:
backlight.h:6
epsilon
ion
src
shared
console_line.cpp
Generated by
1.8.14