Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Suggestion for StringBuffer
Suggestion for StringBuffer [message #44904] Mon, 20 July 2015 00:50 Go to previous message
rxantos is currently offline  rxantos
Messages: 72
Registered: October 2011
Member
Could it be possible to Add

void  Set(const String& s);
StringBuffer(const String& s){ Zero(); Set(s);}

to StringBuffer in uppsrc/Core/String.h
and

void StringBuffer::Set(const String& s)
{
	int len = s.GetLength();
	if(0 < len) {
		SetLength(len);
		memcpy(begin, s.Begin(), len);
	} else {
		Zero();
	}
}

in uppsrc/Core/String.cpp

Sometimes I need top create a string buffer from a constant string to edit in a copy without affecting the original.

[Updated on: Mon, 20 July 2015 00:52]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: Dehaviour of DirectoryExists
Next Topic: VectorMap.Get
Goto Forum:
  


Current Time: Mon Apr 29 10:14:10 CEST 2024

Total time taken to generate the page: 0.03453 seconds