aboutsummaryrefslogtreecommitdiff
path: root/doc/Coding_style
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Coding_style')
-rw-r--r--doc/Coding_style27
1 files changed, 20 insertions, 7 deletions
diff --git a/doc/Coding_style b/doc/Coding_style
index d0eba0d..d57dcf1 100644
--- a/doc/Coding_style
+++ b/doc/Coding_style
@@ -1,10 +1,8 @@
1The coding style is almost the same as i blackbox. 1The coding style is almost the same as i blackbox.
2Instead of 2 spaces there is tab. 2Instead of 2 spaces there is tab.
3It might look strange now in some places, that is because 3Use a tab size of 2 or 4 and you will be fine.
4the code hasnt been "translated" to tab 100% yet.
5Use a tab size of 2 and you will be fine.
6 4
7note if-statement: 5if-statements:
8 6
9 if ( stuff ) 7 if ( stuff )
10 function(stuff, more stuff, 8 function(stuff, more stuff,
@@ -15,7 +13,7 @@ note if-statement:
15 stuff, 13 stuff,
16 stuff); 14 stuff);
17 15
18if the functionline needs to be split up, like above, right after a if-statement 16if the functionline needs to be split up, like above, right after an if-statement
19use { and }, so its clear when the if-statement ends. 17use { and }, so its clear when the if-statement ends.
20It should look like this 18It should look like this
21 19
@@ -29,8 +27,15 @@ It should look like this
29 stuff); 27 stuff);
30 } 28 }
31 29
32The includeguards: 30If a line need to be splited in an if-statement then it should use two
33_FILENAME_HH_ 31tab for indent next row in if-statement like this:
32
33 if ( longline && longline && longling &&
34 longline && longline && longline)
35 funktion();
36
37The include guards:
38FILENAME_HH
34 39
35 40
36Function comments: 41Function comments:
@@ -43,3 +48,11 @@ Function comments:
43type classname::function(...) { 48type classname::function(...) {
44 49
45} 50}
51
52
53enums must be in uppercase letters and not in file scope:
54enum {WHITE, RED, BLUE};
55
56Class data members are prefixed by m_
57Class member function will be organized accordning to creator,
58manipulator and accessor categories.