1 #ifndef __JEEP__JEEPTOOLKIT__
2 #define __JEEP__JEEPTOOLKIT__
25 namespace JPP {
using namespace JEEP; }
35 static const char*
const PATH =
"PATH";
36 static const char*
const SHELL =
"SHELL";
71 string buffer = file_name;
75 if (pos == string::npos) {
79 return buffer.replace(pos, 1, value);
93 string::const_iterator p = file_name. begin();
94 string::const_reverse_iterator q = file_name.rbegin();
96 for ( ; p != file_name.end() && q != file_name.rend() && isspace(*p); ++p) {}
97 for ( ; p != file_name.end() && q != file_name.rend() && isspace(*q); ++q) {}
115 if (pos != string::npos)
116 return file_name.substr(pos + 1);
132 const string buffer =
strip(file_name);
135 if (pos != string::npos)
136 return buffer.substr(pos + 1);
152 const string buffer =
strip(file_name);
155 if (pos != string::npos)
156 return buffer.substr(0, pos + 1);
172 const string buffer =
strip(path);
199 return strip(file_name);
201 return buffer +
strip(file_name);
224 const string buffer(getenv(variable.c_str()));
226 if (!buffer.empty()) {
233 path = buffer.substr(pos,len);
235 }
while (!ifstream(
getFilename(
path, file_name).c_str()).good() && len != string::npos && (pos += len + 1) != buffer.length());
271 if (pos != string::npos)
272 return type_name.substr(0, pos);
290 if (pos != string::npos)
291 return type_name.substr(pos + 2);
309 if (pos != string::npos)
310 return file_name.substr(0, pos);
323 const char*
const url = getenv(
JPP_PAGES);
354 return new ifstream (file_name.c_str());
375 return new ofstream (file_name.c_str());
391 if (dynamic_cast<ifstream*> (pf) != NULL) {
dynamic_cast<ifstream*
> (pf)->
close();
return; }
392 if (dynamic_cast<igzstream*>(pf) != NULL) {
dynamic_cast<igzstream*
>(pf)->
close();
return; }
406 if (dynamic_cast<ofstream*> (pf) != NULL) {
dynamic_cast<ofstream*
> (pf)->
close();
return; }
407 if (dynamic_cast<ogzstream*>(pf) != NULL) {
dynamic_cast<ogzstream*
>(pf)->
close();
return; }
static const char *const TYPENAME_SEPARATOR
type name separator
static const char *const LD_LIBRARY_PATH
Nick names of environment variables.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
std::string getFullPath(const std::string &path)
Get full path, i.e. add JEEP::PATHNAME_SEPARATOR if necessary.
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
T * open(const std::string &file_name)
Open file.
Exception for missing value.
static const char PROTOCOL_SEPARATOR
protocol separator
std::string getClassname(const std::string &type_name)
Get type name, i.e. part after JEEP::TYPENAME_SEPARATOR.
void close(std::istream *pf)
Close file.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::string getURL()
Get URL of document pages.
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DQSIM<$WORKDIR/ev_configure_dqsimulator.txt > RC_DWRT path
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
std::string getProtocol(const std::string &file_name)
Get protocol, i.e. part before first JEEP::PROTOCOL_SEPARATOR if any.
std::string setWildCard(const std::string &file_name, const std::string &value)
Get file name by setting wild card to given value.
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
static const char FILENAME_SEPARATOR
file name separator
static const char PATHLIST_SEPARATOR
path list separator
static const char FILENAME_WILD_CARD
wild card character for file name substitution
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
static const char *const JPP_PAGES
Jpp document pages.
std::string getFullFilename(const std::string &variable, const std::string &file_name)
Get full file name (see JEEP::getPath).
static const char *const SHELL
SHELL.
static const char PATHNAME_SEPARATOR
path name separator
static const char *const PATH
binary file paths
bool hasWildCard(const std::string &file_name)
Check presence of wild card.