Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Namespaces | Functions
string_util.hpp File Reference
#include <cstdint>
#include <cstring>
#include <string>
#include <cstdarg>
#include <memory>
#include <type_traits>
#include <vector>
#include <jau/cpp_lang_util.hpp>
#include <jau/packed_attribute.hpp>
#include <jau/type_traits_queries.hpp>
#include <jau/int_types.hpp>
#include <jau/int_math.hpp>
Include dependency graph for string_util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  jau
 __pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
 

Functions

std::string & jau::byteHexString (std::string &dest, const uint8_t value, const bool lowerCase) noexcept
 Produce a hexadecimal string representation of the given byte value. More...
 
template<class uint8_container_type , std::enable_if_t< std::is_integral_v< typename uint8_container_type::value_type > &&std::is_convertible_v< typename uint8_container_type::value_type, uint8_t >, bool > = true>
std::string jau::bytesHexString (const uint8_container_type &bytes, const bool lsbFirst, const bool lowerCase=true) noexcept
 
std::string jau::bytesHexString (const void *data, const nsize_t offset, const nsize_t length, const bool lsbFirst, const bool lowerCase=true) noexcept
 Produce a hexadecimal string representation of the given byte values. More...
 
std::string jau::format_string (const char *format,...) noexcept
 Returns a string according to printf() formatting rules and variable number of arguments following the format argument. More...
 
std::string jau::get_string (const uint8_t *buffer, nsize_t const buffer_len, nsize_t const max_len) noexcept
 Returns a C++ String taken from buffer with maximum length of min(max_len, max_len). More...
 
size_t jau::hexStringBytes (std::vector< uint8_t > &out, const std::string &hexstr, const bool lsbFirst, const bool checkLeading0x) noexcept
 Converts a given hexadecimal string representation into a byte vector. More...
 
size_t jau::hexStringBytes (std::vector< uint8_t > &out, const uint8_t hexstr[], const size_t hexstr_len, const bool lsbFirst, const bool checkLeading0x) noexcept
 See hexStringBytes() More...
 
std::vector< std::string > jau::split_string (const std::string &str, const std::string &separator) noexcept
 Split given string str at separator into the resulting std::vector excluding the separator sequence . More...
 
template<class value_type , std::enable_if_t< std::is_integral_v< value_type >, bool > = true>
std::string jau::to_decstring (const value_type &v, const char separator=',', const nsize_t width=0) noexcept
 Produce a decimal string representation of an integral integer value. More...
 
template<class value_type , std::enable_if_t< std::is_pointer_v< value_type >, bool > = true>
std::string jau::to_hexstring (value_type const &v) noexcept
 Produce a lower-case hexadecimal string representation of the given pointer. More...
 
bool jau::to_integer (long long &result, const char *str, size_t str_len, const char limiter='\0', const char *limiter_pos=nullptr)
 
bool jau::to_integer (long long &result, const std::string &str, const char limiter='\0', const char *limiter_pos=nullptr)
 
template<class value_type , std::enable_if_t< std::is_integral_v< value_type >||std::is_floating_point_v< value_type >, bool > = true>
std::string jau::to_string (const value_type &ref)
 
template<typename T >
std::string jau::to_string (std::vector< T > const &list)
 
template<typename T >
std::string jau::to_string (std::vector< T > const &list, const std::string &delim)
 
std::string jau::toLower (const std::string &s) noexcept
 
std::string & jau::toLowerInPlace (std::string &s) noexcept
 
std::string jau::trim (const std::string &s) noexcept
 trim copy More...
 
void jau::trimInPlace (std::string &s) noexcept
 trim in place More...
 
std::string jau::vformat_string (const char *format, va_list ap) noexcept
 Returns a string according to vprintf() formatting rules using va_list instead of a variable number of arguments. More...