Generally, Rialto project shall follow the google style guidelines https://google.github.io/styleguide/cppguide.html.

Exceptions To Google

CategoryGoogle RuleRialto RuleReason
Include guardsInclude guard format: <PROJECT>_<PATH>_<FILE>_H_.TBD
FilenamesFilenames should be all lowercase and can include underscores (_) or dashes (-).

Filenames should capitalise all words with no underscores (PascalCase / UpperCamelCase).

E.g. RialtoClientLogging.h

Common Sky AI format.
Variable namesThe names of variables (including function parameters) and data members are all lowercase, with underscores between words.

Variable names should contain no underscores and begin with a lowercase word, any subsequent words should be capitalised (mixedCase / lowerCamelCase).

E.g. mediaPlayer

Common Sky AI format.
Data member namesData members of classes, both static and non-static, are named like ordinary nonmember variables, but with a trailing underscore.

Treat them the same as variables but with a prefixed 'm_'.

E.g. m_mediaPlayer

Common Sky AI format.
Function namesRegular functions have PascalCase; accessors and mutators may be named like variables.

Function names should contain no underscores and begin with a lowercase word, any subsequent words should be capitalised (mixedCase / lowerCamelCase).

E.g. removeSource()

Common Sky AI format.
Namespace namesNames are all lower-case, with words separated by underscores.

Namespace names should be all lowercase with no underscores.

E.g. servermanager

Common Sky AI format.
C++ ExceptionsDo not use C++ exceptions.

Exceptions are allowed in constructors as long as the class has an associated factory to catch the exceptions.

Google not using exceptions is an internal decision based on older repositories.
TODO CommentsTODOs should include the string TODO in all caps, followed by the name, e-mail address, bug ID.

TODOs should include TODO in all caps followed by the relevant Jira Id.

E.g. TODO (LLDEV-23451)

Same as google but with our own identifier.
Line lengthEach line of text in your code should be at most 80 characters long.

A line of text should not be more than 120 characters long.

80 too small.
Open curly bracesThe open curly brace is always on the end of the last line of the function declaration, not the start of the next line.

Open curly braces should always be on a new line.

Common Sky AI format.
Access specifier indentAccess specifiers should be indented by 1 space.

Access specifiers should not be indented.

Common Sky AI format.
#include formatInclude the directory when naming header files.

Only the filename is included in the #include unless required for 3rd party.

The way our CMake files compile the code mean that we should just use the filenames.
non-const referencenon-const references should not exist for output variables, instead use pointers.

non-const references are allowed.

Only enforced for readability, common Sky AI format.
static/global stringsFor a static/global string constant, use a C style string instead.

Allow string constant.

Only enforced for memory saving, common Sky AI format.
  • No labels