mmCEsim 0.3.0
mmWave Channel Estimation Simulation
utils.h File Reference

Utilities. More...

#include <algorithm>
#include <cctype>
#include <random>
#include <sstream>
#include <string>
#include <vector>
#include "_boost_config.h"
#include <boost/dll/runtime_symbol_info.hpp>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mmce
 Utilities specified for mmCEsim.
 

Functions

static void ltrim (std::string &s)
 
static void rtrim (std::string &s)
 
static void trim (std::string &s)
 
static std::string ltrim_copy (std::string s)
 
static std::string rtrim_copy (std::string s)
 
static std::string trim_copy (std::string s)
 
template<typename T >
strAs (const std::string &s)
 
static bool isUInt (const std::string &s)
 Check if the string is an unsigned integer. More...
 
static bool isQuoted (const std::string &s, char c='"')
 
static std::string removeQuote (const std::string &s)
 
static std::string & removeSpaceInPlace (std::string &str)
 
static std::string removeSpaceCopy (const std::string &str)
 
static std::string stringVecAsString (const std::vector< std::string > &l, std::string div=" ")
 
template<typename T >
static bool contains (const T &container, const typename T::value_type value)
 
static std::string homeDir ()
 
static std::string appDir ()
 
static std::string dataDir ()
 
static std::string randomString (std::string::size_type length)
 
template<typename T >
static std::string mmce::to_string (const T &x)
 Change a number to string. More...
 

Detailed Description

Utilities.

Author
Wuqiong Zhao (wqzha.nosp@m.o@se.nosp@m.u.edu.nosp@m..cn)
Version
0.3.0
Date
2023-07-29

Function Documentation

◆ appDir()

static std::string appDir ( )
inlinestatic
Here is the caller graph for this function:

◆ contains()

template<typename T >
static bool contains ( const T &  container,
const typename T::value_type  value 
)
inlinestatic
Here is the caller graph for this function:

◆ dataDir()

static std::string dataDir ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ homeDir()

static std::string homeDir ( )
inlinestatic
Here is the caller graph for this function:

◆ isQuoted()

static bool isQuoted ( const std::string &  s,
char  c = '"' 
)
inlinestatic
Here is the caller graph for this function:

◆ isUInt()

static bool isUInt ( const std::string &  s)
inlinestatic

Check if the string is an unsigned integer.

Parameters
sthe string
Note
Ref: https://stackoverflow.com/a/4654718/15080514
Here is the caller graph for this function:

◆ ltrim()

static void ltrim ( std::string &  s)
inlinestatic
Here is the caller graph for this function:

◆ ltrim_copy()

static std::string ltrim_copy ( std::string  s)
inlinestatic
Here is the call graph for this function:

◆ randomString()

static std::string randomString ( std::string::size_type  length)
static

◆ removeQuote()

static std::string removeQuote ( const std::string &  s)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSpaceCopy()

static std::string removeSpaceCopy ( const std::string &  str)
inlinestatic

◆ removeSpaceInPlace()

static std::string & removeSpaceInPlace ( std::string &  str)
inlinestatic

◆ rtrim()

static void rtrim ( std::string &  s)
inlinestatic
Here is the caller graph for this function:

◆ rtrim_copy()

static std::string rtrim_copy ( std::string  s)
inlinestatic
Here is the call graph for this function:

◆ strAs()

template<typename T >
T strAs ( const std::string &  s)

◆ stringVecAsString()

static std::string stringVecAsString ( const std::vector< std::string > &  l,
std::string  div = " " 
)
static
Here is the caller graph for this function:

◆ trim()

static void trim ( std::string &  s)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim_copy()

static std::string trim_copy ( std::string  s)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function: