本文整理汇总了C++中FilePath::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::Clear方法的具体用法?C++ FilePath::Clear怎么用?C++ FilePath::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: subDirectory
/// Get the full path to the base directory in which user data is stored.
///
/// @param[out] rbSuccess True if the path was retrieved successfully, false if not.
///
/// @return User data directory path, with a trailing path separator character.
static FilePath& GetMutableUserDataDirectory( bool& rbSuccess )
{
static FilePath userDataDirectory;
static bool bLocateRequested = false;
static bool bLocateSuccess = false;
rbSuccess = bLocateSuccess;
if( !bLocateRequested )
{
bLocateRequested = true;
tstring gameDataDirectory = Helium::GetAppDataDirectory();
if ( gameDataDirectory.empty() )
{
return userDataDirectory;
}
String subDirectory ( GetProcessName().c_str() );
userDataDirectory.Set( gameDataDirectory + TXT( "/" ) + subDirectory.GetData() );
if( !userDataDirectory.MakePath() )
{
userDataDirectory.Clear();
return userDataDirectory;
}
userDataDirectory += TXT( "/" );
bLocateSuccess = true;
rbSuccess = true;
}
return userDataDirectory;
}
示例2: GetMutableBaseDirectory
/// Get the full path to the base directory of the application.
///
/// @param[out] rbSuccess True if the path was retrieved successfully, false if not.
///
/// @return Application base directory path, with a trailing path separator character.
static FilePath& GetMutableBaseDirectory( bool& rbSuccess )
{
static FilePath baseDirectory;
static bool bLocateRequested = false;
static bool bLocateSuccess = false;
rbSuccess = bLocateSuccess;
if( !bLocateRequested )
{
bLocateRequested = true;
baseDirectory.Set( Helium::GetProcessPath() );
// Strip the executable file.
// Strip the configuration type subdirectory (i.e. Debug, Intermediate, Release, etc.).
// Strip the platform binary subdirectory (i.e. x32, x64).
// Strip the "Bin" directory.
baseDirectory.Set( baseDirectory.Directory() + TXT( "../../.." ) );
if( !baseDirectory.Exists() )
{
baseDirectory.Clear();
return baseDirectory;
}
baseDirectory += TXT( "/" );
bLocateSuccess = true;
rbSuccess = true;
}
return baseDirectory;
}
示例3: GetMutableDataDirectory
/// Get the full path to the base directory in which data files are stored.
///
/// @param[out] rbSuccess True if the path was retrieved successfully, false if not.
///
/// @return Data directory path, with a trailing path separator character.
static FilePath& GetMutableDataDirectory( bool& rbSuccess )
{
static FilePath dataDirectory;
static bool bLocateRequested = false;
static bool bLocateSuccess = false;
rbSuccess = bLocateSuccess;
if( !bLocateRequested )
{
bLocateRequested = true;
// Get the application base directory.
bool bBaseDirectorySuccess;
dataDirectory = GetMutableBaseDirectory( bBaseDirectorySuccess );
if( !bBaseDirectorySuccess )
{
dataDirectory.Clear();
return dataDirectory;
}
dataDirectory += TXT( "Data" );
if( !dataDirectory.Exists() )
{
dataDirectory.Clear();
return dataDirectory;
}
dataDirectory += TXT( "/" );
bLocateSuccess = true;
rbSuccess = true;
}
return dataDirectory;
}