blob: c327c2e1af977c39ece5ec629d2d5105e50734d3 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2012 The Chromium Authors
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commitd7cae122008-07-26 21:49:384
[email protected]5af2edb92008-08-08 20:16:085#ifndef BASE_BASE_PATHS_H_
6#define BASE_BASE_PATHS_H_
initial.commitd7cae122008-07-26 21:49:387
8// This file declares path keys for the base module. These can be used with
9// the PathService to access various special directories and files.
10
[email protected]2edc2862011-04-04 18:04:3711#include "build/build_config.h"
12
Xiaohan Wang38e4ebb2022-01-19 06:57:4313#if BUILDFLAG(IS_WIN)
[email protected]ac510e12008-08-05 19:46:3114#include "base/base_paths_win.h"
Sylvain Defresnea9ffa992023-06-19 09:29:0615#elif BUILDFLAG(IS_MAC)
[email protected]5af2edb92008-08-08 20:16:0816#include "base/base_paths_mac.h"
Sylvain Defresnea9ffa992023-06-19 09:29:0617#elif BUILDFLAG(IS_IOS)
18#include "base/base_paths_ios.h"
Xiaohan Wang38e4ebb2022-01-19 06:57:4319#elif BUILDFLAG(IS_ANDROID)
[email protected]b3111782012-03-22 21:44:3120#include "base/base_paths_android.h"
[email protected]ac510e12008-08-05 19:46:3121#endif
22
Xiaohan Wang38e4ebb2022-01-19 06:57:4323#if BUILDFLAG(IS_POSIX)
[email protected]dea1d7d2012-09-20 16:24:5224#include "base/base_paths_posix.h"
25#endif
26
initial.commitd7cae122008-07-26 21:49:3827namespace base {
28
[email protected]d6431722011-09-01 00:46:3329enum BasePathKey {
initial.commitd7cae122008-07-26 21:49:3830 PATH_START = 0,
31
David Dorwin15b9e1662021-11-04 19:45:0532 // The following refer to the current application.
Mason Bendixend798600c2021-11-23 19:50:4233 FILE_EXE, // Path and filename of the current executable.
Sylvain Defresnee7b66552023-06-20 08:23:3034#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_IOS)
Mason Bendixend798600c2021-11-23 19:50:4235 // Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
36 // module location may not work as expected on some platforms. For this
37 // reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
38 // details.
David Dorwin15b9e1662021-11-04 19:45:0539 FILE_MODULE, // Path and filename of the module containing the code for
40 // the PathService (which could differ from FILE_EXE if the
41 // PathService were compiled into a shared object, for
42 // example).
Mason Bendixend798600c2021-11-23 19:50:4243#endif
44 DIR_EXE, // Directory containing FILE_EXE.
Sylvain Defresnee7b66552023-06-20 08:23:3045#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_IOS)
Mason Bendixend798600c2021-11-23 19:50:4246 // Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
47 // module location may not work as expected on some platforms. For this
48 // reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
49 // details.
50 DIR_MODULE, // Directory containing FILE_MODULE.
51#endif
52 DIR_ASSETS, // Directory that contains application assets.
David Dorwin15b9e1662021-11-04 19:45:0553
54 // The following refer to system and system user directories.
Etienne Pierre-dorayf4dcbd6a2023-07-06 16:12:0355 DIR_TEMP, // Temporary directory for the system and/or user.
56 DIR_HOME, // User's root home directory. On Windows this will look
57 // like "C:\Users\<user>" which isn't necessarily a great
58 // place to put files.
Sylvain Defresnee7b66552023-06-20 08:23:3059#if !BUILDFLAG(IS_IOS)
David Dorwinc694f722021-10-29 22:46:5960 DIR_USER_DESKTOP, // The current user's Desktop.
Sylvain Defresnee7b66552023-06-20 08:23:3061#endif
David Dorwin15b9e1662021-11-04 19:45:0562
63 // The following refer to the applications current environment.
64 DIR_CURRENT, // Current directory.
[email protected]5d1937bb2009-11-21 01:29:0065
David Dorwinc694f722021-10-29 22:46:5966 // The following are only for use in tests.
67 // On some platforms, such as Android and Fuchsia, tests do not have access to
68 // the build file system so the necessary files are bundled with the test
69 // binary. On such platforms, these will return an appropriate path inside the
70 // bundle.
71 DIR_SRC_TEST_DATA_ROOT, // The root of files in the source tree that are
72 // made available to tests. Useful for tests that use
73 // resources that exist in the source tree.
Paul Semelf90c9dc52023-11-03 12:19:5674 // On posix and windows platform, this can be
75 // overridden using the CR_SOURCE_ROOT environment
76 // variable. If it contains a relative path, it will
77 // be appended to the DIR_EXE directory path.
Etienne Pierre-dorayf4dcbd6a2023-07-06 16:12:0378 DIR_OUT_TEST_DATA_ROOT, // Path of build outputs available to tests. Build
79 // output files are normally placed directly in the
80 // build output directory on platforms that do not
81 // "package" tests. On platforms that "package"
82 // tests this will instead return a package-local
83 // path to copies of the relevant files.
84 DIR_GEN_TEST_DATA_ROOT, // Path of generated intermediate files available to
85 // tests. Build-intermediate files are normally
86 // placed in the "gen" sub-directory of the build
87 // output directory. On platforms that "package"
88 // tests this will instead return a package-local
89 // path to copies of the relevant files.
David Dorwinc694f722021-10-29 22:46:5990 DIR_TEST_DATA, // Directory containing test data for //base tests.
David Dorwin15b9e1662021-11-04 19:45:0591 // Only for use in base_unittests. Equivalent to
92 // DIR_SRC_TEST_DATA_ROOT + "/base/test/data".
[email protected]c4803e432013-03-28 00:40:0493
initial.commitd7cae122008-07-26 21:49:3894 PATH_END
95};
96
97} // namespace base
98
[email protected]5af2edb92008-08-08 20:16:0899#endif // BASE_BASE_PATHS_H_