LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/cad/libopencad - caddictionary.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 2 2 100.0 %
Date: 2024-11-21 22:18:42 Functions: 3 4 75.0 %

          Line data    Source code
       1             : /*******************************************************************************
       2             :  *  Project: libopencad
       3             :  *  Purpose: OpenSource CAD formats support library
       4             :  *  Author: Alexandr Borzykh, mush3d at gmail.com
       5             :  *  Author: Dmitry Baryshnikov, bishop.dev@gmail.com
       6             :  *  Language: C++
       7             :  *******************************************************************************
       8             :  *  The MIT License (MIT)
       9             :  *
      10             :  *  Copyright (c) 2016 Alexandr Borzykh
      11             :  *  Copyright (c) 2016 NextGIS, <info@nextgis.com>
      12             :  *
      13             :   * SPDX-License-Identifier: MIT
      14             :  *******************************************************************************/
      15             : #ifndef CADDICTIONARY_H
      16             : #define CADDICTIONARY_H
      17             : 
      18             : #include "cadobjects.h"
      19             : #include <memory>
      20             : 
      21             : /*
      22             :  * @brief Base-class for XRecord and Dictionary.
      23             :  */
      24             : class OCAD_EXTERN CADDictionaryRecord
      25             : {
      26             : public:
      27             :     CADDictionaryRecord();
      28          32 :     virtual ~CADDictionaryRecord(){}
      29             : 
      30             :     CADObject::ObjectType getType() const;
      31             : 
      32             : protected:
      33             :     CADObject::ObjectType objType;
      34             : };
      35             : 
      36             : /*
      37             :  * @brief Class which implements XRecord
      38             :  */
      39             : class OCAD_EXTERN CADXRecord : public CADDictionaryRecord
      40             : {
      41             : public:
      42             :     CADXRecord();
      43          48 :     virtual ~CADXRecord(){}
      44             : 
      45             :     const std::string getRecordData() const;
      46             :     void              setRecordData( const std::string& data );
      47             : 
      48             : private:
      49             :     std::string sRecordData;
      50             : };
      51             : 
      52             : /*
      53             :  * @brief Class which implements Dictionary
      54             :  */
      55             : typedef std::pair< std::string, std::shared_ptr<CADDictionaryRecord>> CADDictionaryItem;
      56             : class OCAD_EXTERN CADDictionary : public CADDictionaryRecord
      57             : {
      58             : public:
      59             :     CADDictionary();
      60             :     virtual ~CADDictionary();
      61             : 
      62             :     size_t getRecordsCount();
      63             :     void   addRecord( CADDictionaryItem );
      64             :     CADDictionaryItem getRecord( size_t index );
      65             :     std::string getRecordByName(const std::string& name) const;
      66             : private:
      67             :     std::vector< CADDictionaryItem > astXRecords;
      68             : };
      69             : 
      70             : #endif // CADDICTIONARY_H

Generated by: LCOV version 1.14