ORE Studio 0.0.4
Loading...
Searching...
No Matches
navigation_commands.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_SHELL_APP_COMMANDS_NAVIGATION_COMMANDS_HPP
21#define ORES_SHELL_APP_COMMANDS_NAVIGATION_COMMANDS_HPP
22
23#include <iosfwd>
24#include "ores.logging/make_logger.hpp"
25#include "ores.shell/app/pagination_context.hpp"
26
27namespace cli {
28
29class Menu;
30
31}
32
33namespace ores::shell::app::commands {
34
46private:
47 inline static std::string_view logger_name =
48 "ores.shell.app.commands.navigation_commands";
49
50 static auto& lg() {
51 using namespace ores::logging;
52 static auto instance = make_logger(logger_name);
53 return instance;
54 }
55
56public:
65 static void register_commands(cli::Menu& root_menu,
66 pagination_context& pagination);
67
76 static void process_next(std::ostream& out, pagination_context& pagination);
77
86 static void process_prev(std::ostream& out, pagination_context& pagination);
87
96 static void process_first(std::ostream& out, pagination_context& pagination);
97
106 static void process_last(std::ostream& out, pagination_context& pagination);
107
118 static void process_page_size(std::ostream& out,
119 pagination_context& pagination,
120 std::uint32_t size = 0);
121};
122
123}
124
125#endif
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Manages pagination navigation commands.
Definition navigation_commands.hpp:45
static void process_next(std::ostream &out, pagination_context &pagination)
Move to the next page.
Definition navigation_commands.cpp:59
static void process_prev(std::ostream &out, pagination_context &pagination)
Move to the previous page.
Definition navigation_commands.cpp:85
static void process_first(std::ostream &out, pagination_context &pagination)
Jump to the first page.
Definition navigation_commands.cpp:116
static void register_commands(cli::Menu &root_menu, pagination_context &pagination)
Register navigation commands.
Definition navigation_commands.cpp:31
static void process_page_size(std::ostream &out, pagination_context &pagination, std::uint32_t size=0)
Get or set the page size.
Definition navigation_commands.cpp:179
static void process_last(std::ostream &out, pagination_context &pagination)
Jump to the last page.
Definition navigation_commands.cpp:141
Manages pagination state across shell commands.
Definition pagination_context.hpp:51