libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
stringhelpers.h File Reference
#include <cstddef>
#include <cstdint>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  Nickvision
 
namespace  Nickvision::Helpers
 
namespace  Nickvision::Helpers::StringHelpers
 

Concepts

concept  Nickvision::Helpers::StringHelpers::StringImplicitlyConstructible
 

Macros

#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
 

Functions

std::vector< std::byte > Nickvision::Helpers::StringHelpers::decode (const std::string &base64)
 Converts a base64 encoded string into a list of bytes.
 
std::string Nickvision::Helpers::StringHelpers::encode (const std::vector< std::byte > &bytes)
 Converts a list of bytes into a base64 encoded string.
 
bool Nickvision::Helpers::StringHelpers::isValidUrl (const std::string &s)
 Gets whether or not the provided string is a valid url.
 
std::string Nickvision::Helpers::StringHelpers::join (const std::vector< std::string > &values, const std::string &separator, bool separateLast=false)
 Concatenates the elements of a string list using the specified separator between each element.
 
std::string Nickvision::Helpers::StringHelpers::lower (std::string s)
 Gets a fully lowercase string from the provided string.
 
std::string Nickvision::Helpers::StringHelpers::newUuid ()
 Generates a new uuid value.
 
std::string Nickvision::Helpers::StringHelpers::newGuid ()
 Generates a new guid value.
 
std::string Nickvision::Helpers::StringHelpers::normalizeForFilename (const std::string &s, bool windowsOnly=false)
 Normalizes a string for use in a filename.
 
std::string Nickvision::Helpers::StringHelpers::replace (std::string s, const std::string &toReplace, const std::string &replace)
 Replaces a substring within a string with a new string.
 
std::string Nickvision::Helpers::StringHelpers::replace (std::string s, char toReplace, char replace)
 Replaces a character within a string with a new character.
 
template<StringImplicitlyConstructible T = std::string>
std::vector< T > Nickvision::Helpers::StringHelpers::split (std::string s, const std::string &delimiter)
 Splits a string based on a delimiter.
 
std::vector< std::string > Nickvision::Helpers::StringHelpers::splitArgs (std::string s)
 Splits a string based on argument delimiters.
 
std::string Nickvision::Helpers::StringHelpers::str (const std::wstring &s)
 Converts the wstring to a string.
 
unsigned int Nickvision::Helpers::StringHelpers::stoui (const std::string &s, size_t *idx=nullptr, int base=10)
 Converts a string to an unsigned int.
 
std::string Nickvision::Helpers::StringHelpers::trim (const std::string &s)
 Trims whitespace form the beginning and end of a string.
 
std::string Nickvision::Helpers::StringHelpers::trim (const std::string &s, char delimiter)
 Trims the delimiter character form the beginning and end of a string.
 
std::string Nickvision::Helpers::StringHelpers::upper (std::string s)
 Gets a fully uppercase string from the provided string.
 
std::wstring Nickvision::Helpers::StringHelpers::wstr (const std::string &s)
 Converts the string to a wstring.
 

Detailed Description

Author
Nicholas Logozzo nlogo.nosp@m.zzo2.nosp@m.25@gm.nosp@m.ail..nosp@m.com

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at https://www.gnu.org/copyleft/gpl.html

DESCRIPTION

Functions for working with strings.

Macro Definition Documentation

◆ _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING

#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING