GithubHelp home page GithubHelp logo

flaviup / base64pp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matheusgomes28/base64pp

0.0 0.0 0.0 25 KB

Base64 encoding and decoding.

License: MIT License

Shell 8.14% C++ 87.95% CMake 3.91%

base64pp's Introduction

Base64pp - A Modern C++ Implementation Of Base64 Encoding

This project was created for a post on my personal blog where I explain how to implement a Base64 encoder using C++ code.

Project Dependencies

Base64pp doesn't rely on any third-party libraries per se, but the unit tests were implemented with GTest. However, the dependencies were managed with Conan so you do need to install that first.

Regarding the build system, this project requires a farily recent version of CMake. In addition, your favourite compiler also needs to support C++20. For more information, visit the Base64 encoding with C++ post.

Building The Project

Building from the command line is fairly simple. In this section, we're assuming you're on a bash-like terminal, with CMake and Conan accessible. For building on IDE environments, please see the later sections (Visual Studio and Clion).

Firstly, create a build directory where all the Conan and build files will be stored:

cd ${PROJECT_ROOT_DIR}
mkdir build && cd build

Note that ${PROJECT_ROOT_DIR} is the path to the directory where this git repository was cloned to.

Following that, simply install the Conan dependencies:

conan install --build=missing ..

Note: if Conan did not properly identify your build profile, specify the compiler, compiler.libcxx, build_type and architecture to the above with the -s flags. Find out more about the settings in this page.

With all the CMake Find*.cmake files installed under build/ by Conan, we can simply configure and build with CMake:

cmake -DCMAKE_MODULE_PATH="$(pwd)" ..

cmake --build . -j${N_PROCS}      

That's it! You should now have the project fully built under the build/ directory. Note that we're assumed you're running these commands from build/, and ${N_PROCS} is the number of cores available in your machine.

Integrating The Build With Clion

To integrate with CLion, simply open the root directory of the project with CLion (where the main CMakeLists.txt is located).

If you have followed the Conan installation steps above, you should have a bunch of Find*.cmake files in the build/ directory. For CLion's integrated CMake to configure the project, you need to provie the absolute path to build/. To achieve this, add

-DCMAKE_MODULE_PATH="/some/path/to/base64pp/build"

Under Settings -> Build, Execution, Deployment -> CMake, in the "Cmake Options" textbox. After saving these changes, CLion should fully configure the project and building / debugging be available.

Integrating With Visual Studio

Similar to the CLion integration, open the root directory containing the CMakeLists.txt, then add the following CMake variables to your build configuration's CMakeSettings.json:

"variables": [
    {
      "name": "CMAKE_MODULE_PATH",
      "value": "path/to/base64pp/build",
      "type": "FILEPATH"
    }
  ]

After that, reload the CMake and you're good to go.

Learn How Base64 Works

If you're interested in finding out how this implementation works and how it came about, please read the post I made on how to Base64 encode and decode with C++.

If you have any questions, suggestions or feedback, either create a PR or feel free to drop a comment in the post!

base64pp's People

Contributors

matheusgomes28 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.