Optionally write the KDMs to the stdout.
authorMart Jansink <mart@gofilex.nl>
Mon, 12 Feb 2018 17:16:18 +0000 (18:16 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 14 Feb 2018 23:28:26 +0000 (23:28 +0000)
src/lib/screen_kdm.cc

index 7e934b4557b341011bb154494efd564fa2307660..3515af8a6644f1b6ed70377e1474652577b0fc88 100644 (file)
@@ -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);
        }