00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00015 #include "nvsgcommon.h"
00016
00017 #include <vector>
00018
00019 #include "__WIN64__workarounds.h"
00020
00021 namespace nvutil
00022 {
00023
00025
00040 extern NVSG_API bool FindFile( const std::string &mask
00041 , const std::vector<std::string> &searchPaths
00042 , std::vector<std::string> &results
00043 , bool recursive=false
00044 );
00045
00047
00049 extern NVSG_API bool FindFileFirst( const std::string &mask
00050 , const std::vector<std::string> &searchPaths
00051 , std::string &nameOut
00052 , bool recursive=false
00053 );
00054
00056 extern NVSG_API bool FileExists( const std::string &filepath
00057 );
00058
00060
00062 extern NVSG_API void GetFileNameFromPath( const std::string& path
00063 , std::string& fname
00064 );
00066
00068 extern NVSG_API void GetFileExtFromPath( const std::string& path
00069 , std::string& fext
00070 );
00072
00074 extern NVSG_API void GetDirFromPath( const std::string& path
00075 , std::string& dir
00076 );
00078
00080 extern NVSG_API void GetDrvFromPath( const std::string& path
00081 , std::string& drv
00082 );
00084
00086 extern NVSG_API void GetDrvAndDirFromPath(const std::string& path
00087 , std::string& dir
00088 );
00089 #if defined(_WIN32)
00090
00091
00093 extern NVSG_API void GetModulePath( const std::string& module
00094 , std::string& path
00095 );
00096 #elif defined(LINUX)
00097
00098
00100 extern NVSG_API void GetModulePath( std::string& path );
00101 #endif
00102
00103 #if defined(_WIN32)
00104
00105
00107 extern NVSG_API void GetModulePath( const HMODULE hModule
00108 , std::string& path
00109 );
00110 #endif
00111
00113
00116 extern NVSG_API bool GetCurrentDir( std::string& path
00117 );
00118
00119 template<typename T> T Maximum( T a, T b, T c )
00120 {
00121 return( ( a < b ) ? __WIN64__wa__std_max( b, c ) : __WIN64__wa__std_max( a, c ) );
00122 }
00123
00124 template<typename T> T Minimum( T a, T b, T c )
00125 {
00126 return( ( a < b ) ? __WIN64__wa__std_min( a, c ) : __WIN64__wa__std_min( b, c ) );
00127 }
00128
00130
00133 extern NVSG_API std::string SetCurrentDir( const std::string& dir
00134 );
00135
00136 }