cmCPackArchiveGenerator.h 2.3 KB

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