Skip to content

introsent/dae-pokedex

Repository files navigation

Pokedex (JSON)

A C++ console application that parses the given pokedex.json file and outputs to the console as requested There are two parsing libraries user can switch between at build time:

  1. Nlohmann
  2. Rapid

During the build process, the FetchContent module in CMake handles the retrieval of the external library based on a specified option. A configuration option determines which JSON parser (Nlohmann or Rapid) is needed for the build, and FetchContent then downloads and includes only the selected library

How to use?

  1. Open the CMD | Powershell in workspace folder.

  2. Use the following commands:

cmake -S . -B build -DUSE_NLOHMANN=ON -DUSE_RAPID=OFF # specifies build directory
#to switch between modes -DUSE_NLOHMANN=OFF -DUSE_RAPID=ON
#NOTE: once set desired mode to ON, make sure the other is OFF
cmake --build build # builds the project
.\build\Debug\Pokedex.exe  #runs the executable
 #NOTE: Use .\ instead of ./ for Windows
  1. Press Enter to exit application.

  2. Clean the build folder:

CMD:

    rmdir /S /Q build #removes the directory and all subdirectories/files in CMD

Powershell:

    rmdir .\build -Recurse -Force #removes the directory and all subdirectories/files in Powershell

Additional info

Application uses C++20 version and UTF-8 character encoding.

Application converts objects JSON to std::vector<std::unordered_map<std::string, std::any>> Check cppreference std::unordered_map and cppreference std::variant (since C++17) for more info.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published