LCOV - code coverage report
Current view: top level - src - userinfo.h (source / functions) Coverage Total Hit
Test: .lcov.total Lines: 0.0 % 2 0
Test Date: 2026-03-23 21:55:57 Functions: 0.0 % 1 0

            Line data    Source code
       1              : // SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
       2              : // SPDX-License-Identifier: GPL-3.0-or-later
       3              : #ifndef SRC_USERINFO_H_
       4              : #define SRC_USERINFO_H_
       5              : 
       6              : #include <QDateTime>
       7              : #include <QString>
       8              : 
       9              : /*!
      10              :     \struct UserInfo
      11              :     \brief Stores key info lines including validity, creation date and more.
      12              :  */
      13              : struct UserInfo {
      14            0 :   UserInfo() : validity('-'), have_secret(false), enabled(false) {}
      15              : 
      16              :   /**
      17              :    * @brief UserInfo::fullyValid when validity is f or u.
      18              :    * http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
      19              :    */
      20            0 :   auto fullyValid() -> bool { return validity == 'f' || validity == 'u'; }
      21              :   /**
      22              :    * @brief UserInfo::marginallyValid when validity is m.
      23              :    * http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
      24              :    */
      25              :   auto marginallyValid() -> bool { return validity == 'm'; }
      26              :   /**
      27              :    * @brief UserInfo::isValid when fullyValid or marginallyValid.
      28              :    */
      29              :   auto isValid() -> bool { return fullyValid() || marginallyValid(); }
      30              : 
      31              :   /**
      32              :    * @brief UserInfo::name full name
      33              :    */
      34              :   QString name;
      35              :   /**
      36              :    * @brief UserInfo::key_id hexadecimal representation
      37              :    */
      38              :   QString key_id;
      39              :   /**
      40              :    * @brief UserInfo::validity GnuPG representation of validity
      41              :    * http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
      42              :    */
      43              :   char validity;
      44              :   /**
      45              :    * @brief UserInfo::have_secret secret key is available
      46              :    * (can decrypt with this key)
      47              :    */
      48              :   bool have_secret;
      49              :   /**
      50              :    * @brief UserInfo::enabled
      51              :    */
      52              :   bool enabled;
      53              :   /**
      54              :    * @brief UserInfo::expiry date/time key expires
      55              :    */
      56              :   QDateTime expiry;
      57              :   /**
      58              :    * @brief UserInfo::created date/time key was created
      59              :    */
      60              :   QDateTime created;
      61              : };
      62              : 
      63              : #endif // SRC_USERINFO_H_
        

Generated by: LCOV version 2.4-beta