Bitstream Interpretation Library (BIL)
0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
configuration
V5ConfigurationDump.cpp
Go to the documentation of this file.
1
6
#include <
configuration/V5Configuration.hpp
>
7
#include <
configuration/V5ConfigurationDump.hpp
>
8
#include <
configuration/V5FrameAddressString.hpp
>
9
#include <
exception/IOException.hpp
>
10
#include <
util/HexPrint.hpp
>
11
12
using namespace
bil;
13
14
15
void
bil::dumpConfiguration
(
const
V5Configuration
& cfg, std::ostream& cfgOut, std::ostream& indexOut)
16
{
17
// collect list with all frame addresses and their frames
18
V5Configuration::pairconstptrs_t
pairs = cfg.
contents
();
19
20
// loop over list
21
size_t
frameCount = pairs.size();
22
for
(
size_t
i = 0; i < frameCount; ++i)
23
{
24
// get pointer to current pair
25
const
V5Configuration::pair_t
* pairPtr = pairs[i];
26
27
// write one line with raw frame address info and frame data offset
28
const
V5FrameAddress
& address = pairPtr->
first
;
29
indexOut <<
toRawAddressString
(address) <<
'\t'
;
30
printHex
(indexOut, cfgOut.tellp());
31
indexOut <<
"\t("
<<
toSymbolicString
(address) <<
"):"
;
32
indexOut <<
V5CfgColumn::toString
(address.
columnType
()) <<
'\n'
;
33
if
(!indexOut)
throw
IOException
();
34
35
// write frame data
36
const
V5CfgFrame
& frame = pairPtr->second;
37
cfgOut.write(reinterpret_cast<const char*>(frame.
data
()),
V5CfgFrame::WORDCOUNT
<< 2);
38
if
(!cfgOut)
throw
IOException
();
39
}
40
}
Generated on Wed Aug 8 2012 21:57:40 for Bitstream Interpretation Library (BIL) by
1.8.1.1