30 #if defined (_WIN32) // Windows && WinRT
31 static CharCP const DIR_SEPARATOR =
"\\";
32 static char const DIR_SEPARATOR_CHAR =
'\\';
33 static WCharCP const WCSDIR_SEPARATOR = L
"\\";
34 static WChar const WCSDIR_SEPARATOR_CHAR = L
'\\';
35 static char const ALT_DIR_SEPARATOR_CHAR =
'/';
36 static WChar const WCSALT_DIR_SEPARATOR_CHAR = L
'/';
37 static WCharCP const WCSALT_DIR_SEPARATOR = L
"/";
38 static CharCP const ALL_FILES_FILTER =
"*.*";
39 static WCharCP const WCSALL_FILES_FILTER = L
"*.*";
40 static WCharCP const WCSDLL_EXT = L
"dll";
41 static WCharCP const WCSSTLIB_EXT = L
"lib";
42 #elif defined (__APPLE__) || defined (ANDROID)
43 static CharCP const DIR_SEPARATOR =
"/";
44 static char const DIR_SEPARATOR_CHAR =
'/';
45 static WCharCP const WCSDIR_SEPARATOR = L
"/";
46 static WChar const WCSDIR_SEPARATOR_CHAR = L
'/';
47 static char const ALT_DIR_SEPARATOR_CHAR =
'\\';
48 static WChar const WCSALT_DIR_SEPARATOR_CHAR = L
'\\';
49 static WCharCP const WCSALT_DIR_SEPARATOR = L
"\\";
50 static CharCP const ALL_FILES_FILTER =
"*";
51 static WCharCP const WCSALL_FILES_FILTER = L
"*";
52 #if defined (__APPLE__)
53 static WCharCP const WCSDLL_EXT = L
"dylib";
55 static WCharCP const WCSDLL_EXT = L
"so";
57 static WCharCP const WCSSTLIB_EXT = L
"a";
59 #error unknown platform
61 static CharCP const PATH_SEPARATOR =
";";
62 static char const PATH_SEPARATOR_CHAR =
';';
64 static WCharCP const WCSPATH_SEPARATOR = L
";";
65 static WChar const WCSPATH_SEPARATOR_CHAR = L
';';
67 enum class BeFileNameStatus
80 enum class BeFileNameAccess
85 ReadWrite = BeFileNameAccess::Read|BeFileNameAccess::Write,
96 struct BeFileName : WString
107 explicit BeFileName (
WCharCP name) {SetName(name);}
117 enum FileNameParts {
Device=1, Directory=2, Basename=4, Extension=8, DevAndDir=(
Device|Directory), NameAndExt=(Basename|Extension),
All=(DevAndDir|NameAndExt) };
127 BeFileName (BeFileName
const& from) {*
this = from;}
138 void SetName (
WStringCR name) { assign (name); }
168 void AppendString (
WCharCP string) { append (
string); }
180 void StripWhiteSpace () { Trim (); }
202 explicit BeFileName (
Utf8StringCR name) {SetNameUtf8(name);}
205 void GetName (
WCharP name,
size_t size)
const { wcsncpy (name, c_str(), size-1); name[size-1] = 0; }
226 void SetNameUtf8 (
Utf8StringCR name) {SetNameUtf8 (name.c_str ());}
282 static WString GetFileNameAndExtension (
WCharCP path) {
return WString(BeFileName(NameAndExt, path));}
368 WCharCP GetName ()
const {
return c_str();}
370 operator WCharCP()
const {
return c_str();}
373 bool IsEmpty ()
const {
return empty(); }
376 size_t GetNameSize () {
return size(); }
462 BENTLEYDLL_EXPORT static BeFileNameStatus GetFileTime (::_FILETIME* ctime, ::_FILETIME* atime, ::_FILETIME* mtime,
WCharCP fileName);
469 BENTLEYDLL_EXPORT static BeFileNameStatus SetFileTime (
WCharCP fileName, ::_FILETIME
const* atime, ::_FILETIME
const* mtime);
506 BENTLEYDLL_EXPORT static BeFileNameStatus BeGetTempFileName (BeFileName& tempFileName, BeFileName
const& pathName,
WCharCP prefixString);
511 BENTLEYDLL_EXPORT static BeFileNameStatus BeGetTempPath (BeFileName& tempFileName);
char * CharP
Definition: Bentley.h:227
bool empty() const
Definition: stdcxx/bstdmap.h:210
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
struct Bentley::BeFileName const & BeFileNameCR
Definition: Bentley.h:242
Definition: Bentley.h:212
wchar_t * WCharP
Definition: Bentley.h:225
wchar_t WChar
Definition: Bentley.h:223
Definition: TextTableHandler.h:216
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
struct Bentley::Utf8String const & Utf8StringCR
Definition: Bentley.h:241
wchar_t const * WCharCP
Definition: Bentley.h:224
struct Bentley::WString * WStringP
Definition: Bentley.h:239
uint32_t UInt32
Definition: Bentley.r.h:128
struct Bentley::WString & WStringR
Definition: Bentley.h:239
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
Provides Bentley specific string utility functions (Bentley/BeStringUtilities.h). ...
BentleyStatus
Definition: Bentley.h:208
Open for both read and write.
BentleyCharEncoding
Definition: Bentley.h:216
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
uint64_t UInt64
Definition: Bentley.r.h:131
Utf8Char const * Utf8CP
Definition: Bentley.h:229
char const * CharCP
Definition: Bentley.h:226
struct Bentley::BeFileName & BeFileNameR
Definition: Bentley.h:242
Definition: Bentley.h:210
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
void clear()
Definition: stdcxx/bstdmap.h:257
size_type size() const
Definition: stdcxx/bstdmap.h:214