path_utils.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_ANDROID_PATH_UTILS_H_
  5. #define BASE_ANDROID_PATH_UTILS_H_
  6. #include <jni.h>
  7. #include <vector>
  8. #include "base/base_export.h"
  9. namespace base {
  10. class FilePath;
  11. namespace android {
  12. // Retrieves the absolute path to the data directory of the current
  13. // application. The result is placed in the FilePath pointed to by 'result'.
  14. // This method is dedicated for base_paths_android.c, Using
  15. // PathService::Get(base::DIR_ANDROID_APP_DATA, ...) gets the data dir.
  16. BASE_EXPORT bool GetDataDirectory(FilePath* result);
  17. // Retrieves the absolute path to the cache directory. The result is placed in
  18. // the FilePath pointed to by 'result'. This method is dedicated for
  19. // base_paths_android.c, Using PathService::Get(base::DIR_CACHE, ...) gets the
  20. // cache dir.
  21. BASE_EXPORT bool GetCacheDirectory(FilePath* result);
  22. // Retrieves the path to the thumbnail cache directory. The result is placed
  23. // in the FilePath pointed to by 'result'.
  24. BASE_EXPORT bool GetThumbnailCacheDirectory(FilePath* result);
  25. // Retrieves the path to the public downloads directory. The result is placed
  26. // in the FilePath pointed to by 'result'.
  27. BASE_EXPORT bool GetDownloadsDirectory(FilePath* result);
  28. // Retrieves the paths to all download directories, including default storage
  29. // directory, and a private directory on external SD card.
  30. BASE_EXPORT std::vector<FilePath> GetAllPrivateDownloadsDirectories();
  31. // Retrieves the path to the native JNI libraries via
  32. // ApplicationInfo.nativeLibraryDir on the Java side. The result is placed in
  33. // the FilePath pointed to by 'result'.
  34. BASE_EXPORT bool GetNativeLibraryDirectory(FilePath* result);
  35. // Retrieves the absolute path to the external storage directory. The result
  36. // is placed in the FilePath pointed to by 'result'.
  37. BASE_EXPORT bool GetExternalStorageDirectory(FilePath* result);
  38. } // namespace android
  39. } // namespace base
  40. #endif // BASE_ANDROID_PATH_UTILS_H_