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 » Developing U++ » UppHub » More new functions
More new functions [message #18804] Wed, 22 October 2008 23:25 Go to previous message
koldo is currently offline  koldo
Messages: 3432
Registered: August 2008
Senior Veteran
Hello all

I propose you some new functions tested in GNU/Linux Ubuntu (Gnome), XP and Vista.
Please give me your feedback and feel free to fix everything:

String GetExtExecutable(const char *ext);

// GetExtExecutable("pdf") will return the name of the program
// that by default open pdf files.
// In XP/Vista it will return the program with the full path


bool LaunchFile(const String& file);

// LaunchFile("Sheet.xls") will open the file with the
// program asigned by default to open xls files


int LaunchCommand(const char *cmd, void (*readCallBack)(String &));

// LaunchCommand("mplayer myclip.avi", MyCallback) will launch
// the command line program with args without opening a window, and
// all the output will be sent to MyCallback(String &) function


int LaunchCommand(const char *cmd, String &ret);

// LaunchCommand("mplayer myclip.avi",str) will do the same
// but sending the output to String str


String GetDesktopFolder();
String GetProgramsFolder();
String GetAppDataFolder();
String GetMusicFolder();
String GetPicturesFolder();
String GetVideoFolder();
String GetPersonalFolder();
String GetTemplatesFolder();
String GetDownloadFolder();

// These functions return the folder assigned for Desktop,
// Program Files, etc.
// (from now please do not do this:
// AppendFileName(GetHomeFolder(), "Desktop");
// to refer to the Desktop folder or using
// "C:\\Program Files" ...
// in many languages is wrong
// It does not handle firefox download folder as it has been
// impossible for me to know where it is (until now)


bool FileCat(const char *file, const char *appendFile);

// FileCat("FirstFile", "SecondFile") just append SecondFile
// from the end of FirstFile


As you may see some of them use in Linux Portland XdgUtils in the background.
I think it is a strong portable widespread source of information.

If somebody is interested I have a small class that works like
LaunchCommand but opening a command window that handles \r and
\n properly (to be used for example with mencoder).


Best regards
Koldo


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simple app-wide "macros"
Next Topic: Grid helper
Goto Forum:
  


Current Time: Wed May 07 16:06:50 CEST 2025

Total time taken to generate the page: 0.04202 seconds