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 » How to get path separator depended on platform?
How to get path separator depended on platform? [message #44556] Fri, 27 March 2015 23:29 Go to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I would like to ask is there any official way to get path separator character on current platform in Upp Core library.

Pseudo code of function that I am looking for:
String DirSeparator() {
#if defined(PLATFORM_POSIX)
	return "/";
#elif defined(PLATFORM_WIN32) || defined(PLATFORM_WIN64)
	return "\\";
#endif
}


Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Fri, 27 March 2015 23:33]

Report message to a moderator

Re: How to get path separator depended on platform? [message #44557 is a reply to message #44556] Sat, 28 March 2015 07:22 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Hi,

in Core.h, there's these two macro:

#define DIR_SEP '/'
#define DIR_SEPS "/"


regards
omari.
Re: How to get path separator depended on platform? [message #44558 is a reply to message #44557] Sat, 28 March 2015 14:29 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello omari,

Thanks for answer! It works like I wanted.

Personally, I think that this macros should be documented somewhere...

Sincerely,
Klugier
Previous Topic: Xmlize problem with Nulls
Next Topic: [solved]How to disable "auto access redirect url " of the HttpRequest?
Goto Forum:
  


Current Time: Fri Mar 29 13:14:21 CET 2024

Total time taken to generate the page: 0.01473 seconds