From a40fe1166ab1db972a8ca0380d603c4d90eede62 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 25 Nov 2009 18:42:44 +0100 Subject: Re-organized file system stuff. --- Source/Library/Common/BasicString.class.cpp | 1 + Source/Library/Common/BasicString.class.h | 2 +- Source/Library/Common/String.class.cpp | 1 + Source/Library/Common/String.class.h | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Library') diff --git a/Source/Library/Common/BasicString.class.cpp b/Source/Library/Common/BasicString.class.cpp index f3a6164..58fa926 100644 --- a/Source/Library/Common/BasicString.class.cpp +++ b/Source/Library/Common/BasicString.class.cpp @@ -175,6 +175,7 @@ Vector< BasicString > BasicString::split(T sep) const { template BasicString BasicString::substr(s32int start, u32int size) { if (start < 0) start = m_length - start; + if (size == 0) size = m_length - start; BasicString ret; ret.m_string = new T[size + 1]; ret.m_length = size; diff --git a/Source/Library/Common/BasicString.class.h b/Source/Library/Common/BasicString.class.h index 21041e8..be74cf3 100644 --- a/Source/Library/Common/BasicString.class.h +++ b/Source/Library/Common/BasicString.class.h @@ -46,7 +46,7 @@ class BasicString { bool contains(const T& chr) const; Vector< BasicString > split(T sep) const; - BasicString substr(s32int start, u32int size); + BasicString substr(s32int start, u32int size = 0); }; #include "BasicString.class.cpp" diff --git a/Source/Library/Common/String.class.cpp b/Source/Library/Common/String.class.cpp index a824eac..da2b93e 100644 --- a/Source/Library/Common/String.class.cpp +++ b/Source/Library/Common/String.class.cpp @@ -193,6 +193,7 @@ Vector String::split(WChar c) const { String String::substr(s32int start, u32int size) { if (start < 0) start = m_length - start; + if (size == 0) size = m_length - start; String ret; ret.m_string = new WChar[size + 1]; ret.m_length = size; diff --git a/Source/Library/Common/String.class.h b/Source/Library/Common/String.class.h index 0d48ce6..473624b 100644 --- a/Source/Library/Common/String.class.h +++ b/Source/Library/Common/String.class.h @@ -43,7 +43,7 @@ class String : public BasicString { Vector split(WChar c) const; - String substr(s32int start, u32int size); + String substr(s32int start, u32int size = 0); }; #endif -- cgit v1.2.3