MtpStorage.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2010 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _MTP_STORAGE_H
  17. #define _MTP_STORAGE_H
  18. #include "MtpStringBuffer.h"
  19. #include "MtpTypes.h"
  20. #include "mtp.h"
  21. namespace android {
  22. class MtpDatabase;
  23. class MtpStorage {
  24. private:
  25. MtpStorageID mStorageID;
  26. MtpStringBuffer mFilePath;
  27. MtpStringBuffer mDescription;
  28. uint64_t mMaxCapacity;
  29. uint64_t mMaxFileSize;
  30. bool mRemovable;
  31. public:
  32. MtpStorage(MtpStorageID id, const char* filePath,
  33. const char* description,
  34. bool removable, uint64_t maxFileSize);
  35. virtual ~MtpStorage();
  36. inline MtpStorageID getStorageID() const { return mStorageID; }
  37. int getType() const;
  38. int getFileSystemType() const;
  39. int getAccessCapability() const;
  40. uint64_t getMaxCapacity();
  41. uint64_t getFreeSpace();
  42. const char* getDescription() const;
  43. inline const char* getPath() const { return (const char *)mFilePath; }
  44. inline bool isRemovable() const { return mRemovable; }
  45. inline uint64_t getMaxFileSize() const { return mMaxFileSize; }
  46. };
  47. }; // namespace android
  48. #endif // _MTP_STORAGE_H