Adding Comments to step classes. 15/50515/2
authorPawel Sikorski <p.sikorski@samsung.com>
Thu, 29 Oct 2015 10:37:42 +0000 (11:37 +0100)
committerPawel Sikorski <p.sikorski@samsung.com>
Thu, 29 Oct 2015 10:58:34 +0000 (11:58 +0100)
The quality requirement for comments rate is >20%

Change-Id: Ic075f6435a061bdf55e6381b4e283b7c70eafcd1

src/common/step/step_backup_icons.h
src/common/step/step_backup_manifest.h
src/common/step/step_check_old_certificate.h
src/common/step/step_check_signature.h
src/common/step/step_configure.h
src/common/step/step_copy.h
src/common/step/step_copy_backup.h
src/common/step/step_copy_storage_directories.h
src/common/step/step_create_icons.h
src/common/step/step_fail.h
src/common/step/step_kill_apps.h

index 2118ed3..606fcf3 100644 (file)
 namespace common_installer {
 namespace backup {
 
+/**
+ *\brief Step responsible for backuping icons during update and uninstallation.
+ *       Used by TPK and WGT backend
+ */
 class StepBackupIcons : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of backuping icons
+   *
+   * \return Status::OK, if successful backup, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief removes backup files after successful update/deinstallation
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status clean() override;
+
+  /**
+   * \brief restores backup icons.
+   *
+   * \return Status:OK if success, Status::ERROR othewise
+   */
   Status undo() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status precheck() override { return Status::OK; }
 
  private:
index eba6ff7..0472c79 100644 (file)
 namespace common_installer {
 namespace backup {
 
+/**
+ * \brief Step responsbile for backing manifest file during update and
+ *        uninstallation. Used by WGT and TPK backend
+ */
 class StepBackupManifest : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of backuping manifest
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief removes backup file after successful update/deinstallation
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status clean() override;
+
+  /**
+   * \brief restores backup manifest.
+   *
+   * \return Status:OK if success, Status::ERROR othewise
+   */
   Status undo() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status precheck() override;
 
   SCOPE_LOG_TAG(BackupManifest)
index 1a67004..5abf004 100644 (file)
 namespace common_installer {
 namespace security {
 
+/**
+ * \brief step responsible for checking and comparing certificates of
+ *        current and new version of application. Used by WGT and TPK
+ */
 class StepCheckOldCertificate : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main checking/comparing logic.
+   *
+   * \return Status::OK if certificates are OK. ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status undo() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status precheck() override { return Status::OK; }
 
   SCOPE_LOG_TAG(CheckOldCertificate)
index d3bb421..3544692 100644 (file)
 namespace common_installer {
 namespace security {
 
+/**
+ * \brief Step responsible for checking signature of given package.
+ *        Used by WGT and TPK backend
+ */
 class StepCheckSignature : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of checking signature
+   *
+   * \return Status::OK if signature correct, Status:ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status undo() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief checks if unpacked dir is available
+   *
+   * \return Status::OK if available, Status::ERRO otherwise
+   */
   Status precheck() override;
 
   SCOPE_LOG_TAG(Signature)
index 2fd8a96..6d93219 100644 (file)
@@ -22,11 +22,41 @@ namespace configuration {
  */
 class StepConfigure : public Step {
  public:
+
+  /**
+   * \brief Constuctor
+   *
+   * \param context pointer to InstallerContext structure
+   * \param pkgmgr pointer to Pkgmgr interface
+   */
   StepConfigure(InstallerContext* context, PkgMgrPtr pkgmgr);
 
+  /**
+   * \brief configuration based on pacakge typ, request mode, user
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief Recovery file reset
+   *
+   * \return Status::OK
+   */
   Status clean() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status undo() override { return Status::OK; }
+
+  /**
+   * \brief checks, if backend not launched with root uid
+   *
+   * \return Status::OK if normal user, Status::ERROR if root
+   */
   Status precheck() override;
  private:
   bool SetupRootAppDirectory();
index 6d3aead..59e5432 100644 (file)
 namespace common_installer {
 namespace filesystem {
 
+/**
+ * \brief step responsible for moving/copying files from temp unpacked dir to
+ *        final installed package destination during INSTALLATION.
+ *        Used by WGT and TPK
+ */
 class StepCopy : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of moving/copying files
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief removes files from final package destination
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status undo() override;
+
+  /**
+   * \brief checks if necessary paths/data are provided
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status precheck() override;
 
   SCOPE_LOG_TAG(Copy)
index 1a63af3..7e77aa7 100644 (file)
 namespace common_installer {
 namespace backup {
 
+/**
+ * \brief Responsible for backuping original package resources during
+ *        update or uninstallation and copying new content of the package.
+ *        Used by WGT and TPK backend
+ */
 class StepCopyBackup : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of creating backup and copying new content
+   *
+   * \return Status::OK
+   */
   Status process() override;
+
+  /**
+   * \brief removing backup files
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status clean() override;
+
+  /**
+   * \brief Restoring original pacakge files
+   *
+   * \return Status::OK if success, Status::Error otherwise
+   */
   Status undo() override;
+
+  /**
+   * \brief checks if necessary paths are available
+   *
+   * \return Status::OK if success, Status::Error otherwise
+   */
   Status precheck() override;
 
  private:
index 86130ea..f5956bf 100644 (file)
 namespace common_installer {
 namespace filesystem {
 
+/**
+ * \brief step responsible for copying "data" and "shared" dirs
+ *        to the proper location during update or deinstallation.
+ *        Used by TPK and WGT
+ */
 class StepCopyStorageDirectories : public common_installer::Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic of copying data into directories
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief restores original content of data and shared dirs
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status undo() override;
+
+  /**
+   * \brief checks if needed paths/data are provided
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status precheck() override;
 
  protected:
index fb52c56..bc8e49a 100644 (file)
 namespace common_installer {
 namespace filesystem {
 
+/**
+ * \brief Step responsible for creating icons for applications used during
+ *        installation and update. Used by WGT and TPK backend
+ */
 class StepCreateIcons : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic for creating icons
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief removes icons from system
+   *
+   * \return Status::OK
+   */
   Status undo() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status precheck() override { return Status::OK; }
 
  protected:
index d31ca3e..82bd573 100644 (file)
 namespace common_installer {
 namespace configuration {
 
+/**
+ * \brief step used to indicate wrong request provided to the backend.
+ *        Used by TPK and WGT.
+ */
 class StepFail : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief returns error
+   *
+   * \return Status::ERROR
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status undo() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status precheck() override { return Status::OK; }
 
   SCOPE_LOG_TAG(Fail)
index 9253b09..e5d5633 100644 (file)
 namespace common_installer {
 namespace pkgmgr {
 
+/**
+ * \brief Step responsible for killing applications of the package that
+ *        is being updated, uninstalled
+ *
+ */
 class StepKillApps : public Step {
  public:
   using Step::Step;
 
+  /**
+   * \brief main logic for killing applications
+   *
+   * \return Status::OK
+   */
   Status process() override;
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status clean() override { return Status::OK; }
+
+  /**
+   * \brief empty method
+   *
+   * \return Status::OK
+   */
   Status undo() override { return Status::OK; }
+
+  /**
+   * \brief checks if neccessary data is provided
+   *
+   * \return Status::OK if success, Status::ERROR otherwise
+   */
   Status precheck() override;
 
   SCOPE_LOG_TAG(KillApps)