Subversion Repositories spk

Rev

Rev 39 | Rev 48 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39 Rev 43
Line 4... Line 4...
4
#include <stdarg.h>
4
#include <stdarg.h>
-
 
5
#include <algorithm>
5
 
6
 
6
namespace Utils {
7
namespace Utils {
7
 
8
 
8
String operator+(const char *str1, const String &str2)
9
String operator+(const char *str1, const String &str2)
9
{
10
{
Line 669... Line 670...
669
const String &String::truncate(int iNum)
670
const String &String::truncate(int iNum)
670
{
671
{
671
	size_t pos = iNum;
672
	size_t pos = iNum;
672
	if ( iNum < 0 ) pos = this->length() + iNum;
673
	if ( iNum < 0 ) pos = this->length() + iNum;
673
	this->erase(pos, this->length() - pos);
674
	this->erase(pos, this->length() - pos);
-
 
675
	return (*this);
-
 
676
}
-
 
677
 
-
 
678
String String::lower() const
-
 
679
{
-
 
680
	Utils::String newStr(*this);
-
 
681
	std::transform(this->begin(), this->end(), newStr.begin(), tolower);
-
 
682
	return newStr;
-
 
683
}
-
 
684
 
-
 
685
String String::upper() const
-
 
686
{
-
 
687
	Utils::String newStr(*this);
-
 
688
	std::transform(this->begin(), this->end(), newStr.begin(), toupper);
-
 
689
	return newStr;
-
 
690
}
-
 
691
const String &String::toLower()
-
 
692
{
-
 
693
	std::transform(this->begin(), this->end(), this->begin(), tolower);
-
 
694
	return (*this);
-
 
695
}
-
 
696
 
-
 
697
const String &String::toUpper()
-
 
698
{
-
 
699
	std::transform(this->begin(), this->end(), this->begin(), toupper);
674
	return (*this);
700
	return (*this);
675
}
701
}
676
 
702
 
677
}//NAMESPACE
703
}//NAMESPACE