]> Creatis software - creaImageIO.git/blob - src/creaImageIOField.h
54edbc3507e4bb509378a3cf1de044e0e98180e0
[creaImageIO.git] / src / creaImageIOField.h
1 #ifndef __creaImageIOField_h_INCLUDED__
2 #define __creaImageIOField_h_INCLUDED__
3
4 #include <string>
5 #include <iostream>
6 namespace creaImageIO
7 {
8
9
10   //=====================================================================
11   namespace Field
12   {
13
14     typedef std::string Key;
15
16     struct Description
17     {      
18       Description()
19         : key(""), group(0), element(0), name(""), flags(0)
20       {
21       }
22       Description(const std::string& k,
23                   unsigned short g,
24                   unsigned short e,
25                   const std::string& n,
26                   unsigned int f)
27         : key(k), group(g), element(e), name(n), flags(f) 
28       {}
29       const std::string& GetKey() const { return key; }
30       unsigned short GetGroup() const { return group; }
31       unsigned short GetElement() const { return element; }
32       const std::string& GetName() const { return name; }
33       unsigned int GetFlags() const { return flags; }
34       
35       std::string key;
36       unsigned short group;
37       unsigned short element;
38       std::string name;
39       unsigned int flags;
40     };
41
42     typedef std::string Value;
43
44   } // namespace Field
45   //=====================================================================
46
47
48 } // namespace creaImageIO
49
50
51
52   //=====================================================================
53 inline std::ostream& operator<<(std::ostream& s, const creaImageIO::Field::Description& d)
54 {
55   s << "[" << d.key << ":" << d.name << "]";
56   return s;
57 }
58 //=====================================================================
59
60
61
62 #endif // #ifndef __creaImageIOField_h_INCLUDED__