|
| 1 | +/** |
| 2 | + * |
| 3 | + * @file EnvOutput.hpp |
| 4 | + * @author Gaspard Kirira |
| 5 | + * |
| 6 | + * Copyright 2026, Gaspard Kirira. All rights reserved. |
| 7 | + * https://github.com/vixcpp/vix |
| 8 | + * Use of this source code is governed by a MIT license |
| 9 | + * that can be found in the License file. |
| 10 | + * |
| 11 | + * Vix.cpp |
| 12 | + */ |
| 13 | +#ifndef VIX_CLI_ENV_OUTPUT_HPP |
| 14 | +#define VIX_CLI_ENV_OUTPUT_HPP |
| 15 | + |
| 16 | +#include <vix/cli/commands/env/EnvTypes.hpp> |
| 17 | + |
| 18 | +#include <iosfwd> |
| 19 | +#include <string> |
| 20 | + |
| 21 | +namespace vix::commands::env::output |
| 22 | +{ |
| 23 | + /** |
| 24 | + * @brief Print environment check summary. |
| 25 | + * |
| 26 | + * @param out Output stream. |
| 27 | + * @param cfg Loaded environment configuration. |
| 28 | + * @param options Runtime env options. |
| 29 | + */ |
| 30 | + void print_summary( |
| 31 | + std::ostream &out, |
| 32 | + const EnvConfig &cfg, |
| 33 | + const EnvOptions &options); |
| 34 | + |
| 35 | + /** |
| 36 | + * @brief Print one environment variable report item. |
| 37 | + * |
| 38 | + * @param out Output stream. |
| 39 | + * @param variable Environment variable report item. |
| 40 | + * @param options Runtime env options. |
| 41 | + */ |
| 42 | + void print_variable( |
| 43 | + std::ostream &out, |
| 44 | + const EnvVariable &variable, |
| 45 | + const EnvOptions &options); |
| 46 | + |
| 47 | + /** |
| 48 | + * @brief Print a section title. |
| 49 | + * |
| 50 | + * @param out Output stream. |
| 51 | + * @param label Section label. |
| 52 | + */ |
| 53 | + void section( |
| 54 | + std::ostream &out, |
| 55 | + const std::string &label); |
| 56 | + |
| 57 | + /** |
| 58 | + * @brief Print a successful environment message. |
| 59 | + * |
| 60 | + * @param out Output stream. |
| 61 | + * @param message Message to print. |
| 62 | + */ |
| 63 | + void ok( |
| 64 | + std::ostream &out, |
| 65 | + const std::string &message); |
| 66 | + |
| 67 | + /** |
| 68 | + * @brief Print an environment warning message. |
| 69 | + * |
| 70 | + * @param out Output stream. |
| 71 | + * @param message Message to print. |
| 72 | + */ |
| 73 | + void warn( |
| 74 | + std::ostream &out, |
| 75 | + const std::string &message); |
| 76 | + |
| 77 | + /** |
| 78 | + * @brief Print an environment error message. |
| 79 | + * |
| 80 | + * @param out Output stream. |
| 81 | + * @param message Message to print. |
| 82 | + */ |
| 83 | + void error( |
| 84 | + std::ostream &out, |
| 85 | + const std::string &message); |
| 86 | + |
| 87 | + /** |
| 88 | + * @brief Print a fix suggestion. |
| 89 | + * |
| 90 | + * @param out Output stream. |
| 91 | + * @param message Fix suggestion. |
| 92 | + */ |
| 93 | + void fix( |
| 94 | + std::ostream &out, |
| 95 | + const std::string &message); |
| 96 | + |
| 97 | + /** |
| 98 | + * @brief Mask or display an environment value according to options. |
| 99 | + * |
| 100 | + * @param variable Environment variable report item. |
| 101 | + * @param options Runtime env options. |
| 102 | + * @return Display-safe value. |
| 103 | + */ |
| 104 | + std::string display_value( |
| 105 | + const EnvVariable &variable, |
| 106 | + const EnvOptions &options); |
| 107 | +} |
| 108 | + |
| 109 | +#endif |
0 commit comments