This file is indexed.

/usr/include/dcmtk/dcmiod/iodcontentitemmacro.h is in libdcmtk-dev 3.6.2-3build3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
/*
 *
 *  Copyright (C) 2016, Open Connections GmbH
 *  All rights reserved.  See COPYRIGHT file for details.
 *
 *  This software and supporting documentation are maintained by
 *
 *    OFFIS e.V.
 *    R&D Division Health
 *    Escherweg 2
 *    D-26121 Oldenburg, Germany
 *
 *
 *  Module: dcmpmap
 *
 *  Author: Jan Schlamelcher
 *
 *  Purpose: Class for managing the Content Item Macro
 *
 */

#ifndef IODCONTENTITEMMACRO_H
#define IODCONTENTITEMMACRO_H

#include "dcmtk/config/osconfig.h"
#include "dcmtk/ofstd/ofmem.h"
#include "dcmtk/dcmiod/iodrules.h"
#include "dcmtk/dcmiod/modbase.h"
#include "dcmtk/dcmiod/iodmacro.h"
#include "dcmtk/dcmiod/iodtypes.h"

/** Class representing the Content Item Macro:
 *
 *  ValueType: (CS, 1, 1)
 *  ConceptNameCodeSequence: (SQ, 1, 1)
 *  DateTime: (DT, 1, 1C)
 *  Date: (DA, 1, 1C)
 *  Time: (TM, 1, 1C)
 *  PersonName: (PN, 1, 1C)
 *  UID: (UI, 1, 1C)
 *  TextValue: (UT, 1, 1C)
 *  ConceptCodeSequence: (SQ, 1, 1C)
 *  NumericValue: (DS, 1-n, 1C)
 *  FloatingPointValue: (FD, 1-n, 1C)
 *  RationalNumeratorValue: (SL, 1-n, 1C)
 *  RationalDenominatorValue: (UL, 1-n, 1C)
 *  MeasurementUnitsCodeSequence: (SQ, 1, 1C)
 *  ReferencedSOPSequence: (SQ, 1, 1C)
 */
class DCMTK_DCMIOD_EXPORT ContentItemMacro : public IODComponent
{
public:

  enum ValueType
  {
     // Value is empty and not provided
     VT_EMPTY,
     // Value is provided but not known to the implementation
     VT_UNKNOWN,
     VT_DATE,
     VT_TIME,
     VT_DATETIME,
     VT_PNAME,
     VT_UIDREF,
     VT_TEXT,
     VT_CODE,
     VT_NUMERIC,
     VT_COMPOSITE,
     VT_IMAGE
   };

  /** Class representing an item within the Content Item Macro's Referenced
   *  SOP Sequence
   */
  class DCMTK_DCMIOD_EXPORT ReferencedSOPSequenceItem : public IODComponent
  {
  public:

    /** Constructor
     *  @param  item The item to be used for data storage. If NULL, the
     *          class creates an empty data container.
     *  @param  rules The rule set for this class. If NULL, the class creates
     *          one from scratch and adds its values.
     *  @param  parent The parent of the IOD component (NULL if none or unknown)
     */
    ReferencedSOPSequenceItem(OFshared_ptr<DcmItem> item,
                              OFshared_ptr<IODRules> rules,
                              IODComponent* parent = NULL);

    /** Constructor
     *  @param  parent The parent of the IOD component (NULL if none or unknown)
     */
    ReferencedSOPSequenceItem(IODComponent* parent = NULL);

    /** Copy Constructor, performs deep copy
     *  @param  rhs The parent of the IOD component (NULL if none or unknown)
     */
    ReferencedSOPSequenceItem(const ReferencedSOPSequenceItem& rhs);

    /** Virtual Destructor
     */
    virtual ~ReferencedSOPSequenceItem();

    /** Read attributes from given item into this class
     *  @param source  The source to read from
     *  @param clearOldData If OFTrue, old data is cleared before reading. Otherwise
     *         old data is overwritten (or amended)
     *  @result EC_Normal if reading was successful, error otherwise
     */
    virtual OFCondition read(DcmItem& source,
                            const OFBool clearOldData = OFTrue);

    /** Write attributes from this class into given item
     *  @param  destination The item to write to
     *  @result EC_Normal if writing was successful, error otherwise
     */
    virtual OFCondition write(DcmItem& destination);

    /** Resets rules to their original values
     */
    virtual void resetRules();

    /** Get name of macro
     *  @return Name of the component ("ReferencedSOPSequenceItem")
     */
    virtual OFString getName() const;

    /** Get SOPInstanceReferenceMacro
     *  @return a reference to the included SOPInstanceReferenceMacro
     */
    virtual SOPInstanceReferenceMacro& getSOPInstanceReferenceMacro();

    /** Get ReferencedFrameNumber
     *  @param  value Reference to variable in which the value should be stored
     *  @param  pos Index of the value to get (0..vm-1), -1 for all components
     *  @return EC_Normal if successful, an error code otherwise
     */
    virtual OFCondition getReferencedFrameNumber(OFString &value,
                                                 const signed long pos = 0) const;

    /** Get ReferencedSegmentNumber
     *  @param  value Reference to variable in which the value should be stored
     *  @param  pos Index of the value to get (0..vm-1), -1 for all components
     *  @return EC_Normal if successful, an error code otherwise
     */
    virtual OFCondition getReferencedSegmentNumber(Uint16 &value,
                                                   const signed long pos = 0) const;

    /** Set ReferencedFrameNumber
     *  @param  value Value to be set (single value only) or "" for no value
     *  @param  checkValue Check 'value' for conformance with VR (IS) and VM (1-n) if enabled
     *  @return EC_Normal if successful, an error code otherwise
     */
    virtual OFCondition setReferencedFrameNumber(const OFString &value,
                                                 const OFBool checkValue = OFTrue);

    /** Set ReferencedSegmentNumber
     *  @param  value Value to be set (single value only) or "" for no value
     *  @param  checkValue Check 'value' for conformance with VR (US) and VM (1-n) if enabled
     *  @return EC_Normal if successful, an error code otherwise
     */
    virtual OFCondition setReferencedSegmentNumber(const Uint16 value,
                                                   const OFBool checkValue = OFTrue);

  protected:

    /// The name of this item ("ReferencedSOPSequenceItem")
    static const OFString m_ComponentName;

    /// SOP Instance Reference Macro
    SOPInstanceReferenceMacro m_SOPInstanceReferenceMacro;
  };

  /** Constructor
   *  @param  item The item to be used for data storage. If NULL, the
   *          class creates an empty data container.
   *  @param  rules The rule set for this class. If NULL, the class creates
   *          one from scratch and adds its values.
   */
  ContentItemMacro(OFshared_ptr<DcmItem> item,
                   OFshared_ptr<IODRules> rules);

  /** Constructor
   */
  ContentItemMacro();

  /** Destructor
   */
  virtual ~ContentItemMacro();

  ContentItemMacro(const ContentItemMacro& rhs);

  /** Resets rules to their original values
   */
  virtual void resetRules();

  /** Get name of module ("ContentItemMacro")
   *  @return Name of the module ("ContentItemMacro")
   */
  virtual OFString getName() const;

  /** Read attributes from given item into this class
   *  @param source  The source to read from
   *  @param clearOldData If OFTrue, old data is cleared before reading. Otherwise
   *         old data is overwritten (or amended)
   *  @result EC_Normal if reading was successful, error otherwise
   */
  virtual OFCondition read(DcmItem& source,
                           const OFBool clearOldData = OFTrue);

  /** Write attributes from this class into given item
   *  @param  destination The item to write to
   *  @result EC_Normal if writing was successful, error otherwise
   */
  virtual OFCondition write(DcmItem& destination);

  /** Get ValueType
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getValueType(OFString &value,
                                   const signed long pos = 0) const;

  /** Get ValueType
   *  @param  value Reference to variable in which the value should be stored
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getValueType(ValueType &value) const;

  /** Get reference to the ConceptNameCodeSequence
   *  @return a reference to the ConceptNameCodeSequence
   */
  virtual CodeSequenceMacro* getConceptNameCodeSequence();

  /** Get a reference to the entire ConceptNameCodeSequence, including items
   *  exceeding the value multiplicity restriction of "1"
   *  @return a reference to the entire ConceptNameCodeSequence
   */
  virtual OFVector<CodeSequenceMacro*>& getEntireConceptNameCodeSequence();

  /** Get DateTime
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getDateTime(OFString &value,
                                  const signed long pos = 0) const;

  /** Get Date
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getDate(OFString &value,
                              const signed long pos = 0) const;

  /** Get Time
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getTime(OFString &value,
                              const signed long pos = 0) const;

  /** Get PersonName
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getPersonName(OFString &value,
                                    const signed long pos = 0) const;

  /** Get UID
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getUID(OFString &value,
                             const signed long pos = 0) const;

  /** Get TextValue
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getTextValue(OFString &value,
                                   const signed long pos = 0) const;

  /** Get reference to the ConceptCodeSequence
   *  @return a reference to the ConceptCodeSequence
   */
  virtual CodeSequenceMacro* getConceptCodeSequence();

  /** Get a reference to the entire ConceptCodeSequence, including items
   *  exceeding the value multiplicity restriction of "1"
   *  @return a reference to the entire ConceptCodeSequence
   */
  virtual OFVector<CodeSequenceMacro*>& getEntireConceptCodeSequence();

  /** Get NumericValue
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getNumericValue(OFString &value,
                                      const signed long pos = 0) const;

  /** Get FloatingPointValue
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getFloatingPointValue(Float64 &value,
                                            const signed long pos = 0) const;

  /** Get RationalNumeratorValue
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRationalNumeratorValue(Sint32 &value,
                                                const signed long pos = 0) const;

  /** Get RationalDenominatorValue
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1), -1 for all components
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRationalDenominatorValue(Uint32 &value,
                                                  const signed long pos = 0) const;

  /** Get reference to the MeasurementUnitsCodeSequence
   *  @return a reference to the MeasurementUnitsCodeSequence
   */
  virtual CodeSequenceMacro* getMeasurementUnitsCodeSequence();

  /** Get a reference to the entire MeasurementUnitsCodeSequence, including items
   *  exceeding the value multiplicity restriction of "1"
   *  @return a reference to the entire MeasurementUnitsCodeSequence
   */
  virtual OFVector<CodeSequenceMacro*>& getEntireMeasurementUnitsCodeSequence();

  /** Get reference to the ReferencedSOPSequence
   *  @return a reference to the ReferencedSOPSequence
   */
  virtual ReferencedSOPSequenceItem* getReferencedSOPSequence();

  /** Get a reference to the entire ReferencedSOPSequence, including items
   *  exceeding the value multiplicity restriction of "1"
   *  @return a reference to the entire ReferencedSOPSequence
   */
  virtual OFVector<ReferencedSOPSequenceItem*>& getEntireReferencedSOPSequence();

  /** Set ValueType
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (CS) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setValueType(const OFString &value,
                                   const OFBool checkValue = OFTrue);

  /** Set ValueType
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value'. Does nothing, here for consistency with
   *          other set() functions.
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setValueType(const ValueType value,
                                   const OFBool checkValue = OFTrue);

  /** Set DateTime
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (DT) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setDateTime(const OFString &value,
                                  const OFBool checkValue = OFTrue);

  /** Set Date
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (DA) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setDate(const OFString &value,
                              const OFBool checkValue = OFTrue);

  /** Set Time
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (TM) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setTime(const OFString &value,
                              const OFBool checkValue = OFTrue);

  /** Set PersonName
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (PN) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setPersonName(const OFString &value,
                                    const OFBool checkValue = OFTrue);

  /** Set UID
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (UI) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setUID(const OFString &value,
                             const OFBool checkValue = OFTrue);

  /** Set TextValue
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (UT) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setTextValue(const OFString &value,
                                   const OFBool checkValue = OFTrue);

  /** Set NumericValue
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  checkValue Check 'value' for conformance with VR (DS) and VM (1-n) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setNumericValue(const OFString &value,
                                      const OFBool checkValue = OFTrue);

  /** Set FloatingPointValue
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  pos Index of the value to be set (starting from 0)
   *  @param  checkValue Check 'value' for conformance with VR (FD) and VM (1-n) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setFloatingPointValue(const Float64 value,
                                            const unsigned long pos = 0,
                                            const OFBool checkValue = OFTrue);

  /** Set RationalNumeratorValue
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  pos Index of the value to be set (starting from 0)
   *  @param  checkValue Check 'value' for conformance with VR (SL) and VM (1-n) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRationalNumeratorValue(const Sint32 value,
                                                const unsigned long pos = 0,
                                                const OFBool checkValue = OFTrue);

  /** Set RationalDenominatorValue
   *  @param  value Value to be set (single value only) or "" for no value
   *  @param  pos Index of the value to be set (starting from 0)
   *  @param  checkValue Check 'value' for conformance with VR (UL) and VM (1-n) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRationalDenominatorValue(const Uint32 value,
                                                  const unsigned long pos = 0,
                                                  const OFBool checkValue = OFTrue);

  virtual OFString toString();

protected:

  /// The name of this module ("ContentItemMacro")
  static const OFString m_ModuleName;

  /// ConceptNameCodeSequence
  OFVector<CodeSequenceMacro*> m_ConceptNameCodeSequence;

  /// ConceptCodeSequence
  OFVector<CodeSequenceMacro*> m_ConceptCodeSequence;

  /// MeasurementUnitsCodeSequence
  OFVector<CodeSequenceMacro*> m_MeasurementUnitsCodeSequence;

  /// ReferencedSOPSequence
  OFVector<ReferencedSOPSequenceItem*> m_ReferencedSOPSequence;
};

#endif // IODCONTENTITEMMACRO_H