Platform folders  4.0.0
Public Member Functions | List of all members
sago::PlatformFolders Class Reference

#include <platform_folders.h>

Public Member Functions

std::string getDesktopFolder () const
 
std::string getDocumentsFolder () const
 
std::string getPicturesFolder () const
 
std::string getPublicFolder () const
 
std::string getDownloadFolder1 () const
 
std::string getMusicFolder () const
 
std::string getVideoFolder () const
 
std::string getSaveGamesFolder1 () const
 

Detailed Description

This class contains methods for finding the system depended special folders. For Windows these folders are either by convention or given by CSIDL. For Linux XDG convention is used. The Linux version has very little error checking and assumes that the config is correct

Member Function Documentation

◆ getDesktopFolder()

std::string sago::PlatformFolders::getDesktopFolder ( ) const

The folder that represents the desktop. Normally you should try not to use this folder.

Returns
Absolute path to the user's desktop

◆ getDocumentsFolder()

std::string sago::PlatformFolders::getDocumentsFolder ( ) const

The folder to store user documents to

Returns
Absolute path to the "Documents" folder

◆ getDownloadFolder1()

std::string sago::PlatformFolders::getDownloadFolder1 ( ) const

The folder where files are downloaded.

Note
Windows: This version is XP compatible and returns the Desktop. Vista and later has a dedicated folder.
Returns
Absolute path to the folder where files are downloaded to.

◆ getMusicFolder()

std::string sago::PlatformFolders::getMusicFolder ( ) const

The folder where music is stored

Returns
Absolute path to the music folder

◆ getPicturesFolder()

std::string sago::PlatformFolders::getPicturesFolder ( ) const

The folder for storring the user's pictures.

Returns
Absolute path to the "Picture" folder

◆ getPublicFolder()

std::string sago::PlatformFolders::getPublicFolder ( ) const

◆ getSaveGamesFolder1()

std::string sago::PlatformFolders::getSaveGamesFolder1 ( ) const

The base folder for storring saved games. You must add the program name to it like this:

PlatformFolders pf;
string saved_games_folder = pf.getSaveGamesFolder1()+"/My Program Name/";
Note
Windows: This is an XP compatible version and returns the path to "My Games" in Documents. Vista and later has an official folder.
Linux: XDF does not define a folder for saved games. This will just return the same as GetDataHome()
Returns
The folder base folder for storring save games.

◆ getVideoFolder()

std::string sago::PlatformFolders::getVideoFolder ( ) const

The folder where video is stored

Returns
Absolute path to the video folder

The documentation for this class was generated from the following file: