svc_storagevolenum.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #ifndef __SVC_STORAGEVOLENUM_H
  2. #define __SVC_STORAGEVOLENUM_H
  3. #include <bfc/dispatch.h>
  4. #include <api/service/services.h>
  5. enum StorageVolumeTypes {
  6. NOT_VALID = 0, //Not a valid Volume.
  7. UNKNOWN = 1, //Unknown Drive Type.
  8. LOCAL = 1<<1, //Local (Fixed) Hard Drive.
  9. REMOVABLE = 1<<2, //Removable Drive (Floppy, LS-120, Zip, USB FlashCard Reader, etc.)
  10. NETWORK = 1<<3, //Network Drive (SMB, NFS, etc.)
  11. CDROM = 1<<4, //CD / DVD ROM, WRITER, Re-WRITER, etc.
  12. RAMDISK = 1<<5, //RAM Drive.
  13. };
  14. //-----------------------------------------------------------------
  15. class NOVTABLE StorageVolume : public Dispatchable {
  16. public:
  17. const char *getVolumeName() { return _call(GETVOLUMENAME, (const char *) NULL); }
  18. const char *getMountPath() { return _call(GETMOUNTPATH, (const char *) NULL); }
  19. const char *getLabel() { return _call(GETLABEL, (const char *) NULL); }
  20. int getType() { return _call(GETTYPE, 0); }
  21. int isRemovable() { return _call(ISREMOVABLE, -1); }
  22. int isWritable() { return _call(ISWRITABLE, -1); }
  23. __int64 getFreeSpace() { return _call(GETFREESPACE, -1); }
  24. __int64 getSize() { return _call(GETSIZE, -1); }
  25. enum {
  26. GETVOLUMENAME = 10,
  27. GETMOUNTPATH = 20,
  28. GETLABEL = 30,
  29. GETTYPE = 40,
  30. ISREMOVABLE = 50,
  31. ISWRITABLE = 60,
  32. GETFREESPACE = 70,
  33. GETSIZE = 80
  34. };
  35. };
  36. //-----------------------------------------------------------------
  37. class StorageVolumeI : public StorageVolume {
  38. public:
  39. virtual const char *getVolumeName()=0;
  40. virtual const char *getMountPath()=0;
  41. virtual const char *getLabel()=0;
  42. virtual int getType()=0;
  43. virtual int isRemovable()=0;
  44. virtual int isWritable()=0;
  45. virtual __int64 getFreeSpace()=0;
  46. virtual __int64 getSize()=0;
  47. protected:
  48. RECVS_DISPATCH;
  49. };
  50. //-----------------------------------------------------------------
  51. class NOVTABLE svc_storageVolumeEnum : public Dispatchable
  52. {
  53. public:
  54. static FOURCC getServiceType() { return WaSvc::STORAGEVOLENUM; }
  55. int getNumVolumes() { return _call(GETNUMVOLUMES, (int) 0); }
  56. StorageVolume *enumVolume(int which) { return _call(ENUMVOLUME, (StorageVolume *)NULL); }
  57. enum {
  58. GETNUMVOLUMES = 10,
  59. ENUMVOLUME = 20,
  60. };
  61. };
  62. //-----------------------------------------------------------------
  63. class svc_storageVolumeEnumI : public svc_storageVolumeEnum {
  64. public:
  65. virtual int getNumVolumes()=0; //Get the number of Storage Volumes.
  66. //Enum a Storage Volume.
  67. virtual StorageVolume *enumVolume(int which)=0;
  68. protected:
  69. RECVS_DISPATCH;
  70. };
  71. #endif //__SVC_STORAGEVOLENUM_H