summaryrefslogtreecommitdiff
path: root/src/srcut.cpp
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-09-29 16:43:33 +0200
committerThomas Schmucker <ts@its1.de>2020-09-29 16:43:33 +0200
commitf5a84b3c53ee37d83c33e9a6ad73b99866efcdc1 (patch)
tree94581241ed6a8dc804c0b846ce65b45b25edac83 /src/srcut.cpp
downloadscissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.tar.gz
scissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.tar.bz2
scissor-f5a84b3c53ee37d83c33e9a6ad73b99866efcdc1.zip
erster checkin
Diffstat (limited to 'src/srcut.cpp')
-rw-r--r--src/srcut.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/srcut.cpp b/src/srcut.cpp
new file mode 100644
index 0000000..194cc65
--- /dev/null
+++ b/src/srcut.cpp
@@ -0,0 +1,34 @@
1#include <fstream>
2#include <iostream>
3#include <string>
4
5using namespace std;
6
7static void
8process(istream& in, ostream& os)
9{
10 auto match_begin = [](string_view s) -> bool {
11 return s.empty();
12 };
13
14 auto match_end = [](string_view s) -> bool {
15 return s.empty();
16 };
17
18 for ( string line; getline(in, line); ) {
19 if ( match_begin(line) ) {
20 }
21 else if ( match_end(line) ) {
22 }
23 else {
24 os << line << '\n';
25 }
26 }
27 os << flush;
28}
29
30int
31main(void)
32{
33 process(cin);
34}