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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » DirectoryUp doesn't seem to work.
Re: DirectoryUp doesn't seem to work. [message #18573 is a reply to message #18554] Thu, 09 October 2008 16:11 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 826
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
I'm sorry, but I'm unable to work on this right now, but I want to get back to it next week, and rewrite it from scratch.

But Mjrt has valid point about how it works right now, but I think the trailing slash should be handled as well.


Quote:


ASSERT(DirectoryUp("/home/Isaac/") == "/home");
ASSERT(DirectoryUp("/home/Isaac") == "/home");




No, the directory is changed as reference variable.
The return value of function is the name of directory which was left, i.e. in both cases the return value should be "Isaac", the only question is whether it should return Isaac/ and Isaac, or just Isaac.

Whichever you prefer, write here, I can't decide myself, but I think erasing the trailing slash always will in the end make it easier to use, even if you would have to add slash back in special cases.

Mjrt: I mostly don't like the code itself, there's way too much #ifdef and code duplicity for my taste. I have already some idea how to write it much more cleanly, but I don't have time right now. :/
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Drawing raw data to an Image / Draw object?
Next Topic: More small gems
Goto Forum:
  


Current Time: Sat Jun 07 22:58:02 CEST 2025

Total time taken to generate the page: 0.04891 seconds