Skip to content

Commit

Permalink
1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-olivier committed Apr 7, 2021
1 parent 90152b4 commit 88d2431
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DyLib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* \file DyLib.hpp
* \brief Cross-platform Dynamic Library Loader
* \author Martin Olivier
* \version 0.5
* \version 1.0
*
* MIT License
* Copyright (c) 2021 Martin Olivier
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# DyLib - Dynamic Library Loader for C++
[![DyLib](https://img.shields.io/badge/DyLib-v0.5-blue.svg)](https://github.com/tocola/DyLib/releases/tag/v0.5)
[![DyLib](https://img.shields.io/badge/DyLib-v1.0-blue.svg)](https://github.com/tocola/DyLib/releases/tag/v1.0)
[![MIT license](https://img.shields.io/badge/License-MIT-orange.svg)](https://github.com/tocola/DyLib/blob/main/LICENSE)
[![CPP Version](https://img.shields.io/badge/C++-11/14/17/20-darkgreen.svg)](https://isocpp.org/)

Expand All @@ -10,7 +10,7 @@
[![workflow](https://github.com/tocola/DyLib/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/tocola/DyLib/actions/workflows/unit_tests.yml)
[![codecov](https://codecov.io/gh/tocola/DyLib/branch/main/graph/badge.svg?token=4V6A9B7PII)](https://codecov.io/gh/tocola/DyLib)

[![GitHub download](https://img.shields.io/github/downloads/tocola/DyLib/total?style=for-the-badge)](https://github.com/tocola/DyLib/releases/download/v0.5/DyLib.hpp)
[![GitHub download](https://img.shields.io/github/downloads/tocola/DyLib/total?style=for-the-badge)](https://github.com/tocola/DyLib/releases/download/v1.0/DyLib.hpp)

The goal of this C++ Library is to load dynamic libraries (.so, .dll, .dylib) and access its functions and global variables at runtime.

Expand All @@ -19,7 +19,7 @@ Works on `Linux`, `Windows`, `MacOS`

# Installation

1. Click [HERE](https://github.com/tocola/DyLib/releases/download/v0.5/DyLib.hpp) to download the DyLib header file
1. Click [HERE](https://github.com/tocola/DyLib/releases/download/v1.0/DyLib.hpp) to download the DyLib header file
2. Put the DyLib header file in your project directory

# Documentation
Expand All @@ -38,9 +38,10 @@ lib.open("./myDynLib.so");

## Open and Close

`Open:`
`Open`
Load a dynamic library into the object. If a dynamic library was already opened, it will be unload and replaced
`Close:`

`Close`
Close the dynamic library currently loaded in the object. This function will be automatically called by the class destructor
```c++
// Load ./myDynLib.so
Expand All @@ -58,9 +59,10 @@ lib.close();
## Get a Function or a Variable
`getFunction:`
`getFunction`
Get a function from the dynamic library currently loaded in the object.
`getVariable:`
`getVariable`
Get a global variable from the dynamic library currently loaded in the object.
```c++
// Load ./myDynLib.so
Expand All @@ -82,9 +84,10 @@ double result = adder(pi, pi);

## DyLib Exceptions

`handle_error:`
`handle_error`
This exception is thrown when the library failed to load or the library encountered symbol resolution issues
`symbol_error:`

`symbol_error`
This exception is thrown when the library failed to load a symbol.
This usualy happens when you forgot to mark a library function or variable as `extern "C"`

Expand Down

0 comments on commit 88d2431

Please sign in to comment.