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

OpenLightingProject / ola / 17141553775

21 Aug 2025 11:23PM UTC coverage: 45.72% (-0.02%) from 45.742%
17141553775

push

github

web-flow
Merge pull request #2014 from peternewman/mac-be

Tidy the Mac OS Endian behaviour

7586 of 17462 branches covered (43.44%)

22424 of 49046 relevant lines covered (45.72%)

53.43 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
/**
25
 * @brief An example StdinHandler.
26
 */
27
class ExampleStdinHandler {
×
28
 public:
29
  ExampleStdinHandler()
×
30
    : m_stdin_handler(&m_ss,
×
31
                      ola::NewCallback(this, &ExampleStdinHandler::Input)) {
×
32
  }
×
33

34
  void Run() { m_ss.Run(); }
×
35

36
 private:
37
  ola::io::SelectServer m_ss;
38
  ola::io::StdinHandler m_stdin_handler;
39

40
  void Input(int c);
41
};
42

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

54
int main(int argc, char* argv[]) {
×
55
  ola::AppInit(&argc, argv, "", "Example Stdin Handler");
×
56

57
  ExampleStdinHandler handler;
×
58
  handler.Run();
×
59
}
×
60
//! [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