path_utils.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 paths to all secondary storage download directories. e.g.
  32. // /storage/1AEF-1A1E/Download/.
  33. BASE_EXPORT std::vector<FilePath> GetSecondaryStorageDownloadDirectories();
  34. // Retrieves the path to the native JNI libraries via
  35. // ApplicationInfo.nativeLibraryDir on the Java side. The result is placed in
  36. // the FilePath pointed to by 'result'.
  37. BASE_EXPORT bool GetNativeLibraryDirectory(FilePath* result);
  38. // Retrieves the absolute path to the external storage directory. The result
  39. // is placed in the FilePath pointed to by 'result'.
  40. BASE_EXPORT bool GetExternalStorageDirectory(FilePath* result);
  41. } // namespace android
  42. } // namespace base
  43. #endif // BASE_ANDROID_PATH_UTILS_H_