Home | Develop | Download | Contact
RaCmd.hpp
1/*
2 * RaCmd.hpp
3 *
4 * Copyright 2018 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
30#ifndef __PDS_RACMD_HPP__
31#define __PDS_RACMD_HPP__
32
33#include <string>
34#include <vector>
35
36
46namespace Pds{
51namespace Ra{
52
53
54
55
72 const std::string FileSep =
73 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
74 "\\";
75 #else
76 "/";
77 #endif
78
90 const char CharFileSep =
91 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
92 '\\';
93 #else
94 '/';
95 #endif
96
97
111 std::string HomeDir(void);
112
125 std::string ProgramPath(void);
126
127
140 std::string ProgramDirPath(void);
141
155 std::string Pwd(void);
156
170 bool Cd(const std::string &Directory);
201 bool MakeDir(const std::string &dirpath);
202
214 int System(const std::string &CMD, const std::string &Directory="");
215
230 bool Popen(const std::string& CMD,std::vector<std::string>& Out,bool DropSpace=false,unsigned int SIZEBUF=4096);
235namespace AnsiScape{
241 const std::string TextReset ="\033[0m";
242
244
245 const std::string Black ="\033[0;30m";
246 const std::string Red ="\033[0;31m";
247 const std::string Green ="\033[0;32m";
248 const std::string Brown ="\033[0;33m";
249 const std::string Blue ="\033[0;34m";
250 const std::string Purple ="\033[0;35m";
251 const std::string Cyan ="\033[0;36m";
252 const std::string White ="\033[0;37m";
253
255
256 const std::string BoldBlack ="\033[1;30m";
257 const std::string BoldRed ="\033[1;31m";
258 const std::string BoldGreen ="\033[1;32m";
259 const std::string BoldYellow ="\033[1;33m";
260 const std::string BoldBlue ="\033[1;34m";
261 const std::string BoldPurple ="\033[1;35m";
262 const std::string BoldCyan ="\033[1;36m";
263 const std::string BoldWhite ="\033[1;37m";
264
266
267 const std::string HighBlack ="\033[0;90m";
268 const std::string HighRed ="\033[0;91m";
269 const std::string HighGreen ="\033[0;92m";
270 const std::string HighBrown ="\033[0;93m";
271 const std::string HighBlue ="\033[0;94m";
272 const std::string HighPurple ="\033[0;95m";
273 const std::string HighCyan ="\033[0;96m";
274 const std::string HighWhite ="\033[0;97m";
275
277
278 const std::string BoldHighBlack ="\033[1;90m";
279 const std::string BoldHighRed ="\033[1;91m";
280 const std::string BoldHighGreen ="\033[1;92m";
281 const std::string BoldHighBrown ="\033[1;93m";
282 const std::string BoldHighBlue ="\033[1;94m";
283 const std::string BoldHighPurple ="\033[1;95m";
284 const std::string BoldHighCyan ="\033[1;96m";
285 const std::string BoldHighWhite ="\033[1;97m";
286
287
289
290 const std::string UnderBlack ="\033[4;30m";
291 const std::string UnderRed ="\033[4;31m";
292 const std::string UnderGreen ="\033[4;32m";
293 const std::string UnderYellow ="\033[4;33m";
294 const std::string UnderBlue ="\033[4;34m";
295 const std::string UnderPurple ="\033[4;35m";
296 const std::string UnderCyan ="\033[4;36m";
297 const std::string UnderWhite ="\033[4;37m";
298
300 const std::string BackBlack ="\033[40m";
301 const std::string BackRed ="\033[41m";
302 const std::string BackGreen ="\033[42m";
303 const std::string BackYellow ="\033[43m";
304 const std::string BackBlue ="\033[44m";
305 const std::string BackPurple ="\033[45m";
306 const std::string BackCyan ="\033[46m";
307 const std::string BackWhite ="\033[47m";
308
309
311 const std::string HighBackBlack ="\033[0;100m";
312 const std::string HighBackRed ="\033[0;101m";
313 const std::string HighBackGreen ="\033[0;102m";
314 const std::string HighBackYellow ="\033[0;103m";
315 const std::string HighBackBlue ="\033[0;104m";
316 const std::string HighBackPurple ="\033[0;105m";
317 const std::string HighBackCyan ="\033[0;106m";
318 const std::string HighBackWhite ="\033[0;107m";
319} // namespace AnsiScape
320
325} // namespace Ra
326} // namespace Pds
327
328
333#endif /* __PDS_RACMD_HPP__ */
std::string HomeDir(void)
Retorna una nueva cadena de texto con la dirección del directorio de usuario. HOME en gnu-linux y {HO...
bool Cd(const std::string &Directory)
Cambie the current working directory.
std::string ProgramPath(void)
Retorna un std::string con la ruta del programa que lo invoca.
int System(const std::string &CMD, const std::string &Directory="")
Executa uma comando.
std::string Pwd(void)
Retorna un std::string con la ruta actual.
const std::string FileSep
std::string con un separador de fichero "\\" para WINDOWS y "/" para linux.
Definition: RaCmd.hpp:72
bool Popen(const std::string &CMD, std::vector< std::string > &Out, bool DropSpace=false, unsigned int SIZEBUF=4096)
Executa uma comando.
bool MakeDir(const std::string &dirpath)
Crea un directorio recursivamente si es necesario.
const char CharFileSep
std::string con un separador de fichero "\\" para WINDOWS y "/" para linux.
Definition: RaCmd.hpp:90
std::string ProgramDirPath(void)
Retorna un std::string con la ruta del directorio del programa que lo invoca.
const std::string BoldBlack
Bold.
Definition: RaCmd.hpp:256
const std::string HighBackCyan
Definition: RaCmd.hpp:317
const std::string BackWhite
Definition: RaCmd.hpp:307
const std::string HighBlue
Definition: RaCmd.hpp:271
const std::string BoldHighWhite
Definition: RaCmd.hpp:285
const std::string UnderPurple
Definition: RaCmd.hpp:295
const std::string Green
Definition: RaCmd.hpp:247
const std::string UnderYellow
Definition: RaCmd.hpp:293
const std::string HighBackBlack
Background.
Definition: RaCmd.hpp:311
const std::string HighPurple
Definition: RaCmd.hpp:272
const std::string BackGreen
Definition: RaCmd.hpp:302
const std::string BoldHighGreen
Definition: RaCmd.hpp:280
const std::string HighCyan
Definition: RaCmd.hpp:273
const std::string Blue
Definition: RaCmd.hpp:249
const std::string UnderBlue
Definition: RaCmd.hpp:294
const std::string HighBackBlue
Definition: RaCmd.hpp:315
const std::string BoldHighBrown
Definition: RaCmd.hpp:281
const std::string Brown
Definition: RaCmd.hpp:248
const std::string BoldCyan
Definition: RaCmd.hpp:262
const std::string Black
Text color.
Definition: RaCmd.hpp:245
const std::string UnderGreen
Definition: RaCmd.hpp:292
const std::string BoldHighPurple
Definition: RaCmd.hpp:283
const std::string BackCyan
Definition: RaCmd.hpp:306
const std::string BoldYellow
Definition: RaCmd.hpp:259
const std::string HighRed
Definition: RaCmd.hpp:268
const std::string UnderBlack
Underline.
Definition: RaCmd.hpp:290
const std::string HighBrown
Definition: RaCmd.hpp:270
const std::string BoldPurple
Definition: RaCmd.hpp:261
const std::string BoldWhite
Definition: RaCmd.hpp:263
const std::string HighBackWhite
Definition: RaCmd.hpp:318
const std::string UnderCyan
Definition: RaCmd.hpp:296
const std::string HighGreen
Definition: RaCmd.hpp:269
const std::string HighBackPurple
Definition: RaCmd.hpp:316
const std::string HighBlack
High Intensity.
Definition: RaCmd.hpp:267
const std::string HighBackYellow
Definition: RaCmd.hpp:314
const std::string Red
Definition: RaCmd.hpp:246
const std::string White
Definition: RaCmd.hpp:252
const std::string TextReset
Definition: RaCmd.hpp:241
const std::string HighBackRed
Definition: RaCmd.hpp:312
const std::string BackBlue
Definition: RaCmd.hpp:304
const std::string Purple
Definition: RaCmd.hpp:250
const std::string BoldHighBlack
Bold High Intensity.
Definition: RaCmd.hpp:278
const std::string HighBackGreen
Definition: RaCmd.hpp:313
const std::string BackYellow
Definition: RaCmd.hpp:303
const std::string BackRed
Definition: RaCmd.hpp:301
const std::string BoldHighRed
Definition: RaCmd.hpp:279
const std::string BoldBlue
Definition: RaCmd.hpp:260
const std::string BoldGreen
Definition: RaCmd.hpp:258
const std::string BoldHighBlue
Definition: RaCmd.hpp:282
const std::string UnderRed
Definition: RaCmd.hpp:291
const std::string BoldHighCyan
Definition: RaCmd.hpp:284
const std::string BoldRed
Definition: RaCmd.hpp:257
const std::string BackPurple
Definition: RaCmd.hpp:305
const std::string BackBlack
Background.
Definition: RaCmd.hpp:300
const std::string HighWhite
Definition: RaCmd.hpp:274
const std::string UnderWhite
Definition: RaCmd.hpp:297
const std::string Cyan
Definition: RaCmd.hpp:251
Nombre de espacio para Pds (Procesamiento Digital de Senales)
Definition: AbstractRV.hpp:42

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed