Finance manager
Лабораторна робота №2 - Документація коду
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
Transaction.h File Reference

Оголошення класу Transaction, що представляє одну фінансову операцію. More...

#include <string>
#include <vector>
#include <ctime>
#include <nlohmann/json.hpp>
Include dependency graph for Transaction.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Transaction
 Представляє одну фінансову операцію (дохід, витрата тощо). More...
 

Typedefs

using json = nlohmann::json
 

Functions

void to_json (json &j, const Transaction &t)
 Серіалізує об'єкт Transaction у формат JSON.
 
void from_json (const json &j, Transaction &t)
 Десеріалізує JSON в об'єкт Transaction.
 

Detailed Description

Оголошення класу Transaction, що представляє одну фінансову операцію.

Typedef Documentation

◆ json

using json = nlohmann::json

Function Documentation

◆ from_json()

void from_json ( const json j,
Transaction t 
)
inline

Десеріалізує JSON в об'єкт Transaction.

Автоматично викликається бібліотекою nlohmann/json, коли ви робите transaction_object = j.get<Transaction>();. Використовує j.value() для безпечного отримання даних з наданням значень за замовчуванням.

Parameters
jJSON-об'єкт (вхідний, const) для читання.
tОб'єкт Transaction (вихідний параметр), який буде заповнено.

◆ to_json()

void to_json ( json j,
const Transaction t 
)
inline

Серіалізує об'єкт Transaction у формат JSON.

Автоматично викликається бібліотекою nlohmann/json, коли ви робите json j = transaction_object;.

Parameters
jJSON-об'єкт (вихідний параметр), який буде заповнено.
tОб'єкт Transaction (вхідний, const) для серіалізації.