summaryrefslogtreecommitdiff
path: root/source/Core/StreamString.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
committerEd Maste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
commit205afe679855a4ce8149cdaa94d3f0868ce796dc (patch)
tree09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/Core/StreamString.cpp
parent0cac4ca3916ac24ab6139d03cbfd18db9e715bfe (diff)
Notes
Diffstat (limited to 'source/Core/StreamString.cpp')
-rw-r--r--source/Core/StreamString.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/Core/StreamString.cpp b/source/Core/StreamString.cpp
index 8d7d039fd65c..ef2b70583ebd 100644
--- a/source/Core/StreamString.cpp
+++ b/source/Core/StreamString.cpp
@@ -65,6 +65,22 @@ StreamString::GetSize () const
return m_packet.size();
}
+size_t
+StreamString::GetSizeOfLastLine () const
+{
+ const size_t length = m_packet.size();
+ size_t last_line_begin_pos = m_packet.find_last_of("\r\n");
+ if (last_line_begin_pos == std::string::npos)
+ {
+ return length;
+ }
+ else
+ {
+ ++last_line_begin_pos;
+ return length - last_line_begin_pos;
+ }
+}
+
std::string &
StreamString::GetString()
{