Skip to content

Commit

Permalink
Changed from using a element in an array to the element itself
Browse files Browse the repository at this point in the history
  • Loading branch information
klingbolt committed Jul 7, 2023
1 parent 72ec83e commit b7b0b6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xml_converter/generators/cpp_templates/compoundvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace std;
compound_values = split(get_attribute_value(input), ",");
if (compound_values.size() == {{ attribute_variables|length }}) {
{% for n, attribute_variable in enumerate(attribute_variables) %}
{{attribute_name}}.{{attribute_variables[n].attribute_name}} = std::stof(compound_values[{{n}}]);
{{attribute_name}}.{{attribute_variable.attribute_name}} = std::stof(compound_values[{{n}}]);
{% endfor %}
}
return {{attribute_name}};
Expand All @@ -32,11 +32,11 @@ using namespace std;
string stringify_{{attribute_name}}({{class_name}} attribute_value) {
string output;
{% for n, attribute_variable in enumerate(attribute_variables) %}
{% if attribute_variables[n].attribute_name in xml_bundled_components %}
{% if attribute_variable.attribute_name in xml_bundled_components %}
{% if n == 0: %}
output = to_string(attribute_value.{{attribute_variables[n].attribute_name}});
output = to_string(attribute_value.{{attribute_variable.attribute_name}});
{% else %}
output = output + "," + to_string(attribute_value.{{attribute_variables[n].attribute_name}});
output = output + "," + to_string(attribute_value.{{attribute_variable.attribute_name}});
{% endif %}
{% endif %}
{% endfor %}
Expand Down

0 comments on commit b7b0b6a

Please sign in to comment.