File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
libs/B-luga/include/B-luga Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,20 @@ class Json {
174174 return jsonData[index].get <T>();
175175 }
176176
177+ template <typename T>
178+ std::vector<T> getObjectsIdInArray (const std::string &dataType, const std::string &arrayName)
179+ {
180+ std::vector<T> ids;
181+ auto data = getDataByJsonType (dataType)[arrayName];
182+
183+ for (const auto &object : data) {
184+ if (isDataExist (object, " id" )) {
185+ ids.push_back (object[" id" ].get <T>());
186+ }
187+ }
188+ return ids;
189+ }
190+
177191 template <typename T>
178192 T getDataByVector (const std::string &dataType, const std::vector<std::string> &indexes)
179193 {
Original file line number Diff line number Diff line change 77
88#pragma once
99
10+ #define _USE_MATH_DEFINES
1011#include < cmath>
1112#include < stdexcept>
1213
You can’t perform that action at this time.
0 commit comments