Class contains common OKS classes and methods.
More...
#include <defs.hpp>
Class contains common OKS classes and methods.
Definition at line 41 of file defs.hpp.
◆ error_msg() [1/2]
std::ostream & dunedaq::oks::Oks::error_msg |
( |
const char * | msg | ) |
|
|
static |
Definition at line 556 of file kernel.cpp.
557{
558 std::cerr << "ERROR [" << msg << "]:\n"; return std::cerr;
559}
◆ error_msg() [2/2]
static std::ostream & dunedaq::oks::Oks::error_msg |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 47 of file defs.hpp.
static std::ostream & error_msg(const char *)
◆ real_path()
bool dunedaq::oks::Oks::real_path |
( |
std::string & | path, |
|
|
bool | ignore_errors ) |
|
static |
Definition at line 594 of file kernel.cpp.
595{
596 char resolved_name[PATH_MAX];
597
598 if(realpath(path.c_str(), resolved_name) != 0) {
599 path = resolved_name;
600 return true;
601 }
602 else {
603 if(ignore_errors) {
604 TLOG_DEBUG( 3) <<
"realpath(\'" << path <<
"\') has failed with code " << errno <<
": \'" <<
strerror(errno) <<
'\'' ;
605 return false;
606 }
607 else {
608 throw CannotResolvePath(path, errno);
609 }
610 }
611}
#define TLOG_DEBUG(lvl,...)
const std::string strerror(int error)
Convert C error number to string.
◆ substitute_variables()
void dunedaq::oks::Oks::substitute_variables |
( |
std::string & | s | ) |
|
|
static |
Definition at line 570 of file kernel.cpp.
571{
572 std::string::size_type pos = 0;
573 std::string::size_type p_start = 0;
574 std::string::size_type p_end = 0;
575
576 while(
577 ((p_start =
s.find(
"$(", pos)) != std::string::npos) &&
578 ((p_end =
s.find(
")", p_start + 2)) != std::string::npos)
579 ) {
580 std::string var(s, p_start + 2, p_end - p_start - 2);
581
582 char * env = getenv(var.c_str());
583
584 if(env) {
585 s.replace(p_start, p_end - p_start + 1, env);
586 }
587
588 pos = p_start + 1;
589 }
590}
◆ warning_msg() [1/2]
std::ostream & dunedaq::oks::Oks::warning_msg |
( |
const char * | msg | ) |
|
|
static |
Definition at line 563 of file kernel.cpp.
564{
565 std::cerr << "WARNING [" << msg << "]:\n"; return std::cerr;
566}
◆ warning_msg() [2/2]
static std::ostream & dunedaq::oks::Oks::warning_msg |
( |
const std::string & | s | ) |
|
|
inlinestatic |
Definition at line 48 of file defs.hpp.
static std::ostream & warning_msg(const char *)
The documentation for this class was generated from the following files:
- /github/workspace/dunedaq/sourcecode/oks/include/oks/defs.hpp
- /github/workspace/dunedaq/sourcecode/oks/src/kernel.cpp