libqi  1.12
Public Member Functions
qi::SDKLayout Class Reference

A class to handle SDK Layouts. More...

#include <qi/path/sdklayout.hpp>

List of all members.

Public Member Functions

 SDKLayout ()
 This constructor use argc/argv stored by qi::init(argc, argv) to determine the sdk layout.
 SDKLayout (const std::string &prefix, const std::string &mode="")
 Construct a SDKLayout using prefix as the sdk prefix.
 SDKLayout (const SDKLayout &rhs)
SDKLayoutoperator= (const SDKLayout &rhs)
std::string sdkPrefix () const
std::vector< std::string > getSdkPrefixes () const
void addOptionalSdkPrefix (const char *prefix)
void clearOptionalSdkPrefix ()
std::string findBin (const std::string &name) const
std::string findLib (const std::string &name) const
std::string findConf (const std::string &applicationName, const std::string &filename) const
std::string findData (const std::string &applicationName, const std::string &filename) const
std::vector< std::string > confPaths (const std::string &applicationName="") const
std::vector< std::string > dataPaths (const std::string &applicationName="") const
std::vector< std::string > binPaths () const
std::vector< std::string > libPaths () const
std::string userWritableDataPath (const std::string &applicationName, const std::string &filename) const
std::string userWritableConfPath (const std::string &applicationName, const std::string &filename="") const

Detailed Description

A class to handle SDK Layouts.

This class allow to get various path information:

Definition at line 41 of file sdklayout.hpp.


Constructor & Destructor Documentation

qi::SDKLayout::SDKLayout ( )

This constructor use argc/argv stored by qi::init(argc, argv) to determine the sdk layout.

If qi::init has not been called before creating this class, call to methods of this class will throw an exception.

qi::SDKLayout::SDKLayout ( const std::string &  prefix,
const std::string &  mode = "" 
) [explicit]

Construct a SDKLayout using prefix as the sdk prefix.

Parameters:
prefixa valid sdk prefix.
mode"" by default, could be DEBUG or RELEASE when running in the build folder under MSVC.

Member Function Documentation

void qi::SDKLayout::addOptionalSdkPrefix ( const char *  prefix)
std::vector<std::string> qi::SDKLayout::binPaths ( ) const
void qi::SDKLayout::clearOptionalSdkPrefix ( )
std::vector<std::string> qi::SDKLayout::confPaths ( const std::string &  applicationName = "") const
std::vector<std::string> qi::SDKLayout::dataPaths ( const std::string &  applicationName = "") const
std::string qi::SDKLayout::findBin ( const std::string &  name) const
std::string qi::SDKLayout::findConf ( const std::string &  applicationName,
const std::string &  filename 
) const
std::string qi::SDKLayout::findData ( const std::string &  applicationName,
const std::string &  filename 
) const

Look for a data file.

The file is search in a list of possible directories, the first match is returned. The list of paths is constructed like this:

     * - first, a standard path in the home directory (like
     *  ~/.local/share/<applicationName>/<filename>)
     * - then
     *   <sdk_prefix>/share/<applicationName>/<filename>
     *     for each known SDK prefix
     * 
Parameters:
applicationNameName of the application (in UTF-8).
filenameName of the file to look for (in UTF-8). You can specify subdirectories using "/" as directory separator.
Returns:
The complete, native path of the file if it was found, an empty string otherwise.
Exceptions:
std::invalid_argumentif filename was empty
std::string qi::SDKLayout::findLib ( const std::string &  name) const
std::vector<std::string> qi::SDKLayout::getSdkPrefixes ( ) const
std::vector<std::string> qi::SDKLayout::libPaths ( ) const
std::string qi::SDKLayout::sdkPrefix ( ) const
std::string qi::SDKLayout::userWritableConfPath ( const std::string &  applicationName,
const std::string &  filename = "" 
) const
std::string qi::SDKLayout::userWritableDataPath ( const std::string &  applicationName,
const std::string &  filename 
) const

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines