GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dehancer/base64cpp: Base64 is a binary-to-text encoding schemes that represent binary data in an ASCII string format.

BranchesTags
Open more actions menu

Latest commit

 

History

101 Commits
101 Commits

Folders and files

NameName
Last commit message
Last commit date
include
include
 
 
lib
lib
 
 
src
src
 
 
tests
tests
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
base64cpp.pc.in
base64cpp.pc.in
 
 
version.txt
version.txt
 
 

Repository files navigation

base64cpp

Build and install

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel $(nproc)
cmake --install build --parallel $(nproc)

Make sure to set proper CMAKE_PREFIX_PATH and CMAKE_INSTALL_PREFIX to discover dependencies and install.

Use -DBUILD_SHARED_LIBS=ON for a shared library; the default is static.

CMAKE_POSITION_INDEPENDENT_CODE is set to ON.

Windows build

We build in Git Bash with clang-cl and we add a magic string to CMake to select runtime.

Use Ninja as a make file generator.

Set PATH to include clang-cl.exe from VS.

export PATH="$PATH:/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin"

Add this to cmake configuration:

-G Ninja \
-DCMAKE_C_COMPILER=clang-cl \
-DCMAKE_CXX_COMPILER=clang-cl \
-DCMAKE_MSVC_RUNTIME_LIBRARY='MultiThreaded$<$<CONFIG:Debug>:Debug>'

Usage in CMake

find_package(base64cpp CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE base64cpp::base64cpp)

The CMake package is always generated and installed.

Usage with pkg-config

Disabled by default. Configure with -DCREATE_PKG_CONFIG=ON to generate and install base64cpp.pc.

export PKG_CONFIG_PATH="$HOME/local-dehancer/lib/pkgconfig"
pkg-config --cflags --libs base64cpp

Tests

Install GoogleTest, then:

cmake -B build -DBUILD_TESTING=ON
cmake --build build --parallel $(nproc)
ctest --test-dir build --output-on-failure

Example

#include <base64cpp.hpp>

std::string source = "1234567890binary";
std::string encoded;
base64::encode(source, encoded, 24); // Default line width: 76.

std::string decoded;
base64::decode(encoded, decoded);

About

Base64 is a binary-to-text encoding schemes that represent binary data in an ASCII string format.

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.