Mercurial > minori
comparison src/core/strings.cc @ 320:1b5c04268d6a
services/kitsu: ACTUALLY finish GetAnimeList
there are some things the API just... doesn't provide. therefore
we have to request the genres separately any time a new anime info
box is opened...
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 12 Jun 2024 19:49:19 -0400 |
parents | f6a756c19bfb |
children | c32467cd06bb |
comparison
equal
deleted
inserted
replaced
319:d928ec7b6a0d | 320:1b5c04268d6a |
---|---|
32 std::string out; | 32 std::string out; |
33 | 33 |
34 for (unsigned long long i = 0; i < vector.size(); i++) { | 34 for (unsigned long long i = 0; i < vector.size(); i++) { |
35 out.append(vector.at(i)); | 35 out.append(vector.at(i)); |
36 if (i < vector.size() - 1) | 36 if (i < vector.size() - 1) |
37 out.append(delimiter); | |
38 } | |
39 | |
40 return out; | |
41 } | |
42 | |
43 std::string Implode(const std::set<std::string>& set, const std::string& delimiter) { | |
44 if (set.size() < 1) | |
45 return ""; | |
46 | |
47 std::string out; | |
48 | |
49 for (auto it = set.cbegin(); it != set.cend(); it++) { | |
50 out.append(*it); | |
51 if (it != std::prev(set.cend(), 1)) | |
52 out.append(delimiter); | 37 out.append(delimiter); |
53 } | 38 } |
54 | 39 |
55 return out; | 40 return out; |
56 } | 41 } |