Skip to content

CatIsNotFound/Tiny.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny.cpp

简体中文

C++11 License Branch

An extremely small, lightweight, and easy-to-use foundational library.

Key Features

  • Modular architecture, allowing independent reuse of any module in the src directory without any configuration;
  • No dependencies on any third-party libraries, using only cross-platform architectural design;
  • Simple and easy to use, adopting modern C++ standards (minimum support for C++11 standard)

Included Modules

Module Path Functionality
File src/OS File operating system, supporting basic file and path operations
Events src/Events Event system, providing basic components for easy implementation of timers, async functionality, etc.
TUI src/TUI Terminal User Interface, providing basic terminal drawing functionality for easier terminal rendering

Installation

Download Precompiled Project

You can download the latest precompiled release directly from Github Release.

Compile Source Code Project

  1. Download the project source code via Github:

    git clone https://github.com/CatIsNotFound/Tiny.cpp.git

    To use the unstable version, execute the following command:

    git clone https://github.com/CatIsNotFound/Tiny.cpp.git -b beta
  2. Configure the project via CMake

    cd Tiny.cpp
    mkdir build ; cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/Tiny.cpp -DCMAKE_BUILD_TYPE=Release -DTINY_BUILD_TEST=OFF 

    P.S: Please replace /path/to/Tiny.cpp with the actual installation path.

  3. Compile and install this project locally

    cmake --build . --target install

Quick Start

Copy Source Code (Most Direct)

Directly copy any directory's corresponding module from the src directory to your own project. Each module contains a header file (*.hpp) and a source file (*.cpp).

Import via CMake

If using CMake as your primary project management tool, it is recommended to import the Tiny project directly via CMake.

P.S: Use Tiny as the project library name in CMake, not Tiny.cpp!

  1. Download the precompiled binary library or manually compile the source code to your local machine.

  2. Refer to the following example:

cmake_minimum_required(VERSION 3.24)
project(HelloWorld)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_PREFIX_PATH "/path/to/Tiny.cpp")
find_package(Tiny REQUIRED)

add_executable(${CMAKE_PROJECT_NAME} 
        main.cpp
        # ....
)

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
    Tiny::Tiny
)

How to Use

Taking the TUI module as an example, assuming you want to use the Terminal module to simply output Hello, Tiny.cpp!, please execute the following code:

// If importing via CMake, use the following import method:
#include <Tiny/TUI/Terminal.hpp>
// If directly copying the TUI directory to your project, it might be imported like this:
#include "TUI/Terminal.hpp"

using ter = Tiny::TUI::Terminal;

int main() {
   ter::printLine("Hello, Tiny.cpp!");   
   return 0;
}

P.S: Since this project is still in the development stage, there is currently no related API documentation, which may be planned for future updates.

License

Tiny.cpp is licensed under the MIT License. You can view detailed information in the LICENSE file or any other header or source file.

About

An extremely small, lightweight, and easy-to-use foundational library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors