Dire
Complete cross-platform solution for data and user directories discovery.
Loading...
Searching...
No Matches
dire::PlatformProjectName Class Reference

#include <project.hpp>

Public Member Functions

 PlatformProjectName (IReallyWantMyOwnPlatformProjectName name)
 
 operator Path const & () const
 
 operator Path () &&
 

Friends

auto name (std::string domain, std::string org, std::string app_name) -> PlatformProjectName
 

Detailed Description

This class stores the platform-specific project name, which is used as a subpath for the project directories.

It should be obtained via a call to dire::name(), which returns a name standarized for the build platform.

If you REALLY want to enforce your own name, initialize it by using IReallyWantMyOwnPlatformProjectName.

This object is passed into dire::ProjectDirsBundle::make() or all of project free functions, which return valid project directories.

Constructor & Destructor Documentation

◆ PlatformProjectName()

dire::PlatformProjectName::PlatformProjectName ( IReallyWantMyOwnPlatformProjectName  name)
inline

Member Function Documentation

◆ operator Path()

dire::PlatformProjectName::operator Path ( ) &&
inlineexplicit

◆ operator Path const &()

dire::PlatformProjectName::operator Path const & ( ) const
inlineexplicit

Friends And Related Symbol Documentation

◆ name

auto name ( std::string  domain,
std::string  org,
std::string  app_name 
) -> PlatformProjectName
friend

Used to obtain a platform specific PlatformProjectName which is used for obtaining project specific directories for caches, configs and such.

If you want to override the name to your own one, initialize PlatformProjectName directly with IReallyWantMyOwnPlatformProjectName.

On linux only app_name is used and produces a name that is lowercased and with spaces removed. On windows only app_name and org are used and produces a path like domain / name without other modifications. On mac all three are used and produce a name like domain.org.app_name with all free segments lowercased and spaces replaced with hyphens. e.g. dire::name("me", "dich0tomy", "dire") will produce:

Platform Result
Linux dire
Mac me.dich0tomy.dire
Windows Dichotomy/Dire

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