#include <cmath>
#include <cstdlib>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
Go to the source code of this file.
|
std::vector< std::string > | osm::split_string (const std::string &input, const std::string ®ex) |
| Function used to split a string based on a certain reges. More...
|
|
std::string | osm::getCommandOut (const char *command) |
| Function used to get the output of a shell command. More...
|
|
template<typename T_err = std::runtime_error> |
T_err | osm::except_error_func (const std::string &beg="", std::string var=nullptr, const std::string &end="") |
| Function used to throw customized stdexception error. This function is extremely specific to my purposes and you can find examples usages in other my projects lik "osmanip" or "SAFD-algorithm". More...
|
|
template<typename T > |
bool | osm::is_escape (const T &str, const ANSI_SEARCH &flag) |
| This method is used to check if an input variable is an ANSI escape sequency or not. More...
|
|
template<typename T > |
T | osm::roundoff (T value, unsigned char prec) |
| Function to round a floating point to n-th decimal place after comma. More...
|
|
template<typename T > |
bool | osm::isFloatingPoint (const T &) |
| Function to check if an expression (not a type) is a floating point or not. I know this function is almost useless, but it has been created for lazy purposes and since it is used in other projects it cannot be eliminated now in order to not break backward compatibility. More...
|
|
template<typename T > |
T | osm::one (const T &iterating_var) |
| Function to find the incremented unit of a loop. Not easy to understand its purpose without context, but it is used to get the loop incremented unit in case of loops with floating-point indexes. See example usage in progress bars "update" method. More...
|
|
std::string | operator* (const std::string &generic_string, unsigned int integer) |
| Function to multiply a string by an integer. More...
|
|
- Author
- Gianluca Bianco (bianc.nosp@m.ogia.nosp@m.nluca.nosp@m.9@gm.nosp@m.ail.c.nosp@m.om)
- Date
- 2023-07-25
- Copyright
- Copyright (c) 2022 Gianluca Bianco under the MIT license.
◆ OSMANIP_UTILITY_GENERIC_HPP
#define OSMANIP_UTILITY_GENERIC_HPP |
◆ operator*()
std::string operator* |
( |
const std::string & |
generic_string, |
|
|
unsigned int |
integer |
|
) |
| |
|
inline |
Function to multiply a string by an integer.
- Parameters
-
generic_string | The string to be multiplied. |
integer | The integer to be multiplied. |
- Returns
- std::string The multiplied string.