{"id":27151654,"url":"https://github.com/0xromjobert/cpp06","last_synced_at":"2025-04-08T14:54:49.370Z","repository":{"id":222831781,"uuid":"757050654","full_name":"0xromjobert/Cpp06","owner":"0xromjobert","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T18:09:47.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T18:46:54.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xromjobert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T19:07:09.000Z","updated_at":"2024-12-27T17:38:54.000Z","dependencies_parsed_at":"2025-03-31T18:57:05.920Z","dependency_job_id":null,"html_url":"https://github.com/0xromjobert/Cpp06","commit_stats":null,"previous_names":["romz8/cpp06","0xromjobert/cpp06"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2FCpp06","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2FCpp06/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2FCpp06/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xromjobert%2FCpp06/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xromjobert","download_url":"https://codeload.github.com/0xromjobert/Cpp06/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247866107,"owners_count":21009239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-08T14:54:48.197Z","updated_at":"2025-04-08T14:54:49.352Z","avatar_url":"https://github.com/0xromjobert.png","language":"C++","readme":"# C++ Module 06 - Scalar Conversion and Serialization\n\n## Overview\n\nThis repository contains solutions for Module 06 of the 42 School's C++ curriculum. The focus of this module is on implementing scalar type conversion, serialization, and type identification using C++98, exploring casting, exception handling, and the use of polymorphism.\n\n## Status\n\nValidated on 2024/02/13.  \nGrade: 100%.\n\n## General Information\n\n- **Compiler used:** `c++`\n- **Compilation flags:** `-Wall -Wextra -Werror -std=c++98`\n- **Standard:** C++98, following 42 School curriculum requirements.\n\n## Projects\n\nThis module is divided into three exercises, each focused on unique aspects of C++ casting, serialization, and type identification.\n\n### Exercise 00: Conversion of Scalar Types\n- **Directory:** `ex00/`\n- **Files:** `Makefile`, `main.cpp`, `ScalarConverter.{h,hpp}`, `ScalarConverter.cpp`\n- **Description:**  \n  The `ScalarConverter` class provides a static method `convert` that accepts a string representing a C++ literal in common formats (e.g., `char`, `int`, `float`, and `double`). It converts the literal to each scalar type, outputting the result or an informative message when conversion is impossible. The class is non-instantiable, adhering to the requirement that it stores no internal state.\n- **Key Concepts:** Type detection, static functions, exception handling, conversion.\n\n### Exercise 01: Serialization\n- **Directory:** `ex01/`\n- **Files:** `Makefile`, `main.cpp`, `Serializer.{h,hpp}`, `Serializer.cpp`, `Data.{h,hpp}`\n- **Description:**  \n  The `Serializer` class offers methods for converting a `Data` object pointer to a `uintptr_t` integer using `serialize` and back to a `Data` pointer using `deserialize`. The `Data` structure includes members to demonstrate serialization. This exercise tests conversion consistency by comparing the original pointer to the deserialized output.\n- **Key Concepts:** Serialization, pointer manipulation, memory representation.\n\n### Exercise 02: Identify Real Type\n- **Directory:** `ex02/`\n- **Files:** `Makefile`, `main.cpp`, `Base.{h,hpp}`, `Base.cpp`, `A.{h,hpp}`, `B.{h,hpp}`, `C.{h,hpp}`\n- **Description:**  \n  An abstract `Base` class serves as a polymorphic base for classes `A`, `B`, and `C`. A random generator function `generate` instantiates one of the derived classes, returning it as a `Base` pointer. The `identify` functions determine the actual type of the object at runtime, either by pointer or reference, without using `std::typeinfo`.\n- **Key Concepts:** Polymorphism, dynamic casting, type identification.\n\n## Compilation and Usage\n\nEach exercise includes a `Makefile` for easy compilation. You can compile and run each exercise with the following commands:\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xromjobert%2Fcpp06","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xromjobert%2Fcpp06","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xromjobert%2Fcpp06/lists"}