... | @@ -10,7 +10,7 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
... | @@ -10,7 +10,7 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
|
|
|
|
|
```c
|
|
```c
|
|
/*
|
|
/*
|
|
* Copyright (C) 2014-2016 CZ.NIC
|
|
* Copyright (C) 2014-2019 CZ.NIC
|
|
*
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* it under the terms of the GNU General Public License as published by
|
... | @@ -23,7 +23,7 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
... | @@ -23,7 +23,7 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
|
* GNU General Public License for more details.
|
|
* GNU General Public License for more details.
|
|
*
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*
|
|
* In addition, as a special exception, the copyright holders give
|
|
* In addition, as a special exception, the copyright holders give
|
|
* permission to link the code of portions of this program with the
|
|
* permission to link the code of portions of this program with the
|
... | @@ -41,8 +41,8 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
... | @@ -41,8 +41,8 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
|
* Typedefs are generally not OK.
|
|
* Typedefs are generally not OK.
|
|
* They can create confusion especially when mixed with some keywords such as `const`.
|
|
* They can create confusion especially when mixed with some keywords such as `const`.
|
|
* The only legitimate usage of a `typedef` are:
|
|
* The only legitimate usage of a `typedef` are:
|
|
* When working with a nested type a function or a method where the visibility of the typedef is local.
|
|
* When working with a nested type a function or a method where the visibility of the `typedef` is local.
|
|
* Should a template if a template situation occur (e.g. to avoid errors when working with `foreach`).
|
|
* Should a template expansion inside a template situation occur (e.g. to avoid errors when working with `foreach`).
|
|
|
|
|
|
* preprocessor statements
|
|
* preprocessor statements
|
|
* We used `#ifndef _HEADER_FILE_H_` as header guards (for file header_file.h). Leading and trailing underscore were mandatory.
|
|
* We used `#ifndef _HEADER_FILE_H_` as header guards (for file header_file.h). Leading and trailing underscore were mandatory.
|
... | @@ -68,8 +68,8 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
... | @@ -68,8 +68,8 @@ Many of the rules of the [FreeBS kernel style](https://www.freebsd.org/cgi/man.c |
|
* capitalisation
|
|
* capitalisation
|
|
* Class names begin with capital letter (e.g. class MyClass, **not** my_class, myClass, MYCLASS, etc.).
|
|
* Class names begin with capital letter (e.g. class MyClass, **not** my_class, myClass, MYCLASS, etc.).
|
|
* Enumeration types begin with capital letter.
|
|
* Enumeration types begin with capital letter.
|
|
* Enumeration values consist of capitals only.
|
|
* Enumeration values consist of capitals and underscores only.
|
|
* Defined constants are capitals only.
|
|
* Defined constants are capitals and underscores only.
|
|
* When declaring a function working with structures (not classes) and enumeration **always** use `struct` and `enum`.
|
|
* When declaring a function working with structures (not classes) and enumeration **always** use `struct` and `enum`.
|
|
|
|
|
|
* function and variable declaration and definition
|
|
* function and variable declaration and definition
|
... | @@ -168,4 +168,4 @@ int someFunction(const QString &par1, QByteArray &par2); |
... | @@ -168,4 +168,4 @@ int someFunction(const QString &par1, QByteArray &par2); |
|
|
|
|
|
* `SOURCES`, `HEADERS`, `FORMS` and other groups are **sorted alphabetically** according to the strings describing the relative path to the respective files.
|
|
* `SOURCES`, `HEADERS`, `FORMS` and other groups are **sorted alphabetically** according to the strings describing the relative path to the respective files.
|
|
|
|
|
|
If you are not sure about how to write some code consult some existing modules (e.g. `tag_item`, `table_model`). |
|
If you are not sure about how to write some code see inside some existing modules (e.g. `tag_item`, `table_model`). |
|
\ No newline at end of file |
|
\ No newline at end of file |