-
Notifications
You must be signed in to change notification settings - Fork 0
/
StreamDevice.cc
51 lines (41 loc) · 1.09 KB
/
StreamDevice.cc
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
// -*- C++ -*-
//
//--------------------------------------------------------------------------------
//
// Michael A.G. Aivazis
// California Institute of Technology
// (C) 1998-2005 All Rights Reserved
//
// <LicenseText>
//
//--------------------------------------------------------------------------------
//
#include <portinfo>
#include <string>
#include <ostream>
#include "Device.h"
#include "StreamDevice.h"
#include "Renderer.h"
#include "DefaultRenderer.h"
using namespace journal;
// interface
void StreamDevice::record(const Entry & entry) {
string_t text = _renderer->render(entry);
_write(text);
return;
}
// implementation
void StreamDevice::_write(const StreamDevice::string_t text) {
_stream << text;
return;
}
// meta-methods
StreamDevice::~StreamDevice() {}
StreamDevice::StreamDevice(journal::StreamDevice::stream_t & stream) :
Device(),
_stream(stream),
_renderer(new DefaultRenderer)
{}
// version
// $Id: StreamDevice.cc,v 1.1.1.1 2006-11-27 00:09:38 aivazis Exp $
// End of file