diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-11-24 15:19:41 +0100 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-11-24 15:19:41 +0100 |
commit | 675b4aa878f16291ce33fced48a2bc7425f635ae (patch) | |
tree | 409914df27a98f65adf866da669429c4de141b6f /source/CommandOutput.cpp | |
parent | LineBlockTracer: Using the coord-based block faces. (diff) | |
download | cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.gz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.bz2 cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.lz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.xz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.zst cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.zip |
Diffstat (limited to 'source/CommandOutput.cpp')
-rw-r--r-- | source/CommandOutput.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/source/CommandOutput.cpp b/source/CommandOutput.cpp deleted file mode 100644 index c221682a1..000000000 --- a/source/CommandOutput.cpp +++ /dev/null @@ -1,71 +0,0 @@ - -// CommandOutput.cpp - -// Implements the various classes that process command output - -#include "Globals.h" -#include "CommandOutput.h" - - - - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// cCommandOutputCallback: - -void cCommandOutputCallback::Out(const char * a_Fmt, ...) -{ - AString Output; - va_list args; - va_start(args, a_Fmt); - AppendVPrintf(Output, a_Fmt, args); - va_end(args); - Output.append("\n"); - Out(Output); -} - - - - - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// cLogCommandOutputCallback: - -void cLogCommandOutputCallback::Out(const AString & a_Text) -{ - m_Buffer.append(a_Text); -} - - - - - -void cLogCommandOutputCallback::Finished(void) -{ - // Log each line separately: - size_t len = m_Buffer.length(); - size_t last = 0; - for (size_t i = 0; i < len; i++) - { - switch (m_Buffer[i]) - { - case '\n': - { - LOG(m_Buffer.substr(last, i - last).c_str()); - last = i + 1; - break; - } - } - } // for i - m_Buffer[] - if (last < len) - { - LOG(m_Buffer.substr(last).c_str()); - } - - // Clear the buffer for the next command output: - m_Buffer.clear(); -} - - - - |