xref: /aosp_15_r20/external/cronet/base/base_paths.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1*6777b538SAndroid Build Coastguard Worker // Copyright 2012 The Chromium Authors
2*6777b538SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*6777b538SAndroid Build Coastguard Worker // found in the LICENSE file.
4*6777b538SAndroid Build Coastguard Worker 
5*6777b538SAndroid Build Coastguard Worker #ifndef BASE_BASE_PATHS_H_
6*6777b538SAndroid Build Coastguard Worker #define BASE_BASE_PATHS_H_
7*6777b538SAndroid Build Coastguard Worker 
8*6777b538SAndroid Build Coastguard Worker // This file declares path keys for the base module.  These can be used with
9*6777b538SAndroid Build Coastguard Worker // the PathService to access various special directories and files.
10*6777b538SAndroid Build Coastguard Worker 
11*6777b538SAndroid Build Coastguard Worker #include "build/build_config.h"
12*6777b538SAndroid Build Coastguard Worker 
13*6777b538SAndroid Build Coastguard Worker #if BUILDFLAG(IS_WIN)
14*6777b538SAndroid Build Coastguard Worker #include "base/base_paths_win.h"
15*6777b538SAndroid Build Coastguard Worker #elif BUILDFLAG(IS_MAC)
16*6777b538SAndroid Build Coastguard Worker #include "base/base_paths_mac.h"
17*6777b538SAndroid Build Coastguard Worker #elif BUILDFLAG(IS_IOS)
18*6777b538SAndroid Build Coastguard Worker #include "base/base_paths_ios.h"
19*6777b538SAndroid Build Coastguard Worker #elif BUILDFLAG(IS_ANDROID)
20*6777b538SAndroid Build Coastguard Worker #include "base/base_paths_android.h"
21*6777b538SAndroid Build Coastguard Worker #endif
22*6777b538SAndroid Build Coastguard Worker 
23*6777b538SAndroid Build Coastguard Worker #if BUILDFLAG(IS_POSIX)
24*6777b538SAndroid Build Coastguard Worker #include "base/base_paths_posix.h"
25*6777b538SAndroid Build Coastguard Worker #endif
26*6777b538SAndroid Build Coastguard Worker 
27*6777b538SAndroid Build Coastguard Worker namespace base {
28*6777b538SAndroid Build Coastguard Worker 
29*6777b538SAndroid Build Coastguard Worker enum BasePathKey {
30*6777b538SAndroid Build Coastguard Worker   PATH_START = 0,
31*6777b538SAndroid Build Coastguard Worker 
32*6777b538SAndroid Build Coastguard Worker   // The following refer to the current application.
33*6777b538SAndroid Build Coastguard Worker   FILE_EXE,  // Path and filename of the current executable.
34*6777b538SAndroid Build Coastguard Worker #if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_IOS)
35*6777b538SAndroid Build Coastguard Worker   // Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
36*6777b538SAndroid Build Coastguard Worker   // module location may not work as expected on some platforms. For this
37*6777b538SAndroid Build Coastguard Worker   // reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
38*6777b538SAndroid Build Coastguard Worker   // details.
39*6777b538SAndroid Build Coastguard Worker   FILE_MODULE,  // Path and filename of the module containing the code for
40*6777b538SAndroid Build Coastguard Worker                 // the PathService (which could differ from FILE_EXE if the
41*6777b538SAndroid Build Coastguard Worker                 // PathService were compiled into a shared object, for
42*6777b538SAndroid Build Coastguard Worker                 // example).
43*6777b538SAndroid Build Coastguard Worker #endif
44*6777b538SAndroid Build Coastguard Worker   DIR_EXE,  // Directory containing FILE_EXE.
45*6777b538SAndroid Build Coastguard Worker #if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_IOS)
46*6777b538SAndroid Build Coastguard Worker   // Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
47*6777b538SAndroid Build Coastguard Worker   // module location may not work as expected on some platforms. For this
48*6777b538SAndroid Build Coastguard Worker   // reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
49*6777b538SAndroid Build Coastguard Worker   // details.
50*6777b538SAndroid Build Coastguard Worker   DIR_MODULE,  // Directory containing FILE_MODULE.
51*6777b538SAndroid Build Coastguard Worker #endif
52*6777b538SAndroid Build Coastguard Worker   DIR_ASSETS,  // Directory that contains application assets.
53*6777b538SAndroid Build Coastguard Worker 
54*6777b538SAndroid Build Coastguard Worker   // The following refer to system and system user directories.
55*6777b538SAndroid Build Coastguard Worker   DIR_TEMP,  // Temporary directory for the system and/or user.
56*6777b538SAndroid Build Coastguard Worker   DIR_HOME,  // User's root home directory. On Windows this will look
57*6777b538SAndroid Build Coastguard Worker              // like "C:\Users\<user>"  which isn't necessarily a great
58*6777b538SAndroid Build Coastguard Worker              // place to put files.
59*6777b538SAndroid Build Coastguard Worker #if !BUILDFLAG(IS_IOS)
60*6777b538SAndroid Build Coastguard Worker   DIR_USER_DESKTOP,  // The current user's Desktop.
61*6777b538SAndroid Build Coastguard Worker #endif
62*6777b538SAndroid Build Coastguard Worker 
63*6777b538SAndroid Build Coastguard Worker   // The following refer to the applications current environment.
64*6777b538SAndroid Build Coastguard Worker   DIR_CURRENT,  // Current directory.
65*6777b538SAndroid Build Coastguard Worker 
66*6777b538SAndroid Build Coastguard Worker   // The following are only for use in tests.
67*6777b538SAndroid Build Coastguard Worker   // On some platforms, such as Android and Fuchsia, tests do not have access to
68*6777b538SAndroid Build Coastguard Worker   // the build file system so the necessary files are bundled with the test
69*6777b538SAndroid Build Coastguard Worker   // binary. On such platforms, these will return an appropriate path inside the
70*6777b538SAndroid Build Coastguard Worker   // bundle.
71*6777b538SAndroid Build Coastguard Worker   DIR_SRC_TEST_DATA_ROOT,  // The root of files in the source tree that are
72*6777b538SAndroid Build Coastguard Worker                            // made available to tests. Useful for tests that use
73*6777b538SAndroid Build Coastguard Worker                            // resources that exist in the source tree.
74*6777b538SAndroid Build Coastguard Worker                            // On posix and windows platform, this can be
75*6777b538SAndroid Build Coastguard Worker                            // overridden using the CR_SOURCE_ROOT environment
76*6777b538SAndroid Build Coastguard Worker                            // variable. If it contains a relative path, it will
77*6777b538SAndroid Build Coastguard Worker                            // be appended to the DIR_EXE directory path.
78*6777b538SAndroid Build Coastguard Worker   DIR_OUT_TEST_DATA_ROOT,  // Path of build outputs available to tests. Build
79*6777b538SAndroid Build Coastguard Worker                            // output files are normally placed directly in the
80*6777b538SAndroid Build Coastguard Worker                            // build output directory on platforms that do not
81*6777b538SAndroid Build Coastguard Worker                            // "package" tests. On platforms that "package"
82*6777b538SAndroid Build Coastguard Worker                            // tests this will instead return a package-local
83*6777b538SAndroid Build Coastguard Worker                            // path to copies of the relevant files.
84*6777b538SAndroid Build Coastguard Worker   DIR_GEN_TEST_DATA_ROOT,  // Path of generated intermediate files available to
85*6777b538SAndroid Build Coastguard Worker                            // tests. Build-intermediate files are normally
86*6777b538SAndroid Build Coastguard Worker                            // placed in the "gen" sub-directory of the build
87*6777b538SAndroid Build Coastguard Worker                            // output directory. On platforms that "package"
88*6777b538SAndroid Build Coastguard Worker                            // tests this will instead return a package-local
89*6777b538SAndroid Build Coastguard Worker                            // path to copies of the relevant files.
90*6777b538SAndroid Build Coastguard Worker   DIR_TEST_DATA,           // Directory containing test data for //base tests.
91*6777b538SAndroid Build Coastguard Worker                            // Only for use in base_unittests. Equivalent to
92*6777b538SAndroid Build Coastguard Worker                            // DIR_SRC_TEST_DATA_ROOT + "/base/test/data".
93*6777b538SAndroid Build Coastguard Worker 
94*6777b538SAndroid Build Coastguard Worker   PATH_END
95*6777b538SAndroid Build Coastguard Worker };
96*6777b538SAndroid Build Coastguard Worker 
97*6777b538SAndroid Build Coastguard Worker }  // namespace base
98*6777b538SAndroid Build Coastguard Worker 
99*6777b538SAndroid Build Coastguard Worker #endif  // BASE_BASE_PATHS_H_
100