C/C++ Code Style: update conventions for type & value naming #80

Open
Campbell Barton wants to merge 1 commits from ideasman42/blender-developer-docs:pr-enum-naming-convention into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 7348985ca2 - Show all commits

View File

@ -99,7 +99,19 @@ int64_t size() const {...}
### Enums ### Enums
- Labels in enums should be in all capitals. - Enum type names should avoid being confused with related structs or classes.
Recommended suffixes include:
- `Type` & `Mode` for discrete values.
- `Flag` & `Mask` for values which are treated as bit-masks.
However these are guidelines which may be applied selectively.
Terms such as `Direction`, `Stage`, `Code` & `Method` (among others) are
sufficiently descriptive not to require one of the recommended suffixes.
- C style enum labels in enums should be in all capitals.
- C++ style enums labels which use `enum class` should use pascal-case.
- Enums used in DNA files should have explicit values assigned. - Enums used in DNA files should have explicit values assigned.
### Function arguments ### Function arguments