fbxsdk/core/base/fbxutils.h Source File

fbxutils.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_BASE_UTILITIES_H_
14 #define _FBXSDK_CORE_BASE_UTILITIES_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
20 
21 #include <fbxsdk/fbxsdk_nsbegin.h>
22 
23 #ifndef FBXSDK_ENV_WINSTORE
24 
26  FBXSDK_DLL FbxString FbxGetEnv(const char* pEnvVar);
27 
31 #endif
32 
36 
39 FBXSDK_DLL void FbxSetSystemTempPath(const char* pPathUTF8);
40 
44 
46 FBXSDK_DLL void FbxSetCurrentWorkPath(const char* pPath_UTF8);
47 
49 {
50 public:
58  static FbxString Bind(const char* pRootPath, const char* pFilePath, bool pCleanPath=true);
59 
64  static FbxString GetFolderName(const char* pFilePath);
65 
72  static FbxString GetFileName(const char* pFilePath, bool pWithExtension=true);
73 
79  static FbxString GetExtensionName(const char* pFilePath);
80 
87  static FbxString ChangeExtension(const char* pFilePath, const char* pExtension);
88 
90  static bool IsRelative(const char* pPath);
91 
98  static FbxString GetRelativePath(const char* pRootPath, const char* pNewPath);
99 
101  static FbxString GetRelativeFilePath(const char* pRootPath, const char* pNewFilePath);
102 
106  static FbxString Resolve(const char* pRelPath);
107 
109  static FbxString Clean(const char* pPath);
110 
116  static FbxString GenerateFileName(const char* pFolder, const char* pPrefix);
117 
122  static bool Exist(const char* pFolderPathUTF8);
123 
128  static bool Create(const char* pFolderPathUTF8);
129 
134  static bool Delete(const char* pFolderPathUTF8);
135 
136 #ifndef FBXSDK_ENV_WINSTORE
137 
140  static bool IsEmpty(const char* pFolderPath_UTF8);
141 #endif
142 };
143 
147 {
148 public:
149  static FbxStatus& GetRef()
150  {
151  if( !mStatusPtr )
152  {
153  mStatusPtr = FbxNew<FbxStatus>();
154  }
155  return *mStatusPtr;
156  }
157 
158 private:
159  FbxStatusGlobal(){ mStatusPtr = NULL; }
160  ~FbxStatusGlobal(){ FbxDelete<FbxStatus>(mStatusPtr); }
161  static FbxStatusGlobal sgFbxStatusGlobal;
162  static FbxStatus* mStatusPtr;
163 };
164 
165 
166 #include <fbxsdk/fbxsdk_nsend.h>
167 
168 #endif /* _FBXSDK_CORE_BASE_UTILITIES_H_ */
void FbxSetCurrentWorkPath(const char *pPath_UTF8)
Change the working directory of the system.
FBX SDK environment definition.
Global accessor to an FbxStatus object.
Definition: fbxutils.h:146
#define NULL
Definition: fbxarch.h:210
Utility class to manipulate strings.
Definition: fbxstring.h:66
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
FbxString FbxGetSystemTempPath()
Retrieve the system temporary folder path name.
FbxString FbxGetEnv(const char *pEnvVar)
Retrieve the environment variable value.
FbxString FbxGetApplicationDirectory()
Get the application directory.
void FbxSetSystemTempPath(const char *pPathUTF8)
Override the system temporary folder path name.
FbxString FbxGetCurrentWorkPath()
Retrieve the working directory of the system in UTF8 format.
static FbxStatus & GetRef()
Definition: fbxutils.h:149
#define FBXSDK_DLL
Definition: fbxarch.h:173