Adds GetAttributeLabelsInGroup.
This commit is contained in:
@@ -5,7 +5,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace SBF {
|
namespace SBF {
|
||||||
|
namespace {
|
||||||
using std::string;
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
} // End namespace
|
||||||
|
|
||||||
string GetAttributeGroupLabel(int attributeGroupId) {
|
string GetAttributeGroupLabel(int attributeGroupId) {
|
||||||
if (attributeGroupId > 0 && attributeGroupId <= kAttributeGroupsCount) {
|
if (attributeGroupId > 0 && attributeGroupId <= kAttributeGroupsCount) {
|
||||||
@@ -116,6 +119,22 @@ void FillAttributeLabelsInGroup(std::vector<std::string>& labels, int groupId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<string> GetAttributeLabelsInGroup(int group_id) {
|
||||||
|
vector<string> labels;
|
||||||
|
switch (group_id) {
|
||||||
|
case kAttributeGroupPhysicalId:
|
||||||
|
FillPhysicalAttributeLabels(labels);
|
||||||
|
break;
|
||||||
|
case kAttributeGroupSocialId:
|
||||||
|
FillSocialAttributeLabels(labels);
|
||||||
|
break;
|
||||||
|
case kAttributeGroupMentalId:
|
||||||
|
FillMentalAttributeLabels(labels);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return labels;
|
||||||
|
}
|
||||||
|
|
||||||
void FillPhysicalAttributeLabels(std::vector<std::string>& labels) {
|
void FillPhysicalAttributeLabels(std::vector<std::string>& labels) {
|
||||||
labels.clear();
|
labels.clear();
|
||||||
for (int id = 1; id <= kPhysicalAttributesCount; id++) {
|
for (int id = 1; id <= kPhysicalAttributesCount; id++) {
|
||||||
|
|||||||
@@ -159,6 +159,11 @@ void FillAttributeGroupLabels(std::vector<std::string>& labels);
|
|||||||
/// @param group_id The group to fill attribute labels for.
|
/// @param group_id The group to fill attribute labels for.
|
||||||
void FillAttributeLabelsInGroup(std::vector<std::string>& labels, int group_id);
|
void FillAttributeLabelsInGroup(std::vector<std::string>& labels, int group_id);
|
||||||
|
|
||||||
|
/// @brief Gets the valid attribute labels in a specific group.
|
||||||
|
/// @param group_id The group to fill attribute labels for.
|
||||||
|
/// @return The filled vector.
|
||||||
|
std::vector<std::string> GetAttributeLabelsInGroup(int group_id);
|
||||||
|
|
||||||
/// @brief Fills the provided vector with all of the valid physical attribute labels.
|
/// @brief Fills the provided vector with all of the valid physical attribute labels.
|
||||||
/// @param labels The vector to fill. It will be cleared first.
|
/// @param labels The vector to fill. It will be cleared first.
|
||||||
void FillPhysicalAttributeLabels(std::vector<std::string>& labels);
|
void FillPhysicalAttributeLabels(std::vector<std::string>& labels);
|
||||||
|
|||||||
Reference in New Issue
Block a user