OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
ListViewer Struct Reference

Static Public Member Functions

template<typename EntryList, typename Print>
static void outputItems (const EntryList &items, Print print=[](auto item){ return toStr(item);}, size_t itemsPerPage=100)

Detailed Description

Definition at line 469 of file CUI.h.

Member Function Documentation

◆ outputItems()

template<typename EntryList, typename Print>
void outputItems ( const EntryList & items,
Print print = [](auto item){ return toStr(item);},
size_t itemsPerPage = 100 )
inlinestatic

Outputs list items.

Definition at line 473 of file CUI.h.

473 { return toStr(item);}, size_t itemsPerPage = 100)
474 {
475 if (items.empty())
476 {
477 Screen::info("[]");
478 return;
479 }
480
481 size_t itemsToOutput = itemsPerPage;
482
483 std::size_t n = 0;
484 for (const auto& item : items)
485 {
486 if (0 == --itemsToOutput)
487 {
488 itemsToOutput = itemsPerPage;
489
490 if (!shouldContinue())
491 return;
492 }
493
494 Screen::out() << "\n"
495 << Screen::bold << Screen::black << Screen::onCyan << "[" << std::to_string(++n) << "]"
496 << Screen::reset << " " << print(item) << "\n";
497 }
498 }
auto print(OrderPtr order)
Definition Order.h:77
std::string toStr(Order::PriceOptional value)
Definition Order.cpp:34