File tree Expand file tree Collapse file tree
3rd_party_adapters/nlohmann
application_business_rules/serial_interface Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,12 @@ std::string toJsonString<task_tracker_systems::TaskObject>(const task_tracker_sy
3939template <>
4040std::string toJsonString<device::TaskCollection>(const device::TaskCollection &object)
4141{
42- nlohmann::json jsonObject (TaskObjectIterator (std::begin (object)), TaskObjectIterator (std::end (object)));
42+ std::vector<TaskObjectIterator> itList;
43+ for (auto it = std::cbegin (object); it != std::cend (object); ++it)
44+ {
45+ itList.emplace_back (it);
46+ }
47+ nlohmann::json jsonObject (itList);
4348 return jsonObject.dump (defaultJsonIndent);
4449}
4550
Original file line number Diff line number Diff line change @@ -28,11 +28,7 @@ static const auto info = []() {
2828static const auto infoCmd = cli::makeCommand(" info" , std::function(info));
2929
3030// command for list
31- static const auto list = []() { std::vector<TaskObjectIterator> itList;
32- std::for_each (std::cbegin (device::tasks), std::cend (device::tasks), [&itList](auto it){
33- itList.emplace_back (it);
34- });
35- serial_port::cout << toJsonString (itList) << std::endl; };
31+ static const auto list = []() { serial_port::cout << toJsonString (device::tasks) << std::endl; };
3632static const auto listCmd = cli::makeCommand(" list" , std::function(list));
3733
3834// command for edit
You can’t perform that action at this time.
0 commit comments