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 » Uuid formating with dashes
Re: Uuid formating with dashes [message #25236 is a reply to message #25117] Mon, 15 February 2010 12:24 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14256
Registered: November 2005
Ultimate Member
cbpporter wrote on Thu, 11 February 2010 04:48

I need to have my Uuids formated with dashes in the standard positions.

So I added to Uuid.h as a counterpart to Format:
String UuidFormatDashes(const Uuid& id);

and Uuid.cpp:
String UuidFormatDashes(const Uuid& id) {
	return Sprintf("%08X-%04X-%04X-%04X-%04X%08X", id.a, (id.b & 0xFFFF0000) >> 16, id.b & 0x0000FFFF,
		(id.c & 0xFFFF0000) >> 16, id.c & 0x0000FFFF, id.d);
}

Alternatively, and even probably better this method should be part of Uuid class and drop the prefix.


Useful.

Added as FormatWithDashes.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: XmlParser patch
Next Topic: Defs.h minmax() change/fix
Goto Forum:
  


Current Time: Sun May 04 03:10:53 CEST 2025

Total time taken to generate the page: 0.00927 seconds