Program Listing for File packager.h#

Return to documentation for file (sdv_packager\packager.h)

/********************************************************************************
 * Copyright (c) 2025-2026 ZF Friedrichshafen AG
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License Version 2.0 which is available at
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Contributors:
 *   Erik Verhoeven - initial API and implementation
 ********************************************************************************/

#ifndef PACKAGER_H
#define PACKAGER_H

#include "core_control.h"
#include "environment.h"
#include "../../sdv_services/core/installation_manifest.h"

class CPackager
{
public:
    CPackager(CSdvPackagerEnvironment& renv);

    bool Execute();

    int Error() const;

    const std::string& ArgError() const;

private:
    bool Pack();

    bool Unpack();

    bool Copy();

    bool Configure();

    bool Remove();

    bool CheckIntegrity();

    bool ShowContent();

private:
    bool ConfigureFromManifest(const CInstallManifest& rmanifest);

    void WriteConfig(const std::vector<sdv::SClassInfo>& rvecAllClasses, const std::filesystem::path& rpathConfig,
        const CSdvPackagerEnvironment::CComponentVector& rvecComponents, bool bUserConfig,
        CSdvPackagerEnvironment::CComponentVector& rvecAddedToConfig);

    static void DrawTable(const std::vector<std::vector<std::string>>& rvecInfoTable, bool bSimple);

    CSdvPackagerEnvironment     m_env;
    int                         m_nError = NO_ERROR;
    std::string                 m_ssArgError;
};


#endif // !defined PACKAGER_H