Skip to content

Commit

Permalink
Update README.md (#512)
Browse files Browse the repository at this point in the history
Updated README file. Added a more thorough explanation of the project goal and added a detailed description of how to use the library. I combined the Documentation section with the Usage section and moved the Compiler Guides so that they are next to the Compiler Supports. I also created a longer description about contributions and how to get involved in this project.
  • Loading branch information
jasonphao authored Feb 15, 2024
1 parent 9009021 commit 59bee78
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<img src="https://raw.githubusercontent.com/cieslarmichal/faker-cxx/main/docs/images/logo.png" width="250" alt="C++ Faker, a powerful tool for generating realistic and randomized fake data in C++ programming, enhancing data testing and development workflows"/>
<h1>Faker C++</h1>
<p>Generate fake (but realistic) data for testing and development.</p>
<p>The function of Faker C++ is to generate fake (but realistic) data for testing and development</p>

[![clang++](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-clang-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-clang-build.yml?query=branch%3Amain)
[![apple clang++](https://github.com/cieslarmichal/faker-cxx/actions/workflows/macos-clang-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/macos-clang-build.yml?query=branch%3Amain)
Expand All @@ -14,39 +14,44 @@

## 🎯 Goal

Goal of the Faker C++ is to provide a library like [Faker.js](https://github.com/faker-js/faker) for C++ community.
The goal of Faker C++ is to provide a library similar to [Faker.js](https://github.com/faker-js/faker) for C++ community. Faker C++ is a powerful library designed to streamline the creation of realistic and customizable fake data for testing and development purposes within C++ applications for all developers to use. The use of this library will provide a quick and user-friendly experience for developers, offering a wide variety of modules that cover everything from generating random names and addresses to crafting realistic financial and internet related data. By using Faker C++, developers can efficiently supply their applications with authentic-looking test data, facilitating an effective and accurate testing and development process.

## Usage
## Usage and Documentation

To properly use Faker C++ you must first assimilate the Faker library (see Consuming Library with CMake).
Once that is done, you need to include the proper header files depending on the module you wish to generate data from. The module header file names can be found by looking in the directory include/faker-cxx. A list of the functions, their descriptions, and how to use them can be found here --> https://cieslarmichal.github.io/faker-cxx/
Make sure to include the proper header file that corresponds to the data and subsequent functions you are trying to generate.

Below is an example of how to implement Faker C++ in your code.

```cpp
#include <iostream>

//Include statements for the header files.
#include "faker-cxx/Date.h"
#include "faker-cxx/Internet.h"
#include "faker-cxx/Location.h"
#include "faker-cxx/String.h"

int main()
{
//variable declarations and function calls.
const auto id = faker::String::uuid();
const auto email = faker::Internet::email();
const auto password = faker::Internet::password();
const auto verificationCode = faker::String::numeric(8);
const auto createdAt = faker::Date::pastDate();
const auto city = faker::Location::city();
const auto streetAddress = faker::Location::streetAddress();

std::cout << id << std::endl; // 58018063-ce5a-4fa7-adfd-327eb2e2d9a5
std::cout << email << std::endl; // [email protected]
std::cout << password << std::endl; // @cWLwgM#Knalxeb
std::cout << verificationCode << std::endl; // 31457428
std::cout << createdAt << std::endl; // 2023-06-20T02:06:36Z
std::cout << city << std::endl; // Sayreville
std::cout << streetAddress << std::endl; // 1716 Harriet Alley

return 0;
}
```
This example generates basic personal information including id, email, password, city, and street address. Users can tailor their data generation by exploring other modules and functions within the library.

## 💎 Modules

Expand Down Expand Up @@ -82,10 +87,6 @@ int main()
- 🌤️ Weather - temperature, pressure, humidity, weather description
- 💬 Word - sample words, nouns, verbs

## 📖 Documentation

https://cieslarmichal.github.io/faker-cxx/

## Consuming library with CMake (CMake 3.22 or newer)

1. Add faker to git submodules (execute in project root):
Expand All @@ -110,27 +111,29 @@ https://cieslarmichal.github.io/faker-cxx/
## Compiler support
Use one of these compilers when working with Faker C++.
- [MSVC➚](https://en.wikipedia.org/wiki/Microsoft_Visual_Studio) version 143 or newer.
- [GCC➚](https://gcc.gnu.org/) version 13 or newer.
- [Clang➚](https://clang.llvm.org/) version 16 or newer.
- [Apple Clang➚](https://clang.llvm.org/) version 16 or newer.
If you have any confusion please refer to the respective guides.
- [Clang++](./docs/guides/clang-compilation-guide.md)
- [Apple Clang++](./docs/guides/apple-clang-compilation-guide.md)
- [G++](./docs/guides/gcc-compilation-guide.md)
- [MSVC](./docs/guides/msvc-compilation-guide.md)
## Dependencies
- GTest (```BUILD_FAKER_TESTS=OFF``` CMake flag to disable)
- fmt (only for Apple Clang++ compiler)
## ✨ Contributing
Feel free to join Faker C++ development! 🚀
Please check [CONTRIBUTING](https://github.com/cieslarmichal/faker-cxx/blob/main/CONTRIBUTING.md) guide.
[Discord Channel](https://discord.gg/h2ur8H6mK6) for contributors.
We would love it if you contributed to Faker C++! 🚀
## 📝 Compilation guides
Whether you are interested in fixing bugs, implementing new features, or improving documentation, your input is welcome and valuable. Before contributing, please review our [CONTRIBUTING](https://github.com/cieslarmichal/faker-cxx/blob/main/CONTRIBUTING.md) guide for guidelines on coding standards, making changes, and creating Pull Requests (PRs). Your engagement helps maintain the project's vitality and ensures Faker C++ remains a useful tool for the C++ community.
- [Clang++](./docs/guides/clang-compilation-guide.md)
- [Apple Clang++](./docs/guides/apple-clang-compilation-guide.md)
- [G++](./docs/guides/gcc-compilation-guide.md)
- [MSVC](./docs/guides/msvc-compilation-guide.md)
Additionally, we encourage you to join our [Discord Channel](https://discord.gg/h2ur8H6mK6) for contributors, where you can engage in discussions, seek assistance, and collaborate with fellow developers. Your contributions play a crucial role in the development and furthering of Faker C++. We look forward to your involvement and appreciate your commitment to the project's growth!

0 comments on commit 59bee78

Please sign in to comment.