Mantis App v0.1.13
Loading...
Searching...
No Matches
string_utils.cpp File Reference
#include "../../include/mantis/utils/utils.h"
#include <algorithm>
Include dependency graph for string_utils.cpp:

Namespaces

namespace  mantis
 router.h
 

Functions

std::optional< jsonmantis::tryParseJsonStr (const std::string &json_str)
 Attempt to parse a JSON string.
 
void mantis::toLowerCase (std::string &str)
 Converts a string to its lowercase variant.
 
void mantis::toUpperCase (std::string &str)
 Converts a string to its uppercase variant.
 
std::string mantis::trim (const std::string &s)
 Trims leading and trailing whitespaces from a string.
 
std::string mantis::generateTimeBasedId ()
 Generate a time base UUID.
 
std::string mantis::generateReadableTimeId ()
 Generates a readable time-based UUID.
 
std::string mantis::generateShortId (size_t length=12)
 Generates a short UUID.
 
std::vector< std::string > mantis::splitString (const std::string &input, const std::string &delimiter)
 Split given string based on given delimiter.
 
std::string mantis::getEnvOrDefault (const std::string &key, const std::string &defaultValue)
 Retrieves a value from an environment variable or a default value if the env variable was not set.