cmake/Source/CPack/cmCPackArchiveGenerator.h

77 lines
2.2 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2010-06-23 01:18:35 +03:00
#ifndef cmCPackArchiveGenerator_h
#define cmCPackArchiveGenerator_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2010-06-23 01:18:35 +03:00
2016-07-09 11:21:54 +02:00
#include "cmArchiveWrite.h"
2016-10-30 18:24:19 +01:00
#include "cmCPackGenerator.h"
#include <iosfwd>
#include <string>
class cmCPackComponent;
2010-06-23 01:18:35 +03:00
/** \class cmCPackArchiveGenerator
2010-11-13 01:00:53 +02:00
* \brief A generator base for libarchive generation.
* The generator itself uses the libarchive wrapper
* \ref cmArchiveWrite.
2010-06-23 01:18:35 +03:00
*
*/
class cmCPackArchiveGenerator : public cmCPackGenerator
2016-07-09 11:21:54 +02:00
{
2010-06-23 01:18:35 +03:00
public:
2017-04-14 19:02:05 +02:00
typedef cmCPackGenerator Superclass;
2010-06-23 01:18:35 +03:00
/**
* Construct generator
*/
2015-08-17 11:37:30 +02:00
cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format);
2018-01-26 17:06:56 +01:00
~cmCPackArchiveGenerator() override;
2013-03-16 19:13:01 +02:00
// Used to add a header to the archive
2010-06-23 01:18:35 +03:00
virtual int GenerateHeader(std::ostream* os);
2010-11-13 01:00:53 +02:00
// component support
2018-01-26 17:06:56 +01:00
bool SupportsComponentInstallation() const override;
2016-07-09 11:21:54 +02:00
2017-07-20 19:35:53 +02:00
private:
// get archive component filename
std::string GetArchiveComponentFileName(const std::string& component,
bool isGroupName);
2010-06-23 01:18:35 +03:00
protected:
2018-01-26 17:06:56 +01:00
int InitializeInternal() override;
2010-11-13 01:00:53 +02:00
/**
* Add the files belonging to the specified component
* to the provided (already opened) archive.
* @param[in,out] archive the archive object
* @param[in] component the component whose file will be added to archive
*/
int addOneComponentToArchive(cmArchiveWrite& archive,
cmCPackComponent* component);
/**
* The main package file method.
* If component install was required this
* method will call either PackageComponents or
* PackageComponentsAllInOne.
*/
2018-01-26 17:06:56 +01:00
int PackageFiles() override;
2010-11-13 01:00:53 +02:00
/**
* The method used to package files when component
* install is used. This will create one
* archive for each component group.
*/
2011-01-16 11:35:12 +01:00
int PackageComponents(bool ignoreGroup);
2010-11-13 01:00:53 +02:00
/**
* Special case of component install where all
* components will be put in a single installer.
*/
2011-06-19 15:41:06 +03:00
int PackageComponentsAllInOne();
2018-01-26 17:06:56 +01:00
const char* GetOutputExtension() override = 0;
2010-11-13 01:00:53 +02:00
cmArchiveWrite::Compress Compress;
2015-08-17 11:37:30 +02:00
std::string ArchiveFormat;
2016-07-09 11:21:54 +02:00
};
2010-06-23 01:18:35 +03:00
#endif