From 970b3bc9d7aefa6641d89e99677762dbe00912fa Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 22 Jan 2013 21:48:28 -0500 Subject: [PATCH] a simpler alternative to sockets --- sdk/core/qtutils.cpp | 2 ++ sdk/openbr_plugin.h | 6 ++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/sdk/core/qtutils.cpp b/sdk/core/qtutils.cpp index 9151ea1..80e5d59 100644 --- a/sdk/core/qtutils.cpp +++ b/sdk/core/qtutils.cpp @@ -106,6 +106,8 @@ void QtUtils::writeFile(const QString &file, const QByteArray &data, int compres const QByteArray contents = (compression == 0) ? data : qCompress(data, compression); if (baseName == "terminal") { printf("%s", qPrintable(contents)); + } else if (baseName == "buffer") { + Globals->buffer = data; } else { QFile f(file); touchDir(f); diff --git a/sdk/openbr_plugin.h b/sdk/openbr_plugin.h index d3f7980..fb7dcc2 100644 --- a/sdk/openbr_plugin.h +++ b/sdk/openbr_plugin.h @@ -513,6 +513,12 @@ public: Q_PROPERTY(bool noDuplicates READ get_noDuplicates WRITE set_noDuplicates RESET reset_noDuplicates) BR_PROPERTY(bool, noDuplicates, false) + /*! + * \brief File output is redirected here if the file's basename is 'buffer', clearing previous contents. + */ + Q_PROPERTY(QByteArray buffer READ get_buffer WRITE set_buffer RESET reset_buffer) + BR_PROPERTY(QByteArray, buffer, QByteArray()) + QHash abbreviations; /*!< \brief Used by br::Transform::make() to expand abbreviated algorithms into their complete definitions. */ QHash classes; /*!< \brief Used by classifiers to associate text class labels with unique integers IDs. */ QTime startTime; /*!< \brief Used to estimate timeRemaining(). */ -- libgit2 0.21.4