doc/developer: more code style
This commit is contained in:
parent
accbd4e82a
commit
28bf100a50
@ -38,6 +38,12 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
comment your code, document your APIs
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
the code should be C++14 compliant, and must compile with
|
the code should be C++14 compliant, and must compile with
|
||||||
@ -46,15 +52,35 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
report error conditions with C++ exceptions, preferable
|
||||||
|
derived from <varname>std::runtime_error</varname>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
all code must be exception-safe
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
classes and functions names use CamelCase; variables are
|
||||||
|
lower-case with words separated by underscore
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Some example code:
|
Some example code:
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<programlisting lang="C">static inline int
|
<programlisting lang="C">static inline int
|
||||||
foo(const char *abc, int xyz)
|
Foo(const char *abc, int xyz)
|
||||||
{
|
{
|
||||||
if (abc == NULL) {
|
if (abc == nullptr) {
|
||||||
LogWarning("Foo happened!");
|
LogWarning("Foo happened!");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user