https://github.com/ttldtor/console
Cross-platform library of utilities for working with the console.
https://github.com/ttldtor/console
Last synced: 10 months ago
JSON representation
Cross-platform library of utilities for working with the console.
- Host: GitHub
- URL: https://github.com/ttldtor/console
- Owner: ttldtor
- License: bsl-1.0
- Created: 2023-09-27T09:54:14.000Z (almost 3 years ago)
- Default Branch: default
- Last Pushed: 2023-09-27T11:16:04.000Z (almost 3 years ago)
- Last Synced: 2024-12-25T16:41:03.380Z (over 1 year ago)
- Language: C++
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Console
Cross-platform library of utilities for working with the console.
[](https://github.com/ttldtor/Console/actions/workflows/build.yml)
[](https://github.com/ttldtor/Console/releases/latest)

[](https://github.com/ttldtor/Console/blob/default/LICENSE)
[](https://github.com/ttldtor/Console/releases/latest)
### Status:
* [x] Windows
* [x] Linux
* [x] MacOS
* [x] Termux
* [ ] FreeBSD
* [ ] OpenBSD
* [ ] AIX
* [ ] ...
### Example:
_**CMakeLists.txt:**_
```cmake
cmake_minimum_required(VERSION 3.20)
project(Test LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
set(CXX_EXTENSIONS OFF)
set(C_EXTENSIONS OFF)
include(FetchContent)
FetchContent_Declare(Console GIT_REPOSITORY "https://github.com/ttldtor/Console.git" GIT_TAG default)
FetchContent_MakeAvailable(Console)
add_executable(${PROJECT_NAME}
main.cpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE console::console)
```
**_main.cpp:_**
```cpp
#include
#include
using namespace org::ttldtor::console;
int main() {
auto consoleSize = Console::getSize();
std::cout << "Console size: " << consoleSize.first << " x " << consoleSize.second << std::endl;
return 0;
}
```
_**Program output:**_
```text
Console size: 120 x 27
```