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>
Go to the source code of this file.
|
namespace | mmce |
| Utilities specified for mmCEsim.
|
|
|
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 > |
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...
|
|
Utilities.
- Author
- Wuqiong Zhao (wqzha.nosp@m.o@se.nosp@m.u.edu.nosp@m..cn)
- Version
- 0.3.0
- Date
- 2023-07-29
- Copyright
- Copyright (c) 2022-2023 Wuqiong Zhao (Teddy van Jerry)
◆ appDir()
static std::string appDir |
( |
| ) |
|
|
inlinestatic |
◆ contains()
template<typename T >
static bool contains |
( |
const T & |
container, |
|
|
const typename T::value_type |
value |
|
) |
| |
|
inlinestatic |
◆ dataDir()
static std::string dataDir |
( |
| ) |
|
|
inlinestatic |
◆ homeDir()
static std::string homeDir |
( |
| ) |
|
|
inlinestatic |
◆ isQuoted()
static bool isQuoted |
( |
const std::string & |
s, |
|
|
char |
c = '"' |
|
) |
| |
|
inlinestatic |
◆ isUInt()
static bool isUInt |
( |
const std::string & |
s | ) |
|
|
inlinestatic |
◆ ltrim()
static void ltrim |
( |
std::string & |
s | ) |
|
|
inlinestatic |
◆ ltrim_copy()
static std::string ltrim_copy |
( |
std::string |
s | ) |
|
|
inlinestatic |
◆ randomString()
static std::string randomString |
( |
std::string::size_type |
length | ) |
|
|
static |
◆ removeQuote()
static std::string removeQuote |
( |
const std::string & |
s | ) |
|
|
static |
◆ 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 |
◆ rtrim_copy()
static std::string rtrim_copy |
( |
std::string |
s | ) |
|
|
inlinestatic |
◆ 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 |
◆ trim()
static void trim |
( |
std::string & |
s | ) |
|
|
inlinestatic |
◆ trim_copy()
static std::string trim_copy |
( |
std::string |
s | ) |
|
|
inlinestatic |