faker-cxx is a modern C++20 open-source library for generating fake data for testing and development.
It has no dependencies beyond Boost library (and GTest for unit tests).
My goal is to create a simple, modern C++ Faker library similar to FakerJS.
Lets dive into some simple example of generating fake data for some user
#include <format>
#include <iostream>
#include "faker-cxx/Internet.h"
#include "faker-cxx/String.h"
int main()
{
const auto id = faker::String::uuid();
const auto email = faker::Internet::email();
const auto password = faker::Internet::password();
std::cout << std::format("id: {}, email: {}, password: {}", id, email, password);
return 0;
}
add_subdirectory(third_party/faker-cxx)
add_executable(main main.cpp)
target_link_libraries(main faker-cxx)
- ๐ Internet - Generate emails, usernames and passwords.
- ๐ง Person - Generate first, last names.
- ๐ข Number - Generate random numbers.
- ๐ Lorem - Generate lorem text.
- ๐ข String - Generate uuids.
- ๐ Localization - Generate addresses.
- ๐ Date - Generate past, future dates.
- ๐ Commerce - Generate prices, product names, and descriptions.
- ๐ Animal - Generate animal types and names
- ๐จ Color - Generate RGB colors and color names
- ๐ข Company - Generate company name, location
- โน๏ธ Datatype - Generate strings, numbers, booleans
- ๐ถ Music - Generate music genre, song names
- ๐ Book - Generate book genre, title, author, isbn, published year
- ๐ Phone - Generate phone number
- ๐ฎ Game - Generate game genre, title
Please feel free to join Faker C++ development! ๐