| 1 | == How ESPACK code should look like == |
| 2 | |
| 3 | Below you find a brief but hopefully complete list on how the code of espack should look like: |
| 4 | |
| 5 | * identate by two spaces |
| 6 | * Code Style from Eclipse, see [attachment:ESPACK_codesyle.xml]: |
| 7 | {{{ |
| 8 | /* |
| 9 | * A sample source file for the code formatter preview |
| 10 | */ |
| 11 | #include <math.h> |
| 12 | |
| 13 | class Point |
| 14 | { |
| 15 | public: |
| 16 | Point(double xc, double yc) : |
| 17 | x(xc), y(yc) |
| 18 | { |
| 19 | } |
| 20 | double distance(const Point& other) const; |
| 21 | |
| 22 | double x; |
| 23 | double y; |
| 24 | }; |
| 25 | |
| 26 | double Point::distance(const Point& other) const |
| 27 | { |
| 28 | double dx = x - other.x; |
| 29 | double dy = y - other.y; |
| 30 | return sqrt(dx * dx + dy * dy); |
| 31 | } |
| 32 | }}} |