cmCPackArchiveGenerator.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCPackArchiveGenerator_h
  4. #define cmCPackArchiveGenerator_h
  5. #include <cmConfigure.h>
  6. #include "cmArchiveWrite.h"
  7. #include "cmCPackGenerator.h"
  8. #include "cmTypeMacro.h"
  9. #include <iosfwd>
  10. #include <string>
  11. class cmCPackComponent;
  12. /** \class cmCPackArchiveGenerator
  13. * \brief A generator base for libarchive generation.
  14. * The generator itself uses the libarchive wrapper
  15. * \ref cmArchiveWrite.
  16. *
  17. */
  18. class cmCPackArchiveGenerator : public cmCPackGenerator
  19. {
  20. public:
  21. typedef cmCPackGenerator Superclass;
  22. /**
  23. * Construct generator
  24. */
  25. cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format);
  26. ~cmCPackArchiveGenerator() CM_OVERRIDE;
  27. // Used to add a header to the archive
  28. virtual int GenerateHeader(std::ostream* os);
  29. // component support
  30. bool SupportsComponentInstallation() const CM_OVERRIDE;
  31. protected:
  32. int InitializeInternal() CM_OVERRIDE;
  33. /**
  34. * Add the files belonging to the specified component
  35. * to the provided (already opened) archive.
  36. * @param[in,out] archive the archive object
  37. * @param[in] component the component whose file will be added to archive
  38. */
  39. int addOneComponentToArchive(cmArchiveWrite& archive,
  40. cmCPackComponent* component);
  41. /**
  42. * The main package file method.
  43. * If component install was required this
  44. * method will call either PackageComponents or
  45. * PackageComponentsAllInOne.
  46. */
  47. int PackageFiles() CM_OVERRIDE;
  48. /**
  49. * The method used to package files when component
  50. * install is used. This will create one
  51. * archive for each component group.
  52. */
  53. int PackageComponents(bool ignoreGroup);
  54. /**
  55. * Special case of component install where all
  56. * components will be put in a single installer.
  57. */
  58. int PackageComponentsAllInOne();
  59. const char* GetOutputExtension() CM_OVERRIDE = 0;
  60. cmArchiveWrite::Compress Compress;
  61. std::string ArchiveFormat;
  62. };
  63. #endif