Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
Generator
src
Tools
EvtLib
Utils.cxx
Go to the documentation of this file.
1
#include "
Tools/EvtLib/Utils.h
"
2
3
#include "
Framework/Messenger/Messenger.h
"
4
5
#include <wordexp.h>
6
7
//___________________________________________________________________________
8
void
genie::evtlib::Expand
(
std::string
&
s
)
9
{
10
wordexp_t
p
;
11
const
int
status
= wordexp(s.c_str(), &
p
, WRDE_SHOWERR | WRDE_UNDEF);
12
if
(status != 0){
13
LOG
(
"EvtLib"
,
pFATAL
) <<
"String '"
<< s
14
<<
"' returned error "
<< status <<
" from wordexp()."
;
15
exit(1);
16
}
17
18
if
(p.we_wordc == 0){
19
LOG
(
"EvtLib"
,
pFATAL
) <<
"String '"
<< s
20
<<
"' didn't expand to anything."
;
21
exit(1);
22
}
23
24
if
(p.we_wordc > 1){
25
LOG
(
"EvtLib"
,
pFATAL
) <<
"String '"
<< s
26
<<
"' expanded to "
<< p.we_wordc <<
" locations."
;
27
exit(1);
28
}
29
30
s = p.we_wordv[0];
31
32
wordfree(&p);
33
}
string
std::string string
Definition:
nybbler.cc:12
genie::evtlib::Expand
void Expand(std::string &s)
Expand env vars/homedirs/wildcards in s.
Definition:
Utils.cxx:8
pFATAL
#define pFATAL
Definition:
Messenger.h:56
LOG
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition:
Messenger.h:96
create_imaplist.status
int status
Definition:
create_imaplist.py:5
test.p
p
Definition:
test.py:223
Messenger.h
Utils.h
s
static QCString * s
Definition:
config.cpp:1042
Generated by
1.8.11