Contains common functions related to manipulating strings.
More...
#include <algorithm>
#include <sstream>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string>
#include <vector>
Go to the source code of this file.
Contains common functions related to manipulating strings.
◆ dumpBinary()
| __JAFFAR_COMMON__INLINE__ std::string jaffarCommon::string::dumpBinary |
( |
const void * |
data, |
|
|
const size_t |
size |
|
) |
| |
Converts a binary input into a readable hex string
- Parameters
-
| [in] | data | Binary data to print |
| [in] | size | Number of bytes in the input data |
- Returns
- The C++ string produced
◆ formatString()
| __JAFFAR_COMMON__INLINE__ std::string jaffarCommon::string::formatString |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
Converts a C-formatted string into a C++ string
- Parameters
-
| [in] | format | The format string |
| [in] | ... | The arguments to the format string |
- Returns
- The C++ string produced
◆ split() [1/2]
| __JAFFAR_COMMON__INLINE__ std::vector< std::string > jaffarCommon::string::split |
( |
const std::string & |
s, |
|
|
char |
delim |
|
) |
| |
Function to split a string into a vector of sub-strings delimited by a character
- Parameters
-
| [in] | s | The input string |
| [in] | delim | The separator that divides the substrings |
- Returns
- A vector containing all the substrings
◆ split() [2/2]
template<typename Out >
| __JAFFAR_COMMON__INLINE__ void jaffarCommon::string::split |
( |
const std::string & |
s, |
|
|
char |
delim, |
|
|
Out |
result |
|
) |
| |