Skip to content

Commit d1f03dc

Browse files
committed
[cpp-rest-sdk] remove unnecessary prefix for enum classes
1 parent eba901e commit d1f03dc

File tree

2 files changed

+18
-18
lines changed
  • modules/openapi-generator/src/main/resources/cpp-rest-sdk-client
  • samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model

2 files changed

+18
-18
lines changed

modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public:
123123
/// {{.}}
124124
/// </summary>
125125
{{/enumDescription}}
126-
{{classname}}_{{{name}}}{{^last}},{{/last}}
126+
{{{name}}}{{^last}},{{/last}}
127127
{{/enumVars}}
128128
{{/allowableValues}}
129129
};
@@ -136,14 +136,14 @@ public:
136136
std::map<e{{classname}},utility::string_t> enumToStrMap = {
137137
{{#allowableValues}}
138138
{{#enumVars}}
139-
{ e{{classname}}::{{classname}}_{{{name}}}, "{{{name}}}" }{{^-last}},{{/-last}}
139+
{ e{{classname}}::{{{name}}}, "{{{name}}}" }{{^-last}},{{/-last}}
140140
{{/enumVars}}
141141
{{/allowableValues}}
142142
};
143143
std::map<utility::string_t,e{{classname}}> strToEnumMap = {
144144
{{#allowableValues}}
145145
{{#enumVars}}
146-
{ "{{{name}}}", e{{classname}}::{{classname}}_{{{name}}} }{{^-last}},{{/-last}}
146+
{ "{{{name}}}", e{{classname}}::{{{name}}} }{{^-last}},{{/-last}}
147147
{{/enumVars}}
148148
{{/allowableValues}}
149149
};

samples/client/petstore/cpp-restsdk/client/include/CppRestPetstoreClient/model/Color.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class Color
5454

5555
enum class eColor
5656
{
57-
Color_BLACK,
58-
Color_WHITE,
59-
Color_BROWN,
60-
Color_GOLDEN,
61-
Color_MIXED,
57+
BLACK,
58+
WHITE,
59+
BROWN,
60+
GOLDEN,
61+
MIXED,
6262
};
6363

6464
eColor getValue() const;
@@ -67,18 +67,18 @@ class Color
6767
protected:
6868
eColor m_value;
6969
std::map<eColor,utility::string_t> enumToStrMap = {
70-
{ eColor::Color_BLACK, "BLACK" },
71-
{ eColor::Color_WHITE, "WHITE" },
72-
{ eColor::Color_BROWN, "BROWN" },
73-
{ eColor::Color_GOLDEN, "GOLDEN" },
74-
{ eColor::Color_MIXED, "MIXED" }
70+
{ eColor::BLACK, "BLACK" },
71+
{ eColor::WHITE, "WHITE" },
72+
{ eColor::BROWN, "BROWN" },
73+
{ eColor::GOLDEN, "GOLDEN" },
74+
{ eColor::MIXED, "MIXED" }
7575
};
7676
std::map<utility::string_t,eColor> strToEnumMap = {
77-
{ "BLACK", eColor::Color_BLACK },
78-
{ "WHITE", eColor::Color_WHITE },
79-
{ "BROWN", eColor::Color_BROWN },
80-
{ "GOLDEN", eColor::Color_GOLDEN },
81-
{ "MIXED", eColor::Color_MIXED }
77+
{ "BLACK", eColor::BLACK },
78+
{ "WHITE", eColor::WHITE },
79+
{ "BROWN", eColor::BROWN },
80+
{ "GOLDEN", eColor::GOLDEN },
81+
{ "MIXED", eColor::MIXED }
8282
};
8383

8484
};

0 commit comments

Comments
 (0)