2016-11-02 00:37:58 +01:00
|
|
|
============
|
|
|
|
Coding style
|
|
|
|
============
|
|
|
|
|
|
|
|
Formatting
|
|
|
|
----------
|
|
|
|
* A new line should begin after 72 (max. 80) characters
|
|
|
|
* Use 2 spaces indent. Do not use tabs!
|
|
|
|
* Leave a space after the keywords if, switch, while, do, for, and return
|
2017-11-02 16:05:34 +01:00
|
|
|
* Use one blank line before and after a for, if, switch,
|
2016-11-02 00:37:58 +01:00
|
|
|
while, do..while code block
|
|
|
|
* In parameter lists, leave a space after each comma
|
|
|
|
|
|
|
|
Class declaration order
|
|
|
|
-----------------------
|
|
|
|
The declaration section order is:
|
|
|
|
|
|
|
|
* public:
|
|
|
|
* protected:
|
|
|
|
* private:
|
|
|
|
|
|
|
|
Each declaration section should be in the following order:
|
|
|
|
|
|
|
|
* Using-declarations (using std::string;)
|
|
|
|
* Typedefs and Enumerations
|
|
|
|
* Constants (static const data members)
|
|
|
|
* Constructors
|
|
|
|
* Destructor
|
|
|
|
* Overloaded operators (=, +, -, +=. ...)
|
|
|
|
* Accessors (getXY)
|
|
|
|
* Mutators (setXY)
|
|
|
|
* Inquiries (isXY)
|
|
|
|
* Methods, including static methods
|
|
|
|
* Event handler methods
|
|
|
|
* Callback methods
|
|
|
|
* Data Members (except static const data members)
|
|
|
|
|
|
|
|
|