1
0

obj_isocreator.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include <bfc/dispatch.h>
  3. #include <bfc/platform/types.h>
  4. class ifc_burner_writecallback;
  5. class obj_isocreator : public Dispatchable
  6. {
  7. protected:
  8. obj_isocreator(){}
  9. ~obj_isocreator(){}
  10. public:
  11. int Open(const wchar_t *volumeName, int format, int media);
  12. int AddFile(const wchar_t *source, const wchar_t *destination);
  13. int AddFolder(const wchar_t *folder); // AddFile auto-creates the folders. Use AddFolder if you need to create an empty directory
  14. int Write(const wchar_t *destination, ifc_burner_writecallback *callback);
  15. void ForceCallback(); // call this (from another thread) to force the Write() function to call your callback ASAP
  16. enum
  17. {
  18. FORMAT_ISOLEVEL1 = 0x00000100,
  19. FORMAT_JOLIET = 0x00000200,
  20. FORMAT_UDF = 0x00000400,
  21. FORMAT_ISOLEVEL2 = 0x00200000,
  22. FORMAT_ISOLEVEL3 = 0x00400000,
  23. FORMAT_UDF201 = 0x00100000,
  24. MEDIA_CD = 0x0,
  25. MEDIA_DVD = 0x08000000,
  26. };
  27. enum
  28. {
  29. ISOCREATOR_OPEN = 0,
  30. ISOCREATOR_ADDFILE = 1,
  31. ISOCREATOR_ADDFOLDER = 2,
  32. ISOCREATOR_WRITE = 3,
  33. ISOCREATOR_FORCECALLBACK = 4,
  34. };
  35. };
  36. inline int obj_isocreator::Open(const wchar_t *volumeName, int format, int media)
  37. {
  38. return _call(ISOCREATOR_OPEN, (int)1, volumeName, format, media);
  39. }
  40. inline int obj_isocreator::AddFile(const wchar_t *source, const wchar_t *destination)
  41. {
  42. return _call(ISOCREATOR_ADDFILE, (int)1, source, destination);
  43. }
  44. inline int obj_isocreator::AddFolder(const wchar_t *folder)
  45. {
  46. return _call(ISOCREATOR_ADDFOLDER, (int)1, folder);
  47. }
  48. inline int obj_isocreator::Write(const wchar_t *destination, ifc_burner_writecallback *callback)
  49. {
  50. return _call(ISOCREATOR_WRITE, (int)1, destination, callback);
  51. }
  52. inline void obj_isocreator::ForceCallback()
  53. {
  54. _voidcall(ISOCREATOR_FORCECALLBACK);
  55. }
  56. // {4F0ED42C-A6C1-4c60-97D1-16D9BD02E461}
  57. static const GUID obj_isocreatorGUID =
  58. { 0x4f0ed42c, 0xa6c1, 0x4c60, { 0x97, 0xd1, 0x16, 0xd9, 0xbd, 0x2, 0xe4, 0x61 } };