24std::map<std::string, std::string>
27 std::map<std::string, std::string>
vCard;
29 std::string_view line;
32 const auto dblptPos = line.find(
':');
33 if (dblptPos == std::string::npos)
35 vCard.emplace(line.substr(0, dblptPos), line.substr(dblptPos + 1));
41std::map<std::string, std::string>
55 size_t estimatedSize = 0;
56 for (
const auto& [key, value] :
vCard) {
59 estimatedSize += key.size() + value.size() + 2;
67 for (
const auto& [key, value] :
vCard) {
70 result += key +
':' + value +
'\n';
81 for (
auto it =
vCard.begin(); it !=
vCard.end(); ) {
bool getline(std::string_view &str, std::string_view &line, char delim='\n')
Similar to @getline_full but skips empty results.
static bool starts_with(std::string_view str, std::string_view prefix)
std::map< std::string, std::string > toMap(std::string_view content)
Payload to vCard.
std::map< std::string, std::string > initVcard()
std::string toString(const std::map< std::string, std::string > &vCard)
void removeByKey(std::map< std::string, std::string > &vCard, std::string_view key)
static constexpr std::string_view END_LINE_TOKEN
static constexpr std::string_view BEGIN_TOKEN
static constexpr std::string_view END_TOKEN_KEY
static constexpr std::string_view END_TOKEN
static constexpr std::string_view BEGIN_TOKEN_KEY
static constexpr std::string_view PHOTO_PNG
static constexpr std::string_view FORMATTED_NAME
static constexpr std::string_view VCARD_VERSION