SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
string.h File Reference

A collection of string-related utility functions. More...

#include <string>
#include <vector>

Go to the source code of this file.

Functions

std::vector< std::string > satdump::splitString (std::string input, char del)
 Split a string into multiples where a specific char is present.
void satdump::replaceAllStr (std::string &str, const std::string &from, const std::string &to)
 Replaces all occurences of a string in a string with another string. (lots of strings!)
bool satdump::isStringPresent (std::string searched, std::string keyword)
 Check if a pattern is present in the provided string. Case-insensitive.
std::string satdump::loadFileToString (std::string path)
 Load a text file into a std::string.
std::string satdump::ws2s (const std::wstring &wstr)
 Convert a std::wstring to std::string.
std::wstring satdump::s2ws (const std::string &str)
 Convert a std::string to std::wstring.

Detailed Description

A collection of string-related utility functions.

Function Documentation

◆ isStringPresent()

bool satdump::isStringPresent ( std::string searched,
std::string keyword )

Check if a pattern is present in the provided string. Case-insensitive.

Parameters
searchedstring to search in
keywordpattern to search
Returns
true if present

◆ loadFileToString()

std::string satdump::loadFileToString ( std::string path)

Load a text file into a std::string.

Parameters
pathfile path
Returns
loaded string

◆ replaceAllStr()

void satdump::replaceAllStr ( std::string & str,
const std::string & from,
const std::string & to )

Replaces all occurences of a string in a string with another string. (lots of strings!)

Parameters
strthe string to replace in
frompattern to replace
topattern to replace the old pattern with

◆ s2ws()

std::wstring satdump::s2ws ( const std::string & str)

Convert a std::string to std::wstring.

Parameters
wstrinput std::string
Returns
output std::wstring

◆ splitString()

std::vector< std::string > satdump::splitString ( std::string input,
char del )

Split a string into multiples where a specific char is present.

Parameters
inputthe string to split
deldelimiter character
Returns
string segments

◆ ws2s()

std::string satdump::ws2s ( const std::wstring & wstr)

Convert a std::wstring to std::string.

Parameters
wstrinput std::wstring
Returns
output std::string