From 28ce6dcff7315f5f3071b5a00cd58a180dd33505 Mon Sep 17 00:00:00 2001 From: N0ffie Date: Sat, 12 Apr 2025 19:34:26 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bf12953..3a7dbe7 100644 --- a/README.md +++ b/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., `grid_layout.hpp`) #### Classes and Types - Class names: PascalCase (e.g., `Button`, `GridLayout`) -- Type aliases/typedefs: PascalCase (e.g., `using WidgetPtr = std::shared_ptr`) +- Type aliases/typedefs: lowercase (e.g., `using view_ptr = std::shared_ptr`) - 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 From d2ff63b087c5b99421bd1e26964e23fb54cb8d7d Mon Sep 17 00:00:00 2001 From: N0ffie Date: Sat, 12 Apr 2025 20:29:15 +0200 Subject: [PATCH 2/2] Update README.md Wrong example for file name rule --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a7dbe7..412e09e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ 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: PascalCase (e.g., `grid_layout.hpp`) +- File names: PascalCase (e.g., `GridLayout.hpp`) #### Classes and Types