Adds GetBackgroundLabels.

This commit is contained in:
2023-04-24 23:35:59 -07:00
parent d33e95a57d
commit 005fcf7f56
2 changed files with 17 additions and 2 deletions

View File

@@ -4,17 +4,28 @@
#include <vector>
namespace SBF {
std::string GetBackgroundLabel(int backgroundId) {
namespace {
using std::string;
using std::vector;
} // End namespace
string GetBackgroundLabel(int backgroundId) {
if (backgroundId > 0 && backgroundId <= kBackgroundsCount) {
return kBackgroundLabels[backgroundId];
}
return "";
}
void FillBackgroundLabels(std::vector<std::string>& labels) {
void FillBackgroundLabels(vector<string>& labels) {
labels.clear();
for (int id = 1; id <= kBackgroundsCount; id++) {
labels.push_back(kBackgroundLabels[id]);
}
}
vector<string> GetBackgroundLabels() {
vector<string> labels;
FillBackgroundLabels(labels);
return labels;
}
} // End namespace SBF