LCOV - code coverage report
Current view: top level - OdbDesignLib/FileModel/Design - MiscInfoFile.h (source / functions) Coverage Total Hit
Test: OdbDesign Test Coverage Lines: 100.0 % 1 1
Test Date: 2026-11-21 03:51:50 Functions: 50.0 % 2 1
Legend: Lines: hit not hit

            Line data    Source code
       1              : //
       2              : // Created by nmill on 10/13/2023.
       3              : //
       4              : 
       5              : #pragma once
       6              : #include "../OdbFile.h"
       7              : #include <chrono>
       8              : #include "../../IProtoBuffable.h"
       9              : #include "miscinfofile.pb.h"
      10              : #include "../IStreamSaveable.h"
      11              : #include <memory>
      12              : #include "../../odbdesign_export.h"
      13              : 
      14              : namespace Odb::Lib::FileModel::Design
      15              : {
      16              : 
      17              :     class ODBDESIGN_EXPORT MiscInfoFile : public OdbFile, public IProtoBuffable<Odb::Lib::Protobuf::MiscInfoFile>, public IStreamSaveable
      18              :     {
      19              :     public:
      20              :         MiscInfoFile();
      21           93 :         ~MiscInfoFile() = default;
      22              : 
      23              :         std::string GetProductModelName() const;
      24              :         std::string GetJobName() const;
      25              :         std::string GetOdbVersionMajor() const;
      26              :         std::string GetOdbVersionMinor() const;
      27              :         std::string GetOdbSource() const;        
      28              :         std::chrono::system_clock::time_point GetCreationDate() const;
      29              :         std::chrono::system_clock::time_point GetSaveDate() const;
      30              :         std::string GetSaveApp() const;
      31              :         std::string GetSaveUser() const;
      32              :         std::string GetUnits() const;
      33              :         unsigned int GetMaxUniqueId() const;
      34              : 
      35              :         bool Parse(std::filesystem::path path) override;
      36              :         bool Save(std::ostream& os) override;
      37              : 
      38              :         // Inherited via IProtoBuffable
      39              :         std::unique_ptr<Odb::Lib::Protobuf::MiscInfoFile> to_protobuf() const override;
      40              :         void from_protobuf(const Odb::Lib::Protobuf::MiscInfoFile& message) override;
      41              : 
      42              :     private:
      43              :         std::string m_productModelName;
      44              :         std::string m_jobName;
      45              :         std::string m_odbVersionMajor;
      46              :         std::string m_odbVersionMinor;
      47              :         std::string m_odbSource;
      48              :         std::chrono::system_clock::time_point m_creationDateDate;   // "20161024.101454"
      49              :         std::chrono::system_clock::time_point m_saveDate;           // "20170810.132829"
      50              :         std::string m_saveApp;
      51              :         std::string m_saveUser;
      52              :         std::string m_units;
      53              :         unsigned int m_maxUniqueId;
      54              : 
      55              :         static inline bool attributeValueIsOptional(const std::string& attribute);
      56              : 
      57              :         constexpr inline static const char* OPTIONAL_ATTRIBUTES[] =
      58              :         {
      59              :            //"ODB_SOURCE",  // not optional per spec pg. 80
      60              :            "MAX_UID",
      61              :         };
      62              : 
      63              :         constexpr inline static const char* PRODUCT_MODEL_NAME_KEY = "PRODUCT_MODEL_NAME";
      64              :         constexpr inline static const char* JOB_NAME_KEY = "JOB_NAME";
      65              :         constexpr inline static const char* ODB_VERSION_MAJOR_KEY = "ODB_VERSION_MAJOR";
      66              :         constexpr inline static const char* ODB_VERSION_MINOR_KEY = "ODB_VERSION_MINOR";
      67              :         constexpr inline static const char* ODB_SOURCE_KEY = "ODB_SOURCE";
      68              :         constexpr inline static const char* CREATION_DATE_KEY = "CREATION_DATE";
      69              :         constexpr inline static const char* SAVE_DATE_KEY = "SAVE_DATE";
      70              :         constexpr inline static const char* SAVE_APP_KEY = "SAVE_APP";
      71              :         constexpr inline static const char* SAVE_USER_KEY = "SAVE_USER";
      72              :         constexpr inline static const char* UNITS_KEY = "UNITS";
      73              :         constexpr inline static const char* MAX_UID_KEY = "MAX_UID";        
      74              :     };
      75              : }
      76              : 
        

Generated by: LCOV version 2.0-1