diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index cd6eead0d5..db301816fd 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -17,7 +17,9 @@
+ 1.0 General Conventions +
+ 2.0 Data and Type Definitions +
+ 3.0 Functions +
+ 4.0 Statements +
do while
Statementgoto
+ 5.0 C++ +
++ Appendix A +
Last Updated: February 5, 2019
+Last Updated: June 5, 2019
@@ -2720,6 +2733,112 @@ error: See the discussion of pointers for information about theFAR
qualifier used above.
+
+ 5.0 C+++ |
+
+ There is no existing document that provides a complete coding standard for NuttX C++ files. + This section is included here to provide some minimal guidance in C++ code development. + In most details like indentation, spacing, and file organization, it is identical to the C coding standard. + But there are significant differences in the acceptable standard beyond that. + The primary differences are as follows: +
++ C++ style comments are not only permissible but are required (other than for the following exception). + This includes the block comments of in the Source File Structure described in an Appendix to this standard. +
++ Deoxygen tags are acceptable. As are C style comments when needed to provide DOxygen tags. +
++ There is currently no requirement to conform any specific C++ version. + However, for portability reasons, conformance to older, pre-C++11 standards is encouraged where reasonable. +
++ All naming must use CamelCase. + Use of the underbar character, '_' is discouraged. + This includes variables, classes, structures, ..., etc.: All user-nameable C++ elements. + Pre-processor definitions are still required to be all upper case. +
+
+ Local variable, method names, and function names must all begin with a lower case letter.
+ As examples, myLocalVariable
would be a compliant name for a local variable;
+ myMethod
would be a compliant name for a method;
+
+ Namespaces, global variable, class, structure, template, and enumeration names begin with a capital letter identifying what is being named: +
+MyNamespace
is fully compliant.
+ GMyGlobalVariable
.
+ CMyClass
.
+ A fully qualified method of CMyClass
could be MyNamespace::CMyClass::myMethod
+ IMyInterface
.
+ TMyTemplate
.
+ SMyStructure
.
+ EMyEnumeration
.
+