A modular C++ library providing essential utilities for array manipulation, mathematical computations, number operations, and random number generation.
CoreLib is a robust and extensible C++ utility library designed to simplify common programming tasks. It offers a comprehensive collection of pre-built functionalities, neatly organized into modular components, covering areas from efficient data structure operations to complex mathematical calculations and secure random number generation. Whether you're building high-performance applications or simply need reliable utility functions, CoreLib aims to be your go-to toolkit, promoting code reusability and development efficiency.
- 🎯 Array Manipulation Utilities: Functions for creating, transforming, searching, and sorting arrays and other data structures.
- ➗ Mathematical Computation Functions: A suite of mathematical operations, including complex arithmetic, trigonometry, and statistical tools.
- 🔢 Number Operation Helpers: Tools for working with various number types, including conversions, formatting, and advanced operations.
- 🎲 Secure Random Number Generation: Reliable and efficient algorithms for generating random numbers for diverse applications.
This section guides you through setting up and using CoreLib in your C++ projects.
Before you begin, ensure you have a C++ compiler and a build system installed on your machine:
- C++ Compiler: GCC (e.g., g++) or Clang (e.g., clang++)
- Build System: GNU Make (recommended for simple projects, or CMake for larger ones - specific build instructions may vary based on your project's
Makefile/CMakeLists.txt)
-
Clone the repository
git clone https://github.com/Choubi-Mohammed/corelib.git cd corelib -
Build the library If a
Makefileis present in the root directory:make
If you intend to use it as a header-only library, no build step might be strictly necessary, but compiling test cases or examples could still validate setup. If you need to compile source files into a static or shared library, you would typically use a command similar to this (adjust as per your compiler and desired output):
g++ -c src/*.cpp -Iinclude ar rcs libcorelib.a *.o # To create a static library
Note: Please refer to a potential
MakefileorCMakeLists.txtwithin the repository for exact build commands. If none is provided, you will need to set up your own build process to compile thesrcfiles and link them with your project.
To use CoreLib in your C++ project, include the necessary header files and link against the compiled library (if you built one).
Let's assume you have a file my_app.cpp that wants to use a hypothetical Math module from CoreLib:
#include <iostream>
#include "Math/Vector.h" // Example: A header from the Math module
int main() {
// Example: Using a hypothetical Vector class from CoreLib
CoreLib::Math::Vector vec1(1.0, 2.0, 3.0);
CoreLib::Math::Vector vec2(4.0, 5.0, 6.0);
CoreLib::Math::Vector sum = vec1 + vec2; // Assuming operator overloading
double dotProduct = CoreLib::Math::dot(vec1, vec2); // Assuming a dot product function
std::cout << "Vector Sum: (" << sum.getX() << ", " << sum.getY() << ", " << sum.getZ() << ")" << std::endl;
std::cout << "Dot Product: " << dotProduct << std::endl;
// TODO: Replace with actual CoreLib function examples once available.
return 0;
}To compile my_app.cpp and link with libcorelib.a:
g++ my_app.cpp -Icorelib/include -Lcorelib -lcorelib -o my_app
./my_app(Adjust -I and -L flags based on where you place the include directory and libcorelib.a file relative to my_app.cpp).
corelib/
├── include/ # Public header files defining the library's interfaces
│ └── [Module]/ # Example: Math/, Array/, Random/ - contains .h/.hpp files
│ └── ...
├── src/ # Source files containing the implementation details of the library
│ └── [Module]/ # Example: Math/, Array/, Random/ - contains .cpp files
│ └── ...
├── test/ # Unit and integration tests for the library's functionalities
│ └── [Module]/ # Test files for each module (e.g., test_math.cpp)
│ └── ...
└── README.md # This project overview and documentation
To contribute or further develop CoreLib, you'll need:
- A C++ compiler (GCC/Clang)
- A build system (Make)
- A text editor or IDE capable of C++ development
Follow the Installation steps above to build the library from source. Ensure your compiler is correctly configured to locate the header files in the include/ directory and compile the .cpp files in src/.
The test/ directory contains unit tests for various modules. To compile and run tests, you would typically:
# Example command (may vary based on specific testing framework or Makefile setup)
g++ -o run_tests test/test_*.cpp src/*.cpp -Iinclude -std=c++11 # Adjust as needed
./run_testsNote: The specific command depends on the testing framework used (e.g., Google Test, Catch2) and whether a Makefile or CMakeLists.txt exists to automate this process.
We welcome contributions to CoreLib! If you have ideas for new utilities, improvements to existing ones, or bug fixes, please feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature/AmazingFeature). - Implement your changes and ensure they align with the project's coding style.
- Write comprehensive tests for your new features or bug fixes.
- Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please see our Contributing Guide (TODO: Create CONTRIBUTING.md) for more detailed guidelines.
This project is licensed under the LICENSE_NAME - see the LICENSE file for details.
- Choubi-Mohammed (The primary author and maintainer)
- All contributors who will help improve CoreLib in the future.
- 🐛 Issues: GitHub Issues
⭐ Star this repo if you find it helpful!
Made with ❤️ by Choubi-Mohammed