diff options
author | imarom <imarom@cisco.com> | 2015-08-24 17:52:52 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-08-24 17:52:52 +0300 |
commit | 36c6c87fe4380b214f8ff8a45dc0213fa109821c (patch) | |
tree | ac4886a9e36fef3d0d7f621ac46678ebb7486015 /yaml-cpp/src/ostream.cpp | |
parent | 7d3be8c612e295820649779335288c197b80ccb2 (diff) |
fix compile issues with external libarries
Diffstat (limited to 'yaml-cpp/src/ostream.cpp')
-rwxr-xr-x | yaml-cpp/src/ostream.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/yaml-cpp/src/ostream.cpp b/yaml-cpp/src/ostream.cpp deleted file mode 100755 index a7f1e14b..00000000 --- a/yaml-cpp/src/ostream.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "yaml-cpp/ostream.h" -#include <cstring> - -namespace YAML -{ - ostream::ostream(): m_buffer(0), m_pos(0), m_size(0), m_row(0), m_col(0) - { - reserve(1024); - } - - ostream::~ostream() - { - delete [] m_buffer; - } - - void ostream::reserve(unsigned size) - { - if(size <= m_size) - return; - - char *newBuffer = new char[size]; - std::memset(newBuffer, 0, size * sizeof(char)); - std::memcpy(newBuffer, m_buffer, m_size * sizeof(char)); - delete [] m_buffer; - m_buffer = newBuffer; - m_size = size; - } - - void ostream::put(char ch) - { - if(m_pos >= m_size - 1) // an extra space for the NULL terminator - reserve(m_size * 2); - - m_buffer[m_pos] = ch; - m_pos++; - - if(ch == '\n') { - m_row++; - m_col = 0; - } else - m_col++; - } - - ostream& operator << (ostream& out, const char *str) - { - std::size_t length = std::strlen(str); - for(std::size_t i=0;i<length;i++) - out.put(str[i]); - return out; - } - - ostream& operator << (ostream& out, const std::string& str) - { - out << str.c_str(); - return out; - } - - ostream& operator << (ostream& out, char ch) - { - out.put(ch); - return out; - } -} |