1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04:00
polybar/include/utils/string.hpp
Michael Carlberg 9a0df75a91 feat(fs): New filesystem module
Module that displays details about
mounted filesystems, #84

Closes #153
2016-11-13 06:14:34 +01:00

37 lines
1.3 KiB
C++

#pragma once
#include <sstream>
#include "common.hpp"
LEMONBUDDY_NS
namespace string_util {
/**
* Hash type
*/
using hash_type = unsigned long;
bool contains(const string& haystack, const string& needle);
string upper(const string& s);
string lower(const string& s);
bool compare(const string& s1, const string& s2);
string replace(const string& haystack, string needle, string replacement);
string replace_all(const string& haystack, string needle, string replacement);
string squeeze(const string& haystack, char needle);
string strip(const string& haystack, char needle);
string strip_trailing_newline(const string& haystack);
string ltrim(const string& haystack, char needle);
string rtrim(const string& haystack, char needle);
string trim(const string& haystack, char needle);
string join(vector<string> strs, string delim);
vector<string>& split_into(string s, char delim, vector<string>& container);
vector<string> split(const string& s, char delim);
size_t find_nth(string haystack, size_t pos, string needle, size_t nth);
string floatval(float value, int decimals = 2, bool fixed = false, string locale = "");
string filesize(unsigned long long bytes, int decimals = 2, bool fixed = false, string locale = "");
string from_stream(const std::basic_ostream<char>& os);
hash_type hash(string src);
}
LEMONBUDDY_NS_END