• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 29143042407

11 Jul 2026 06:34AM UTC coverage: 2.912% (-73.0%) from 75.918%
29143042407

push

github

web-flow
Merge pull request #1146 from ilCosmico/acds-read-payload-anchor

Read the AcDs payload area offset from the data segment header

264 of 12999 branches covered (2.03%)

Branch coverage included in aggregate %.

0 of 30 new or added lines in 1 file covered. (0.0%)

31243 existing lines in 465 files now uncovered.

1337 of 41984 relevant lines covered (3.18%)

5.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ACadSharp/XData/ExtendedDataRecord.cs
1
using CSMath;
2

3
namespace ACadSharp.XData;
4

5
/// <summary>
6
/// Defines an <see cref="ExtendedData"/> record.
7
/// </summary>
8
public abstract class ExtendedDataRecord
9
{
10
        /// <summary>
11
        /// Dxf code which defines the value type.
12
        /// </summary>
UNCOV
13
        public DxfCode Code { get; }
×
14

15
        /// <summary>
16
        /// Raw value as an object.
17
        /// </summary>
UNCOV
18
        public object RawValue { get { return this._value; } }
×
19

20
        protected object _value;
21

UNCOV
22
        protected ExtendedDataRecord(DxfCode code, object value)
×
UNCOV
23
        {
×
UNCOV
24
                this.Code = code;
×
UNCOV
25
                this._value = value;
×
UNCOV
26
        }
×
27

28
        /// <summary>
29
        /// Creates a new instance of an appropriate ExtendedDataRecord subclass based on the specified group code and value.
30
        /// </summary>
31
        /// <remarks>The type of the returned ExtendedDataRecord depends on the group code provided. The value parameter
32
        /// must be compatible with the expected type for the given group code; otherwise, an exception may occur.</remarks>
33
        /// <param name="groupCode">The group code that determines the type of extended data record to create.</param>
34
        /// <param name="value">The value to be encapsulated in the extended data record. The expected type and format depend on the specified
35
        /// group code.</param>
36
        /// <returns>An instance of an ExtendedDataRecord subclass representing the provided value for the specified group code.</returns>
37
        /// <exception cref="System.NotSupportedException">Thrown if the specified group code is not supported.</exception>
38
        public static ExtendedDataRecord Create(GroupCodeValueType groupCode, object value)
UNCOV
39
        {
×
UNCOV
40
                switch (groupCode)
×
41
                {
42
                        case GroupCodeValueType.Bool:
43
                                return new ExtendedDataInteger16((short)((System.Convert.ToBoolean(value)) ? 1 : 0));
×
44
                        case GroupCodeValueType.Point3D:
45
                                return new ExtendedDataCoordinate((XYZ)value);
×
46
                        case GroupCodeValueType.Handle:
47
                        case GroupCodeValueType.ObjectId:
48
                                return new ExtendedDataHandle(System.Convert.ToUInt64(value));
×
49
                        case GroupCodeValueType.String:
50
                        case GroupCodeValueType.Comment:
51
                        case GroupCodeValueType.ExtendedDataString:
52
                                return new ExtendedDataString(System.Convert.ToString(value));
×
53
                        case GroupCodeValueType.Chunk:
54
                        case GroupCodeValueType.ExtendedDataChunk:
55
                                return new ExtendedDataBinaryChunk((byte[])value);
×
56
                        case GroupCodeValueType.ExtendedDataHandle:
57
                                return new ExtendedDataHandle(System.Convert.ToUInt64(value));
×
58
                        case GroupCodeValueType.Double:
59
                        case GroupCodeValueType.ExtendedDataDouble:
UNCOV
60
                                return new ExtendedDataReal(System.Convert.ToDouble(value));
×
61
                        case GroupCodeValueType.Byte:
62
                        case GroupCodeValueType.Int16:
63
                        case GroupCodeValueType.ExtendedDataInt16:
UNCOV
64
                                return new ExtendedDataInteger16(System.Convert.ToInt16(value));
×
65
                        case GroupCodeValueType.Int32:
66
                        case GroupCodeValueType.ExtendedDataInt32:
67
                        case GroupCodeValueType.Int64:
68
                                return new ExtendedDataInteger32(System.Convert.ToInt32(value));
×
69
                        case GroupCodeValueType.None:
70
                        default:
71
                                throw new System.NotSupportedException();
×
72
                }
UNCOV
73
        }
×
74

75
        /// <inheritdoc/>
76
        public override string ToString()
77
        {
×
78
                return $"{this.Code}:{this._value}";
×
79
        }
×
80
}
81

82
/// <summary>
83
/// Defines a typed <see cref="ExtendedData"/> record.
84
/// </summary>
85
/// <typeparam name="T"></typeparam>
86
public abstract class ExtendedDataRecord<T> : ExtendedDataRecord
87
{
88
        /// <summary>
89
        /// Value for this record.
90
        /// </summary>
91
        public T Value
92
        {
UNCOV
93
                get { return (T)this._value; }
×
94
                set
95
                {
×
96
                        this._value = value;
×
97
                }
×
98
        }
99

UNCOV
100
        protected ExtendedDataRecord(DxfCode code, T value) : base(code, value)
×
UNCOV
101
        {
×
UNCOV
102
        }
×
103
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc