Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
Paul Bowen-Huggett edited this page Jan 29, 2019 · 11 revisions

Strings

All strings stored in a pstore database and pass to and from pstore APIs should be UTF-8 encoded. This means that strings following any other encoding scheme must be converted before use. At the time of writing, this mostly affect the Windows port where the Windows API uses either MBCS or UTF-16.

Coding Conventions

Layout follows the form described by the .clang-format file in the root of the git repository. The "one true brace style" is used with mandatory braces; indentation uses 4 spaces.

All pstore names use snake-case (all lower-case with underscores to separate words), except for:

  • Template parameters are camel-case (the initial letter of each word is capitalized; no separators)
  • Macros are all upper-case with underscore to separate words.

Miscellaneous:

  • Member variables use a single underscore suffix.
  • Use const generously. Tell the compiler when a quantity shouldn't change.
  • Avoid passing values by non-const reference. It's surprising when calling a function whose parameter looks as though it is passed by value when it actually a modifiable reference. In source code, surprises are rarely desirable.
  • Include file order: self-include is always first followed by: standard library includes, platform-specific includes, other store includes. Each group is sorted.
  • Include guards follow the "LLVM preferred" style: PSTORE__
Clone this wiki locally