FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxPathUtils Class Reference

#include <fbxutils.h>

Class Description

Definition at line 52 of file fbxutils.h.

Static Public Member Functions

static FbxString Bind (const char *pRootPath, const char *pFilePath, bool pCleanPath=true)
 Bind together a root path with a file path. More...
 
static FbxString GetFolderName (const char *pFilePath)
 Extract the folder name from the given file path. More...
 
static FbxString GetFileName (const char *pFilePath, bool pWithExtension=true)
 Extract file name from the given file path. More...
 
static FbxString GetExtensionName (const char *pFilePath)
 Extract the file extension in the given file path. More...
 
static FbxString ChangeExtension (const char *pFilePath, const char *pExtension)
 Change or append a file extension to the specified file path. More...
 
static bool IsRelative (const char *pPath)
 Test if the given path is relative path, if it is return true. More...
 
static FbxString GetRelativePath (const char *pRootPath, const char *pNewPath)
 Get the given new path's relative path to the given root path. More...
 
static FbxString GetRelativeFilePath (const char *pRootPath, const char *pNewFilePath)
 Get the given new path's relative path to the given root path. More...
 
static FbxString Resolve (const char *pRelPath)
 Get the full path of given path (if the given path is relative path, it will take current directory as default root path.) More...
 
static FbxString Clean (const char *pPath)
 Clean the redundant and useless denotations in given path name. More...
 
static FbxString GenerateFileName (const char *pFolder, const char *pPrefix)
 Generate full safe file path name you can use to create new file. More...
 
static bool Exist (const char *pFolderPathUTF8)
 Verify if the specified folder path exist. More...
 
static bool Create (const char *pFolderPathUTF8)
 Create the specified folder path if it doesn't exist. More...
 
static bool Delete (const char *pFolderPathUTF8)
 Delete the specified folder path and all its content recursively. More...
 
static bool IsEmpty (const char *pFolderPath_UTF8)
 Verify if the folder contains items or not. More...
 

Member Function Documentation

◆ Bind()

static FbxString Bind ( const char *  pRootPath,
const char *  pFilePath,
bool  pCleanPath = true 
)
static

Bind together a root path with a file path.

Parameters
pRootPathThe root path that will get binded to the file path.
pFilePathThe file path to bind to the root path.
pCleanPathIf true, the resulting path will be cleaned via FbxPathUtils::Clean().
Returns
Both paths binded together forming a new file path.
Remarks
If the file path is already a full valid path, pFilePath is returned.
Examples:
ViewScene/SceneContext.cxx.

◆ GetFolderName()

static FbxString GetFolderName ( const char *  pFilePath)
static

Extract the folder name from the given file path.

Parameters
pFilePathThe given file path.
Returns
The folder name. If there isn't any '\' or '/' in the given file path, it will return pFilePath.
Examples:
ExportScene03/main.cxx, ProceduralTexture/main.cxx, and ViewScene/SceneContext.cxx.

◆ GetFileName()

static FbxString GetFileName ( const char *  pFilePath,
bool  pWithExtension = true 
)
static

Extract file name from the given file path.

Parameters
pFilePathThe given file path.
pWithExtensionDecide the file name with extension or without extension. If it is true, return the file name with extension; if it is false, return the file name without extension.
Examples:
ExportScene03/main.cxx, ProceduralTexture/main.cxx, and ViewScene/SceneContext.cxx.

◆ GetExtensionName()

static FbxString GetExtensionName ( const char *  pFilePath)
static

Extract the file extension in the given file path.

Parameters
pFilePathThe file path to extract the extension.
Returns
The file extension without the '.' character.
Remarks
Return empty string if the file path doesn't contain a valid extension.
Examples:
ProceduralTexture/main.cxx.

◆ ChangeExtension()

static FbxString ChangeExtension ( const char *  pFilePath,
const char *  pExtension 
)
static

Change or append a file extension to the specified file path.

Parameters
pFilePathThe file path to change the file extension
pExtensionThe extension to change or append to the file path.
Returns
The file path with the file extension changed/added.
Remarks
If the file path doesn't end with a valid file name, pFilePath is returned.

◆ IsRelative()

static bool IsRelative ( const char *  pPath)
static

Test if the given path is relative path, if it is return true.

◆ GetRelativePath()

static FbxString GetRelativePath ( const char *  pRootPath,
const char *  pNewPath 
)
static

Get the given new path's relative path to the given root path.

Parameters
pRootPathThe given root path
pNewPathThe given new path. If it is only file name, the default directory is work directory.
Returns
The relative path.
Remarks
If the given two paths have the same drive, the function will turn '\' in the relative path to '/'.

◆ GetRelativeFilePath()

static FbxString GetRelativeFilePath ( const char *  pRootPath,
const char *  pNewFilePath 
)
static

Get the given new path's relative path to the given root path.

Examples:
ExportScene03/main.cxx.

◆ Resolve()

static FbxString Resolve ( const char *  pRelPath)
static

Get the full path of given path (if the given path is relative path, it will take current directory as default root path.)

Examples:
ExportScene03/main.cxx, and ViewScene/SceneContext.cxx.

◆ Clean()

static FbxString Clean ( const char *  pPath)
static

Clean the redundant and useless denotations in given path name.

Examples:
ExportScene03/main.cxx.

◆ GenerateFileName()

static FbxString GenerateFileName ( const char *  pFolder,
const char *  pPrefix 
)
static

Generate full safe file path name you can use to create new file.

Parameters
pFolderThe folder where the file name should be attempted to be created.
pPrefixThe prefix of generated file name.
Returns
A valid file path that can safely be used to create a new file.

◆ Exist()

static bool Exist ( const char *  pFolderPathUTF8)
static

Verify if the specified folder path exist.

Parameters
pFolderPathUTF8The folder path to test its existance.
Returns
True if the folder path exist, false otherwise.
Remarks
This function work for relative paths. It will search from the current work path.

◆ Create()

static bool Create ( const char *  pFolderPathUTF8)
static

Create the specified folder path if it doesn't exist.

Parameters
pFolderPathUTF8The folder path to create, in UTF8 encoding.
Returns
True if folder path already exist, or if it was successfully created, false otherwise.
Remarks
This function will create multiple folders if needed, and it also work for relative paths.
Examples:
ExportScene03/main.cxx, and ProceduralTexture/main.cxx.

◆ Delete()

static bool Delete ( const char *  pFolderPathUTF8)
static

Delete the specified folder path and all its content recursively.

Parameters
pFolderPathUTF8The folder path to delete, in UTF8 encoding.
Returns
True if folder path was successfully deleted, false otherwise.
Remarks
This function work for relative paths. It will search from the current work path.

◆ IsEmpty()

static bool IsEmpty ( const char *  pFolderPath_UTF8)
static

Verify if the folder contains items or not.

Parameters
pFolderPath_UTF8The folder path to test if it contains items.
Returns
True if the folder contain any kind of entry type.

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