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 » [REQUEST] GetDriveName function for Path.h
[REQUEST] GetDriveName function for Path.h [message #20807] Thu, 09 April 2009 11:17 Go to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Do you mind adding following inline function to Path.h:

#ifdef PLATFORM_WIN32
inline String GetDriveName(const String& path) { path.Left(2); }
#endif


Matthias
Re: [REQUEST] GetDriveName function for Path.h [message #20812 is a reply to message #20807] Thu, 09 April 2009 17:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
masu wrote on Thu, 09 April 2009 05:17

Do you mind adding following inline function to Path.h:

#ifdef PLATFORM_WIN32
inline String GetDriveName(const String& path) { path.Left(2); }
#endif


Matthias


I do not know; if all it does is Left(2), why do not just use Left(2)?

Mirek
Re: [REQUEST] GetDriveName function for Path.h [message #20848 is a reply to message #20812] Tue, 14 April 2009 10:36 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Yes, you are right maybe this is too simple to add.

Initially, I had that:

#ifdef PLATFORM_WIN32
inline String GetDriveName(const String& path) { return path.Left(path.FindFirstOf(":")+1); }
#endif


Matthias
Previous Topic: .ini file
Next Topic: problem with system() under windows [SOLVED]
Goto Forum:
  


Current Time: Sat Apr 20 10:25:02 CEST 2024

Total time taken to generate the page: 0.05513 seconds