Home | Develop | Download | Contact
CmdHelp.hpp
1/*
2 * CmdHelp.hpp
3 *
4 * Copyright 2021 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 */
22
32#ifndef __PDS_CMDHELP_HPP__
33#define __PDS_CMDHELP_HPP__
34
35
45#include <sstream> // std::ostringstream
46#include <vector>
47#include <string>
48
49
50namespace Pds{
51
52typedef struct
53{
54 unsigned int param_type;
55 std::string param_long;
56 std::string param_short;
57 std::string description;
58 std::string bydefault;
60
69{
70private:
72 std::string program;
73
75 std::string version;
76
78 std::string abstract;
79
81 std::string commandexample;
82
84 std::vector<Pds::HelpParamRow> data;
85private:
86 std::string titleprogram;
87 std::string titleversion;
88 std::string titleabstract;
89 std::string titlecommand;
90 std::string titleparameters;
91 std::string titlelong;
92 std::string titleshort;
93 std::string titledescription;
94 std::string titledata;
95 std::string titledefault;
96 std::string textdata;
97
98public:
99
109 CmdHelp(void);
110
117 CmdHelp(const std::string &program,const std::string &version);
118
119
121
126public:
127
143 bool AddParam(const unsigned int &ptype,
144 const std::string &plong,
145 const std::string &pshort,
146 const std::string &description,
147 const std::string &bydefault="");
148
154 bool SetCommandExample(const std::string &commandexample);
155
161 bool SetAbstract(const std::string &abstract);
162
168 bool IsEmpty(void) const;
169
175 bool Print(void) const;
176
182}; // Class CmdHelp
183
184} // namespace Pds
185
186
191#endif
192
La estructura tipo Pds::CmdHelp . Esta estructura genera una posicion. Para usar incluir <Pds/CmdHelp...
Definition: CmdHelp.hpp:69
std::string titleversion
Definition: CmdHelp.hpp:87
std::string titledefault
Definition: CmdHelp.hpp:95
std::vector< Pds::HelpParamRow > data
Definition: CmdHelp.hpp:84
std::string version
Definition: CmdHelp.hpp:75
std::string titleprogram
Definition: CmdHelp.hpp:86
std::string titlelong
Definition: CmdHelp.hpp:91
std::string commandexample
Definition: CmdHelp.hpp:81
std::string titledescription
Definition: CmdHelp.hpp:93
std::string program
Definition: CmdHelp.hpp:72
std::string titledata
Definition: CmdHelp.hpp:94
std::string textdata
Definition: CmdHelp.hpp:96
std::string titleshort
Definition: CmdHelp.hpp:92
std::string titlecommand
Definition: CmdHelp.hpp:89
std::string titleabstract
Definition: CmdHelp.hpp:88
std::string abstract
Definition: CmdHelp.hpp:78
std::string titleparameters
Definition: CmdHelp.hpp:90
CmdHelp(void)
Crea un objeto de tipo Pds::CmdHelp.
bool SetAbstract(const std::string &abstract)
Escribe el abstract.
CmdHelp(const std::string &program, const std::string &version)
Crea un objeto de tipo Pds::CmdHelp.
bool IsEmpty(void) const
Retorna true si el objeto está inicializado o false si no.
bool Print(void) const
Imprime por consola el help del programa.
bool SetCommandExample(const std::string &commandexample)
Coloca un exemplo de uso del programa.
bool AddParam(const unsigned int &ptype, const std::string &plong, const std::string &pshort, const std::string &description, const std::string &bydefault="")
Agrega datos de parámetros del programa.
Nombre de espacio para Pds (Procesamiento Digital de Senales)
Definition: AbstractRV.hpp:42
std::string description
Definition: CmdHelp.hpp:57
unsigned int param_type
Definition: CmdHelp.hpp:54
std::string param_long
Definition: CmdHelp.hpp:55
std::string bydefault
Definition: CmdHelp.hpp:58
std::string param_short
Definition: CmdHelp.hpp:56

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed