THRIFT-2729: C++ - .clang-format created and applied
Client: C++
Patch: Konrad Grochowski
make style command added
diff --git a/compiler/cpp/src/parse/t_enum.h b/compiler/cpp/src/parse/t_enum.h
index 94cb26e..59941e3 100644
--- a/compiler/cpp/src/parse/t_enum.h
+++ b/compiler/cpp/src/parse/t_enum.h
@@ -28,21 +28,14 @@
*
*/
class t_enum : public t_type {
- public:
- t_enum(t_program* program) :
- t_type(program) {}
+public:
+ t_enum(t_program* program) : t_type(program) {}
- void set_name(const std::string& name) {
- name_ = name;
- }
+ void set_name(const std::string& name) { name_ = name; }
- void append(t_enum_value* constant) {
- constants_.push_back(constant);
- }
+ void append(t_enum_value* constant) { constants_.push_back(constant); }
- const std::vector<t_enum_value*>& get_constants() {
- return constants_;
- }
+ const std::vector<t_enum_value*>& get_constants() { return constants_; }
t_enum_value* get_constant_by_name(const std::string name) {
const std::vector<t_enum_value*>& enum_values = get_constants();
@@ -72,8 +65,7 @@
t_enum_value* min_value;
if (enum_values.size() == 0) {
min_value = NULL;
- }
- else {
+ } else {
int min_value_value;
min_value = enum_values.front();
min_value_value = min_value->get_value();
@@ -93,8 +85,7 @@
t_enum_value* max_value;
if (enum_values.size() == 0) {
max_value = NULL;
- }
- else {
+ } else {
int max_value_value;
max_value = enum_values.back();
max_value_value = max_value->get_value();
@@ -108,16 +99,11 @@
return max_value;
}
- bool is_enum() const {
- return true;
- }
+ bool is_enum() const { return true; }
- virtual std::string get_fingerprint_material() const {
- return "enum";
- }
+ virtual std::string get_fingerprint_material() const { return "enum"; }
-
- private:
+private:
std::vector<t_enum_value*> constants_;
};