ALib C++ Library
by
Library Version:
2412 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
lang
system
console.hpp
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header file is part of sub-namespace #alib::lang::system of module \alib_basecamp of
4
/// the \aliblong.
5
///
6
/// \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
7
/// Published under \ref mainpage_license "Boost Software License".
8
//==================================================================================================
9
#ifndef HPP_ALIB_LANG_SYSTEM_CONSOLE
10
#define HPP_ALIB_LANG_SYSTEM_CONSOLE 1
11
#pragma once
12
#if !defined(DOXYGEN)
13
# include "
alib/alib.hpp
"
14
#endif
15
16
ALIB_ASSERT_MODULE
(CAMP)
17
18
namespace
alib
{
namespace
lang::system {
19
20
//==================================================================================================
21
/// This class provides system dependent features in respect the console attached to a process.
22
//==================================================================================================
23
class
Console
24
{
25
protected
:
26
/// Console text width.
27
ALIB_API
static
28
int
lastReceivedWidth
;
29
30
public
:
31
//==========================================================================================
32
/// Tries to detect the current width of the console. Returns \c 0 in case of failure.
33
///
34
/// @param forceRedetect If \c true, the console size is tried to be detected, even if it
35
/// had been done before (and even if it failed before).<br>
36
/// Defaults to \c false.
37
///
38
/// @return The console width.
39
//==========================================================================================
40
ALIB_API
static
41
int
GetWidth
(
bool
forceRedetect =
false
);
42
};
43
44
}
// namespace alib[:: lang::system]
45
46
/// Type alias in namespace \b alib.
47
using
Console
=
lang::system::Console
;
48
49
}
// namespace [alib]
50
51
#endif
// HPP_ALIB_LANG_SYSTEM_CONSOLE
52
alib.hpp
alib::lang::system::Console
This class provides system dependent features in respect the console attached to a process.
Definition
console.hpp:24
alib::lang::system::Console::GetWidth
static ALIB_API int GetWidth(bool forceRedetect=false)
Definition
console.cpp:32
alib::lang::system::Console::lastReceivedWidth
static ALIB_API int lastReceivedWidth
Console text width.
Definition
console.hpp:28
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.hpp:223
ALIB_API
#define ALIB_API
Definition
alib.hpp:639
alib
Definition
alib.cpp:69