ifm3d
util.h
1 // -*- c++ -*-
2 /*
3  * Copyright 2025-present ifm electronic, gmbh
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef IFM3D_COMMON_UTIL_H
8 #define IFM3D_COMMON_UTIL_H
9 
10 #include <iostream>
11 #include <string>
12 
13 #if defined(_MSC_VER)
14 # include <io.h>
15 # include <windows.h>
16 # define IFM3D_IS_A_TTY(stream) (!!_isatty(_fileno(stream)))
17 #else
18 # include <termios.h>
19 # include <unistd.h>
20 # define IFM3D_IS_A_TTY(stream) (!!isatty(fileno(stream)))
21 #endif
22 
23 namespace ifm3d
24 {
25  void stdin_echo(bool enable = true);
26  std::string read_password();
27 }
28 
29 #endif