-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDumper.cpp
41 lines (36 loc) · 993 Bytes
/
Dumper.cpp
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
/************************************************************************
* DICOMLIB
* Copyright 2003 Sunnybrook and Women's College Health Science Center
* Implemented by Trevor Morgan ([email protected])
*
* See LICENSE.txt for copyright and licensing info.
*************************************************************************/
#include "Dumper.hpp"
#include "DataDictionary.hpp"
#include "ValueToStream.hpp"
using std::ostream;
namespace dicom
{
struct Dumper
{
std::ostream& Out_;
Dumper(std::ostream& Out);
void operator()(const DataSet::value_type& v);
};
Dumper::Dumper(ostream& Out):Out_(Out)
{
}
void Dumper::operator()(const DataSet::value_type& v)
{
Out_ << GetName(v.first) << "\t" << v.second << std::endl;
}
void Dump(const DataSet& data,std::ostream& Out)
{
std::for_each(data.begin(),data.end(),Dumper(Out));
}
ostream& operator << (ostream& Out, const DataSet& data)
{
Dump(data,Out);
return Out;
}
}//namespace dicom