• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1### Minikin Style Guide
2
3The C++ style in Minikin follows Android Framework C++ Code Style Guide except for following rules:
4
5 * Order of include
6
7 In dir/foo.cc or dir/foo_test.cc, whose main purpose is to implement or test the stuff in
8 dir2/foo2.h, order your includes as follows:
9
10   1. dir2/foo.h
11   2. A blank line
12   3. C system files
13   4. C++ system files
14   5. A blank line
15   6. Other libraries' files
16   7. A blank line
17   8. Minikin public files
18   9. A blank line
19   10. Minikin private files
20
21 For example,
22 ```
23 #include "minikin/Layout.h"  // The corresponding header file.
24
25 #include <math.h>  // C system header files.
26 #include <string>  // C++ system header files.
27
28 #include <hb.h>  // Other library, HarfBuzz, header file.
29 #include <log/log.h>  // Other library, Android, header file.
30 #include <unicode/ubidi.h>  // Other library, ICU, header file.
31
32 #include "minikin/Emoji.h"  // The minikin public header file.
33 #include "HbFontCache.h"  // The minikin private header file.
34 ```
35
36 * "<>" vs ""
37
38   * `#include <...>` should be used for non local library files.
39   * `#include "..."` should be used for minikin header files.
40