summaryrefslogtreecommitdiffstats
path: root/akregator/src/mk4storage/metakit/src/field.h
blob: 8bf3dc8c629fa1bfc60e4a371dbb832f155631a9 (plain)
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
// field.h --
// $Id$
// This is part of Metakit, see http://www.equi4.com/metakit/

/** @file
 * Core class to represent fields
 */

#ifndef __FIELD_H__
#define __FIELD_H__

#ifndef __K4CONF_H__
#error Please include "k4conf.h" before this header file
#endif
  
/////////////////////////////////////////////////////////////////////////////

class c4_Field
{
  c4_PtrArray _subFields;
  c4_String _name;
  char _type;
  c4_Field* _indirect;

public: 
/* Construction / destruction */
  c4_Field (const char*&, c4_Field* =0);
    //: Constructs a new field.
  ~c4_Field ();

/* Repeating and compound fields */
  int NumSubFields() const; 
    //: Returns the number of subfields.
  c4_Field& SubField(int) const;
    //: Returns the description of each subfield.
  bool IsRepeating() const;
    //: Returns true if this field tqcontains subtables.
  
/* Field name and description */
  const c4_String& Name() const;
    //: Returns name of this field.
  char Type() const;
    //: Returns the type description of this field, if any.
  char OrigType() const;
    //: Similar, but report types which were originall 'M' as well.
  c4_String Description(bool anonymous_ =false) const;
    //: Describes the structure, omit names if anonymous.
  c4_String DescribeSubFields(bool anonymous_ =false) const;
    //: Describes just the subfields, omit names if anonymous.
  
private:
  c4_Field (const c4_Field&);     // not implemented
  void operator= (const c4_Field&); // not implemented
};

/////////////////////////////////////////////////////////////////////////////

#if q4_INLINE
#include "field.inl"
#endif

/////////////////////////////////////////////////////////////////////////////

#endif