EHS/README.md

113 lines
3.2 KiB
Markdown
Raw Normal View History

2024-02-05 22:25:30 -08:00
# About
Much like boost.io this library is a replacement of the standard C/C++ libraries. It provides most features needed when
designing applications in a cross-platform manner. The goal for this project is for it to be compiled and run on
anything which means embedded hardware support.
This project does not fully follow the C++ standard.
### Features
- Audio IO/Processing/Manipulation
- Image Processing/Manipulation
2024-07-01 22:15:49 -07:00
- Databases
2024-02-05 22:25:30 -08:00
- 3D Model & Mesh Processing/Manipulation
- File IO
- Basic File Monitoring
- Console IO
- 2/3/4D Vectors
- 2x2/3x3/4x4 Matrices
- Hardware/Software Level Math Functions
- Smart Pointers
- Threads
- Mutexes
- Semaphores
- CPU information and features at runtime
2024-07-01 22:15:49 -07:00
- HTTP(S) Socket Layer
2024-02-05 22:25:30 -08:00
- TCP Socket
- UDP Socket
- COM (Serial) IO
- UTF_8/16/32 Character Encoding
- Spotify Integration
- Twitch Integration
- Json Parsing/Writing
- User Friendly HID Input
2024-07-01 22:15:49 -07:00
- Heap Garbage Collector
2024-02-05 22:25:30 -08:00
- Linked List
- Array
- Vector
- Asynchronous Task System
- URI Parsing
2024-07-01 22:15:49 -07:00
- USB (WIP)
2024-02-05 22:25:30 -08:00
### Supported Architectures
- AMD64
- AARCH64
### Supported Operating Systems
- Windows
- Linux
2024-02-05 22:44:22 -08:00
# Compiling/Building/Installing
## Linux
### Prerequisites
2024-02-05 22:25:30 -08:00
- **Arch Linux**: `sudo pacman -S gcc nasm cmake alsa-lib libxcb xcb-util-cursor`
- **Debian Linux**: `sudo apt install gcc nasm cmake libasound2-dev libxcb1-dev libxcb-xinput-dev libxcb-cursor-dev`
For building on the Raspberry Pi instead of the Netwide Assembler (NASM), GCC's Assembler is used.
2024-02-05 22:44:22 -08:00
### Building
`cmake -DCMAKE_BUILD_TYPE=Release -DLINUX_WINDOW_SYSTEM:STRING=XCB /path/to/source`
The `LINUX_WINDOW_SYSTEM` variable in the first step can be either `XCB` for the X Window System or `Wayland` for the
Wayland Window System. Wayland support is currently not fully supported yet, use only `XCB`.
### Compiling
`cmake --build /path/to/build --config Release`
### Installing
2024-02-05 22:46:33 -08:00
`sudo cmake --install /path/to/build --prefix /usr/local`
2024-02-05 22:44:22 -08:00
## Windows
### Prerequisites
2024-02-05 22:37:30 -08:00
- [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/)
- [Netwide Assembler](https://www.nasm.us/)
- [CMake](https://cmake.org/)
- [vcpkg](https://learn.microsoft.com/en-us/vcpkg/get_started/get-started?pivots=shell-cmd)
2024-02-05 22:44:22 -08:00
### Building
2024-08-15 19:40:31 -07:00
`cmake -A x64 -DCMAKE_BUILD_TYPE=Release /path/to/source`
2024-02-05 22:25:30 -08:00
2024-02-05 22:44:22 -08:00
### Compiling
2024-02-05 22:47:14 -08:00
`cmake --build /path/to/build --config Release`
2024-02-05 22:37:30 -08:00
2024-02-05 22:44:22 -08:00
### Installing
2024-02-05 22:47:14 -08:00
`cmake --install /path/to/build --prefix "C:/Program Files/EHS"`
2024-02-05 22:37:30 -08:00
This will require the terminal to be running in administrator mode.
2024-02-05 22:25:30 -08:00
# Simple Example
```cpp
#include <ehs/EHS.h>
#include <ehs/io/Console.h>
2024-08-15 19:40:31 -07:00
int main()
2024-02-05 22:25:30 -08:00
{
// Simple identifying meta-data for the logger.
2024-08-15 19:40:31 -07:00
ehs::Initialize("Simple Example App", "Release", {1, 0, 0});
2024-02-05 22:25:30 -08:00
ehs::Console::Write_8("How old are you?"); // Write to the console in UTF_8 character encoding.
ehs::Str_8 response = ehs::Console::Read_8(); // Read from the console in UTF_8 character encoding.
if (!response.IsNum())
{
ehs::Console::Clear(); // Clear the console's buffer.
return Main(appName, appVerId, appVer); // Repeat process if given response is not a number.
}
ehs::UInt_8 age = response.ToDecimal<ehs::UInt_8>(); // Converts the string number into a number based primitive.
ehs::Console::Write("Your age is " + ehs::Str_8::FromNum(age) + "."); // Write the console with the age converted back to string.
return 0;
}
```