2013-08-20 19:19:28 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
2013-09-13 03:04:10 +00:00
|
|
|
#include "library/state.h"
|
2013-08-20 19:19:28 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
state::state():
|
|
|
|
m_formatter(mk_simple_formatter()),
|
|
|
|
m_regular_channel(new stdout_channel()),
|
|
|
|
m_diagnostic_channel(new stderr_channel()) {
|
|
|
|
}
|
|
|
|
|
|
|
|
state::state(options const & opts, formatter const & fmt):
|
|
|
|
m_options(opts),
|
|
|
|
m_formatter(fmt),
|
|
|
|
m_regular_channel(new stdout_channel()),
|
|
|
|
m_diagnostic_channel(new stderr_channel()) {
|
|
|
|
}
|
|
|
|
|
|
|
|
state::~state() {}
|
|
|
|
|
|
|
|
void state::set_regular_channel(std::shared_ptr<output_channel> const & out) {
|
2013-08-20 20:55:31 +00:00
|
|
|
if (out)
|
|
|
|
m_regular_channel = out;
|
2013-08-20 19:19:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void state::set_diagnostic_channel(std::shared_ptr<output_channel> const & out) {
|
2013-08-20 20:55:31 +00:00
|
|
|
if (out)
|
|
|
|
m_diagnostic_channel = out;
|
2013-08-20 19:19:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void state::set_options(options const & opts) {
|
|
|
|
m_options = opts;
|
|
|
|
}
|
|
|
|
|
|
|
|
void state::set_formatter(formatter const & f) {
|
|
|
|
m_formatter = f;
|
|
|
|
}
|
|
|
|
}
|