diff options
| author | Mart Jansink <mart@gofilex.nl> | 2018-02-12 18:16:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-14 23:28:26 +0000 |
| commit | 9470bc50aa948677fabb201824acac518bbe7f96 (patch) | |
| tree | e0364f4aef23c1fdff4b05e65847fe5062fa2c95 /src | |
| parent | e46ae44d2c7271faf0ae14a1c5b97db6ec457354 (diff) | |
Optionally write the KDMs to the stdout.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/screen_kdm.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/screen_kdm.cc b/src/lib/screen_kdm.cc index 7e934b455..3515af8a6 100644 --- a/src/lib/screen_kdm.cc +++ b/src/lib/screen_kdm.cc @@ -25,6 +25,7 @@ #include <boost/foreach.hpp> using std::string; +using std::cout; using std::list; using boost::shared_ptr; @@ -45,6 +46,16 @@ ScreenKDM::write_files ( { int written = 0; + if (directory == "-") { + /* Write KDMs to the stdout */ + BOOST_FOREACH (ScreenKDM const & i, screen_kdms) { + cout << i.kdm.as_xml (); + ++written; + } + + return written; + } + if (!boost::filesystem::exists (directory)) { boost::filesystem::create_directories (directory); } |
