Merge pull request 'Changes to the style guide' (#4) from documentation-changes into main
Reviewed-on: #4
This commit is contained in:
commit
88fee1843c
1 changed files with 7 additions and 6 deletions
13
README.md
13
README.md
|
@ -18,21 +18,22 @@ This document outlines the coding standards and best practices for the CIGUI lib
|
|||
- Header files: `.hpp` for C++ headers, `.h` for C-compatible headers
|
||||
- Implementation files: `.cpp`
|
||||
- Template implementation files: `.inl`
|
||||
- File names: lowercase with underscores (e.g., `grid_layout.hpp`)
|
||||
- File names: PascalCase (e.g., `GridLayout.hpp`)
|
||||
|
||||
#### Classes and Types
|
||||
|
||||
- Class names: PascalCase (e.g., `Button`, `GridLayout`)
|
||||
- Type aliases/typedefs: PascalCase (e.g., `using WidgetPtr = std::shared_ptr<View>`)
|
||||
- Type aliases/typedefs: lowercase (e.g., `using view_ptr = std::shared_ptr<View>`)
|
||||
- Enum names: PascalCase
|
||||
- Enum values: PascalCase (e.g., `enum class Alignment { TopLeft, Center, BottomRight }`)
|
||||
- Enum values: PascalCase/UPPERCASE (e.g., `enum class Alignment { TopLeft, Center, BottomRight }` or `enum class Direction { LEFT, UP, RIGHT, DOWN }`)
|
||||
|
||||
#### Functions and Variables
|
||||
|
||||
- Function names: camelCase (e.g., `getPosition()`, `setVisible()`)
|
||||
- API function names: camelCase (e.g., `getPosition()`, `setVisible()`)
|
||||
- Internal function names: lowercase (e.g. `render_view()`, `get_visibility()`)
|
||||
- Variable names: camelCase (e.g., `buttonText`, `isVisible`)
|
||||
- Member variables: prefix with `m_` (e.g., `m_position`, `m_size`)
|
||||
- Static variables: prefix with `s_` (e.g., `s_defaultFont`)
|
||||
- Member variables: prefix with `m_` + UpperCamelCase (e.g., `m_Position`, `m_Size`)
|
||||
- Static variables: prefix with `s_` + UpperCamelCase (e.g., `s_DefaultFont`)
|
||||
- Constants and macros: ALL_CAPS with underscores (e.g., `MAX_WIDGETS`, `CIGUI_API`)
|
||||
|
||||
### Code Structure
|
||||
|
|
Loading…
Reference in a new issue