ifw-core 6.0.0
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
tools.hpp File Reference
#include <limits.h>
#include <stdarg.h>
#include <string>
#include <map>
#include <list>
#include <fstream>
#include <variant>
#include <ciiLogManager.hpp>
#include <ifw/core/utils/base/base.hpp>

Go to the source code of this file.

Namespaces

namespace  ifw
 
namespace  ifw::core
 
namespace  ifw::core::utils
 
namespace  ifw::core::utils::base
 
namespace  ifw::core::utils::base::testutils
 

Macros

#define IFW_LOCATION
 

Functions

std::string ifw::Write (const char *format,...)
 Create formatted string, return formatted string (C formatting convention).
 
std::string ifw::core::utils::base::ResolvePath (const std::string &filename)
 Resolve the filename if it contains env. variables, "~" and relative paths.
 
std::string ifw::core::utils::base::GenUniqueId (const std::string &prefix="")
 Generate a unique UUID based ID. A prefix may be prepended, if requested.
 
template<class TYPE >
void ifw::core::utils::base::CleanVector (const std::vector< TYPE > &vect, const TYPE &pattern, std::vector< TYPE > &clean_vect)
 Remove elements from list, which are equal to "pattern".
 
template<class TYPE >
void ifw::core::utils::base::CheckRange (const std::string &par, TYPE value, TYPE lower_limit, TYPE upper_limit)
 Check if a value is within a given range.
 
template<class TYPE >
void ifw::core::utils::base::CheckRange (const std::string &par, const TYPE &value, std::vector< TYPE > &valid_values)
 Check if a value is defined in a set.
 
template<class TYPE >
int32_t ifw::core::utils::base::ElInVector (const std::vector< TYPE > &vect, const TYPE &value)
 Check for specific element in the list. Return index if found, otherwise -1.
 
template<class TYPE >
std::string ifw::core::utils::base::DumpVector (const std::vector< TYPE > &vector, const std::string &separator="\n")
 Dump contents of a list into a string buffer.
 
template<class MAP_TYPE >
bool ifw::core::utils::base::ElInMap (const std::string &key, const MAP_TYPE &map)
 Check if a given key is contained in an STL map.
 
std::string ifw::core::utils::base::testutils::GetResDir (const std::string &module_path, const std::string &test_res_dir)
 Derives the "resource" directory from the current working point.
 
void ifw::core::utils::base::testutils::SetRootEnvVars (const std::string &module_path, const std::string &test_res_dir, const std::vector< std::string > &cfgpath_dirs)
 Set the root environment variables: CFGPATH, INTROOT, DATAROOT.
 
void IFW_DEBUG (const char *format,...)
 Print out a temporary debug log. These kind of logs should be removed from the code.
 

Macro Definition Documentation

◆ IFW_LOCATION

#define IFW_LOCATION
Value:
{\
std::string(__FILE__), \
std::string(__FUNCTION__), \
std::to_string(__LINE__)}

Function Documentation

◆ IFW_DEBUG()

void IFW_DEBUG ( const char * format,
... )

Print out a temporary debug log. These kind of logs should be removed from the code.