• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenLightingProject / ola / 16911433572

12 Aug 2025 02:08PM UTC coverage: 45.869% (-0.04%) from 45.909%
16911433572

Pull #1739

github

web-flow
Merge 02faeaa2d into 3566c28d9
Pull Request #1739: New web UI, store highest channel number used

7157 of 16316 branches covered (43.86%)

20915 of 45597 relevant lines covered (45.87%)

52.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/doxygen/examples/stdin_handler.cpp
1
/*
2
 * This program is free software; you can redistribute it and/or modify
3
 * it under the terms of the GNU General Public License as published by
4
 * the Free Software Foundation; either version 2 of the License, or
5
 * (at your option) any later version.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU Library General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15
 *
16
 * Copyright (C) 2015 Simon Newton
17
 */
18
//! [Example] NOLINT(whitespace/comments)
19
#include <ola/base/Init.h>
20
#include <ola/io/SelectServer.h>
21
#include <ola/io/StdinHandler.h>
22
#include <iostream>
23

24
class ExampleStdinHandler {
×
25
 public:
26
  ExampleStdinHandler()
×
27
    : m_stdin_handler(&m_ss,
×
28
                      ola::NewCallback(this, &ExampleStdinHandler::Input)) {
×
29
  }
×
30

31
  void Run() { m_ss.Run(); }
×
32

33
 private:
34
  ola::io::SelectServer m_ss;
35
  ola::io::StdinHandler m_stdin_handler;
36

37
  void Input(int c);
38
};
39

40
void ExampleStdinHandler::Input(int c) {
×
41
  switch (c) {
×
42
    case 'q':
×
43
      m_ss.Terminate();
×
44
      break;
×
45
    default:
×
46
      std::cout << "Got " << static_cast<char>(c) << " - " << c << std::endl;
×
47
      break;
×
48
  }
49
}
×
50

51
int main(int argc, char* argv[]) {
×
52
  ola::AppInit(&argc, argv, "", "Example Stdin Handler");
×
53

54
  ExampleStdinHandler handler;
×
55
  handler.Run();
×
56
}
×
57
//! [Example] NOLINT(whitespace/comments)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc