1# Platform API
2
3The Platform API is designed to allow easy porting of the Open Screen Library
4between platforms. This folder contains classes and logic used by Open Screen to
5access system resources and other common OS-level facilities, such as the clock
6and task runner. Note: utilities are generally not homed here, instead
7preferring the top level util/ directory. New classes added here must NOT
8depend on any other folders in the openscreen repository, excepting third party
9libraries like Abseil or GTest. We include "default implementations" of many
10platform features.
11
12## Directory structure
13
14 - api/ contains the Platform API which is used by the Open Screen Library.
15   Some of the public API may also include adapter code that acts as a small
16   shim above the C functions to be implemented by the platform. The entire
17   Open Screen repository can depend on files from api/, though classes
18   defined in api/ can only depend on third_party or platform/base files.
19
20 - base/ contains declarations/definitions of API constructs. Classes homed here
21   shall only depend on platform/api or this folder.
22
23 - impl/ contains the implementation of the standalone use case, namely a
24   self-contained binary using the default implementation of the platform API.
25   Note: people familiar with the old layout may notice that all files from the
26   posix/, linux/, and mac/ directories have been moved here with an OS-specific
27   suffix (e.g. _mac, _posix).
28
29 - test/ contains API implementations used for testing purposes, like the
30   FakeClock or FakeTaskRunner.
31