Jpp
18.1.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JSystem
rename.cc
Go to the documentation of this file.
1
#include <string>
2
3
#include "
JSystem/JFilesystem.hh
"
4
5
#include "
Jeep/JParser.hh
"
6
7
8
/**
9
* \file
10
*
11
* Rename file.
12
*
13
* \author mdejong
14
*/
15
int
main
(
int
argc,
char
* argv[])
16
{
17
using namespace
std;
18
using namespace
JPP;
19
20
string
inputFile;
21
string
outputFile
;
22
23
try
{
24
25
JParser<>
zap;
26
27
zap[
'f'
] =
make_field
(inputFile);
28
zap[
'o'
] =
make_field
(
outputFile
);
29
30
zap(argc, argv);
31
}
32
catch
(
const
exception& error) {
33
FATAL
(error.what() << endl);
34
}
35
36
const
int
ierr =
rename
(inputFile,
outputFile
);
37
38
if
(ierr != 0) {
39
FATAL
(
"Error renaming "
<< ierr << endl);
40
}
41
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JSYSTEM::rename
int rename(const std::string &inputFile, const std::string &outputFile)
Rename file across file systems.
Definition:
JFilesystem.hh:49
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JFilesystem.hh
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
Generated by
1.8.5