STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Typedefs | Enumerations | Functions
tr2::sys Namespace Reference

Classes

struct  _Altslash
 
struct  _Altslash< path >
 
struct  _Altslash< wpath >
 
class  _Path_iterator
 
class  _Wrap_init_dir
 
class  basic_directory_entry
 
class  basic_directory_iterator
 
class  basic_filesystem_error
 
class  basic_path
 
class  basic_recursive_directory_iterator
 
struct  colon
 
struct  colon< path >
 
struct  colon< wpath >
 
struct  dot
 
struct  dot< path >
 
struct  dot< wpath >
 
class  file_status
 
struct  is_basic_path
 
struct  is_basic_path< path >
 
struct  is_basic_path< wpath >
 
struct  path_traits
 
struct  slash
 
struct  slash< path >
 
struct  slash< wpath >
 
struct  space_info
 
struct  wpath_traits
 

Typedefs

typedef basic_path< string, path_traitspath
 
typedef basic_path< wstring, wpath_traitswpath
 
typedef basic_filesystem_error< pathfilesystem_error
 
typedef basic_filesystem_error< wpathwfilesystem_error
 
typedef basic_directory_entry< pathdirectory_entry
 
typedef basic_directory_entry< wpathwdirectory_entry
 
typedef basic_directory_iterator< pathdirectory_iterator
 
typedef basic_directory_iterator< wpathwdirectory_iterator
 
typedef basic_recursive_directory_iterator< pathrecursive_directory_iterator
 
typedef basic_recursive_directory_iterator< wpathwrecursive_directory_iterator
 
typedef copy_option _Copy_option
 

Enumerations

enum  file_type {
  status_unknown, file_not_found, regular_file, directory_file,
  symlink_file, block_file, character_file, fifo_file,
  socket_file, type_unknown
}
 
enum  copy_option { copy_option::fail_if_exists, copy_option::overwrite_if_exists }
 

Functions

template<class _String , class _Traits >
void swap (basic_path< _String, _Traits > &_Left, basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
basic_path< _String, _Traits > operator/ (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator== (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator!= (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator< (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator> (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator<= (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
bool operator>= (const basic_path< _String, _Traits > &_Left, const basic_path< _String, _Traits > &_Right)
 
template<class _String , class _Traits >
basic_ostream< typename _String::value_type, typename _String::traits_type > & operator<< (basic_ostream< typename _String::value_type, typename _String::traits_type > &_Ostr, const basic_path< _String, _Traits > &_Pval)
 
template<class _String , class _Traits >
basic_istream< typename _String::value_type, typename _String::traits_type > & operator>> (basic_istream< typename _String::value_type, typename _String::traits_type > &_Istr, basic_path< _String, _Traits > &_Pval)
 
_FS_DLL void *__CLRCALL_PURE_OR_CDECL _Open_dir (char(&)[_MAX_FILESYS_NAME], const char *, int &, file_type &)
 
_FS_DLL char *__CLRCALL_PURE_OR_CDECL _Read_dir (char(&)[_MAX_FILESYS_NAME], void *, file_type &)
 
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Close_dir (void *)
 
_FS_DLL char *__CLRCALL_PURE_OR_CDECL _Current_get (char(&)[_MAX_FILESYS_NAME])
 
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set (const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir (const char *)
 
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir (const char *)
 
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat (const char *, int &)
 
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat (const char *, int &)
 
_FS_DLL _ULonglong __CLRCALL_PURE_OR_CDECL _File_size (const char *)
 
_FS_DLL time_t __CLRCALL_PURE_OR_CDECL _Last_write_time (const char *)
 
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Last_write_time (const char *, time_t)
 
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs (const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent (const char *, const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link (const char *, const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink (const char *, const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename (const char *, const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink (const char *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file (const char *, const char *, bool)
 
_FS_DLL void *__CLRCALL_PURE_OR_CDECL _Open_dir (wchar_t(&)[_MAX_FILESYS_NAME], const wchar_t *, int &, file_type &)
 
_FS_DLL wchar_t *__CLRCALL_PURE_OR_CDECL _Read_dir (wchar_t(&)[_MAX_FILESYS_NAME], void *, file_type &)
 
_FS_DLL wchar_t *__CLRCALL_PURE_OR_CDECL _Current_get (wchar_t(&)[_MAX_FILESYS_NAME])
 
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set (const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir (const wchar_t *)
 
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir (const wchar_t *)
 
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat (const wchar_t *, int &)
 
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat (const wchar_t *, int &)
 
_FS_DLL _ULonglong __CLRCALL_PURE_OR_CDECL _File_size (const wchar_t *)
 
_FS_DLL time_t __CLRCALL_PURE_OR_CDECL _Last_write_time (const wchar_t *)
 
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Last_write_time (const wchar_t *, time_t)
 
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs (const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent (const wchar_t *, const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link (const wchar_t *, const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink (const wchar_t *, const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename (const wchar_t *, const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink (const wchar_t *)
 
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file (const wchar_t *, const wchar_t *, bool)
 
template<class _Path , class _Prefix_directory >
bool operator== (const basic_directory_iterator< _Path, _Prefix_directory > &_Left, const basic_directory_iterator< _Path, _Prefix_directory > &_Right)
 
template<class _Path , class _Prefix_directory >
bool operator!= (const basic_directory_iterator< _Path, _Prefix_directory > &_Left, const basic_directory_iterator< _Path, _Prefix_directory > &_Right)
 
template<class _Path >
bool operator== (const basic_recursive_directory_iterator< _Path > &_Left, const basic_recursive_directory_iterator< _Path > &_Right)
 
template<class _Path >
bool operator!= (const basic_recursive_directory_iterator< _Path > &_Left, const basic_recursive_directory_iterator< _Path > &_Right)
 
template<class _Path >
file_status status (const _Path &_Pval)
 
template<class _Path >
file_status status (const _Path &_Pval, error_code &_Code)
 
template<class _Path >
file_status symlink_status (const _Path &_Pval)
 
template<class _Path >
file_status symlink_status (const _Path &_Pval, error_code &_Code)
 
bool status_known (file_status _Stat)
 
bool exists (file_status _Stat)
 
bool is_regular (file_status _Stat)
 
bool is_regular_file (file_status _Stat)
 
bool is_directory (file_status _Stat)
 
bool is_symlink (file_status _Stat)
 
bool is_other (file_status _Stat)
 
template<class _Path >
bool exists (const _Path &_Pval)
 
template<class _Path >
bool is_regular (const _Path &_Pval)
 
template<class _Path >
bool is_regular_file (const _Path &_Pval)
 
template<class _Path >
bool is_directory (const _Path &_Pval)
 
template<class _Path >
bool is_symlink (const _Path &_Pval)
 
template<class _Path >
bool is_other (const _Path &_Pval)
 
template<class _Path >
bool is_empty (const _Path &_Pval)
 
template<class _Path1 , class _Path2 >
bool equivalent (const _Path1 &_Pval1, const _Path2 &_Pval2)
 
template<class _Path >
_Path current_path ()
 
template<class _Path >
void current_path (const _Path &_Pval)
 
template<class _Path >
_Path initial_path ()
 
template<class _Path >
_ULonglong file_size (const _Path &_Pval)
 
template<class _Path >
space_info space (const _Path &_Pval)
 
template<class _Path >
time_t last_write_time (const _Path &_Pval)
 
template<class _Path >
void last_write_time (const _Path &_Pval, time_t _Newtime)
 
template<class _Path >
bool create_directory (const _Path &_Pval)
 
template<class _Path >
bool remove_directory (const _Path &_Pval)
 
template<class _Path1 , class _Path2 >
void create_hard_link (const _Path1 &_Oldpval, const _Path2 &_Newpval)
 
template<class _Path1 , class _Path2 >
error_code create_hard_link (const _Path1 &_Oldpval, const _Path2 &_Newpval, error_code &_Code)
 
template<class _Path1 , class _Path2 >
void create_symlink (const _Path1 &_Oldpval, const _Path2 &_Newpval)
 
template<class _Path1 , class _Path2 >
error_code create_symlink (const _Path1 &_Oldpval, const _Path2 &_Newpval, error_code &_Code)
 
template<class _Path >
bool remove (const _Path &_Pval)
 
template<class _Path >
bool remove_filename (const _Path &_Pval)
 
template<class _Path >
bool _Remove_all (const _Path &_Pval, unsigned long &_Ans)
 
template<class _Path >
unsigned long remove_all (const _Path &_Pval)
 
template<class _Path1 , class _Path2 >
bool rename (const _Path1 &_Oldpval, const _Path2 &_Newpval)
 
template<class _Path1 , class _Path2 >
void copy_file (const _Path1 &_Oldpval, const _Path2 &_Newpval, _Copy_option _Opt=copy_option::fail_if_exists)
 
template<class _Path >
_Path complete (const _Path &_Pval, const _Path &_Pbase=initial_path< _Path >())
 
template<class _Path >
_Path system_complete (const _Path &_Pval)
 
template<class _Path >
bool create_directories (const _Path &_Pval)
 
template<class _Path >
_Path::string_type extension (const _Path &_Pval)
 
template<class _Path >
_Path::string_type basename (const _Path &_Pval)
 
template<class _Path >
_Path::string_type stem (const _Path &_Pval)
 
template<class _Path >
_Path replace_extension (const _Path &_Pval, const typename _Path::string_type &_Newext)
 

Typedef Documentation

Enumeration Type Documentation

enum tr2::sys::copy_option
strong
Enumerator
fail_if_exists 
overwrite_if_exists 
Enumerator
status_unknown 
file_not_found 
regular_file 
directory_file 
symlink_file 
block_file 
character_file 
fifo_file 
socket_file 
type_unknown 
33  { // types of files
37  };
Definition: filesystem:35
Definition: filesystem:34
Definition: filesystem:35
Definition: filesystem:34
Definition: filesystem:35
Definition: filesystem:36
Definition: filesystem:36
Definition: filesystem:34
Definition: filesystem:35
Definition: filesystem:34

Function Documentation

_FS_DLL void __CLRCALL_PURE_OR_CDECL tr2::sys::_Close_dir ( void )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Copy_file ( const char *  ,
const char *  ,
bool   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Copy_file ( const wchar_t ,
const wchar_t ,
bool   
)
_FS_DLL char* __CLRCALL_PURE_OR_CDECL tr2::sys::_Current_get ( char(&)  [_MAX_FILESYS_NAME])
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL tr2::sys::_Current_get ( wchar_t(&)  [_MAX_FILESYS_NAME])
_FS_DLL bool __CLRCALL_PURE_OR_CDECL tr2::sys::_Current_set ( const char *  )
_FS_DLL bool __CLRCALL_PURE_OR_CDECL tr2::sys::_Current_set ( const wchar_t )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Equivalent ( const char *  ,
const char *   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Equivalent ( const wchar_t ,
const wchar_t  
)
_FS_DLL _ULonglong __CLRCALL_PURE_OR_CDECL tr2::sys::_File_size ( const char *  )
_FS_DLL _ULonglong __CLRCALL_PURE_OR_CDECL tr2::sys::_File_size ( const wchar_t )
_FS_DLL time_t __CLRCALL_PURE_OR_CDECL tr2::sys::_Last_write_time ( const char *  )
_FS_DLL void __CLRCALL_PURE_OR_CDECL tr2::sys::_Last_write_time ( const char *  ,
time_t   
)
_FS_DLL time_t __CLRCALL_PURE_OR_CDECL tr2::sys::_Last_write_time ( const wchar_t )
_FS_DLL void __CLRCALL_PURE_OR_CDECL tr2::sys::_Last_write_time ( const wchar_t ,
time_t   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Link ( const char *  ,
const char *   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Link ( const wchar_t ,
const wchar_t  
)
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL tr2::sys::_Lstat ( const char *  ,
int  
)
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL tr2::sys::_Lstat ( const wchar_t ,
int  
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Make_dir ( const char *  )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Make_dir ( const wchar_t )
_FS_DLL void* __CLRCALL_PURE_OR_CDECL tr2::sys::_Open_dir ( char(&)  [_MAX_FILESYS_NAME],
const char *  ,
int ,
file_type &   
)
_FS_DLL void* __CLRCALL_PURE_OR_CDECL tr2::sys::_Open_dir ( wchar_t(&)  [_MAX_FILESYS_NAME],
const wchar_t ,
int ,
file_type &   
)
_FS_DLL char* __CLRCALL_PURE_OR_CDECL tr2::sys::_Read_dir ( char(&)  [_MAX_FILESYS_NAME],
void ,
file_type &   
)
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL tr2::sys::_Read_dir ( wchar_t(&)  [_MAX_FILESYS_NAME],
void ,
file_type &   
)
template<class _Path >
bool tr2::sys::_Remove_all ( const _Path &  _Pval,
unsigned long &  _Ans 
)
inline
1870  { // recursively remove a file or directory, count removed files
1871  if (is_directory(_Pval))
1872  { // empty and remove a directory
1873  typedef basic_directory_iterator<_Path, false_type> _Myit;
1874  _Myit _Last;
1875 
1876  for (; ; )
1877  { // remove a directory entry
1878  _Myit _First(_Pval);
1879  if (_First == _Last)
1880  break;
1881  if (!_Remove_all(_Pval / _First->path(), _Ans))
1882  return (false);
1883  }
1884  return (remove_directory(_Pval));
1885  }
1886  else if (!remove(_Pval))
1887  return (false);
1888  else
1889  { // file remove succeeded, count it
1890  ++_Ans;
1891  return (true);
1892  }
1893  }
bool is_directory(const _Path &_Pval)
Definition: filesystem:1697
bool remove_directory(const _Path &_Pval)
Definition: filesystem:1809
bool _Remove_all(const _Path &_Pval, unsigned long &_Ans)
Definition: filesystem:1869
_FwdIt _Last
Definition: algorithm:1936
_FS_DLL bool __CLRCALL_PURE_OR_CDECL tr2::sys::_Remove_dir ( const char *  )
_FS_DLL bool __CLRCALL_PURE_OR_CDECL tr2::sys::_Remove_dir ( const wchar_t )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Rename ( const char *  ,
const char *   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Rename ( const wchar_t ,
const wchar_t  
)
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL tr2::sys::_Stat ( const char *  ,
int  
)
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL tr2::sys::_Stat ( const wchar_t ,
int  
)
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL tr2::sys::_Statvfs ( const char *  )
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL tr2::sys::_Statvfs ( const wchar_t )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Symlink ( const char *  ,
const char *   
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Symlink ( const wchar_t ,
const wchar_t  
)
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Unlink ( const char *  )
_FS_DLL int __CLRCALL_PURE_OR_CDECL tr2::sys::_Unlink ( const wchar_t )
template<class _Path >
_Path::string_type tr2::sys::basename ( const _Path &  _Pval)
inline
1985  { // pick off base name in leaf before dot
1986  return (_Pval.stem());
1987  }
template<class _Path >
_Path tr2::sys::complete ( const _Path &  _Pval,
const _Path &  _Pbase = initial_path<_Path>() 
)
inline
1939  { // complete _Pval with _Pbase
1940  if (!(_Pbase.is_complete()
1941  && (_Pval.is_complete() || !_Pval.has_root_name())))
1942  _THROW_NCEE(basic_filesystem_error<_Path>,
1943  "complete(p1, p2): invalid arguments");
1944  if (_Pval.has_root_name())
1945  return (_Pval);
1946  else if (_Pval.has_root_directory())
1947  return (_Path(_Pbase.root_name()) / _Pval);
1948  else
1949  return (_Pbase / _Pval);
1950  }
#define _THROW_NCEE(x, y)
Definition: xstddef:79
template<class _Path1 , class _Path2 >
void tr2::sys::copy_file ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval,
_Copy_option  _Opt = copy_option::fail_if_exists 
)
inline
1929  { // copy _Oldpval to _Newpval, with attributes
1930  if (_Copy_file(_Oldpval._Ptr(), _Newpval._Ptr(),
1931  (int)_Opt == (int)copy_option::fail_if_exists))
1932  _THROW_NCEE(basic_filesystem_error<_Path1>,
1933  "copy(p1, p2): invalid arguments");
1934  }
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
#define _THROW_NCEE(x, y)
Definition: xstddef:79
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t *, const wchar_t *, bool)
template<class _Path >
bool tr2::sys::create_directories ( const _Path &  _Pval)
inline
1961  { // create directory chain
1962  if (_Pval.empty())
1963  return (false);
1964  else if (!exists(_Pval))
1965  { // recursively create parent directories, then current
1966  create_directories(_Pval.branch_path());
1967  create_directory(_Pval);
1968  return (true);
1969  }
1970  else if (is_directory(_Pval))
1971  return (false); // directory already there
1972  else
1973  _THROW_NCEE(basic_filesystem_error<_Path>,
1974  "create_directories(p): bad argument");
1975  }
bool is_directory(const _Path &_Pval)
Definition: filesystem:1697
bool create_directory(const _Path &_Pval)
Definition: filesystem:1797
#define _THROW_NCEE(x, y)
Definition: xstddef:79
bool exists(const _Path &_Pval)
Definition: filesystem:1679
bool create_directories(const _Path &_Pval)
Definition: filesystem:1960
template<class _Path >
bool tr2::sys::create_directory ( const _Path &  _Pval)
inline
1798  { // create a directory
1799  int _Ans = _Make_dir(_Pval._Ptr());
1800 
1801  if (_Ans < 0)
1802  _THROW_NCEE(basic_filesystem_error<_Path>,
1803  "create_directory(p): invalid argument");
1804  else
1805  return (0 < _Ans);
1806  }
#define _THROW_NCEE(x, y)
Definition: xstddef:79
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Make_dir(const wchar_t *)
template<class _Path1 , class _Path2 >
void tr2::sys::create_hard_link ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval 
)
inline
1818  { // link _Newpval to _Oldpval
1819  if (_Link(_Oldpval._Ptr(), _Newpval._Ptr()) != 0)
1820  _THROW_NCEE(basic_filesystem_error<_Path1>,
1821  "create_hard_link(p1, p2): invalid arguments");
1822  }
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t *, const wchar_t *)
#define _THROW_NCEE(x, y)
Definition: xstddef:79
template<class _Path1 , class _Path2 >
error_code tr2::sys::create_hard_link ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval,
error_code _Code 
)
inline
1829  { // link _Newpval to _Oldpval
1830  int _Ans = _Link(_Oldpval._Ptr(), _Newpval._Ptr());
1831  _Code = error_code(_Ans, _STD system_category());
1832  return (_Code);
1833  }
const error_category & system_category() _NOEXCEPT
Definition: system_error:651
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Link(const wchar_t *, const wchar_t *)
Definition: system_error:195
template<class _Path1 , class _Path2 >
void tr2::sys::create_symlink ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval 
)
inline
1839  { // symlink _Newpval to _Oldpval
1840  if (_Symlink(_Oldpval._Ptr(), _Newpval._Ptr()) != 0)
1841  _THROW_NCEE(basic_filesystem_error<_Path1>,
1842  "create_symlink(p1, p2): invalid arguments");
1843  }
#define _THROW_NCEE(x, y)
Definition: xstddef:79
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t *, const wchar_t *)
template<class _Path1 , class _Path2 >
error_code tr2::sys::create_symlink ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval,
error_code _Code 
)
inline
1850  { // symlink _Newpval to _Oldpval
1851  int _Ans = _Symlink(_Oldpval._Ptr(), _Newpval._Ptr());
1852  _Code = error_code(_Ans, _STD system_category());
1853  return (_Code);
1854  }
const error_category & system_category() _NOEXCEPT
Definition: system_error:651
Definition: system_error:195
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Symlink(const wchar_t *, const wchar_t *)
template<class _Path >
_Path tr2::sys::current_path ( )
inline
1744  { // get current working directory
1745  typename _Path::value_type _Dest[_MAX_FILESYS_NAME];
1746  return (_Current_get(_Dest));
1747  }
#define _MAX_FILESYS_NAME
Definition: filesystem:998
_FS_DLL wchar_t *__CLRCALL_PURE_OR_CDECL _Current_get(wchar_t(&)[_MAX_FILESYS_NAME])
template<class _Path >
void tr2::sys::current_path ( const _Path &  _Pval)
inline
1751  { // set current working directory
1752  _Current_set(_Pval._Ptr());
1753  }
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Current_set(const wchar_t *)
template<class _Path1 , class _Path2 >
bool tr2::sys::equivalent ( const _Path1 &  _Pval1,
const _Path2 &  _Pval2 
)
inline
1732  { // test if paths designate same file
1733  int _Ans = _Equivalent(_Pval1._Ptr(), _Pval2._Ptr());
1734 
1735  if (_Ans < 0)
1736  _THROW_NCEE(basic_filesystem_error<_Path1>,
1737  "equivalent(p1, p2): invalid arguments");
1738  return (0 < _Ans);
1739  }
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Equivalent(const wchar_t *, const wchar_t *)
#define _THROW_NCEE(x, y)
Definition: xstddef:79
bool tr2::sys::exists ( file_status  _Stat)
inline
1648  { // test if file exists
1649  return (status_known(_Stat) && _Stat.type() != file_not_found);
1650  }
Definition: filesystem:34
bool status_known(file_status _Stat)
Definition: filesystem:1642
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::exists ( const _Path &  _Pval)
inline
1680  { // test if path exists
1681  return (exists(status(_Pval)));
1682  }
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
bool exists(const _Path &_Pval)
Definition: filesystem:1679
template<class _Path >
_Path::string_type tr2::sys::extension ( const _Path &  _Pval)
inline
1979  { // pick off .extension in leaf, including dot
1980  return (_Pval.extension());
1981  }
template<class _Path >
_ULonglong tr2::sys::file_size ( const _Path &  _Pval)
inline
1773  { // get file size
1774  return (_File_size(_Pval._Ptr()));
1775  }
_FS_DLL _ULonglong __CLRCALL_PURE_OR_CDECL _File_size(const wchar_t *)
template<class _Path >
_Path tr2::sys::initial_path ( )
inline
1767  { // get initial working directory
1768  return (_Wrap_init_dir<_Path>::_Mypath);
1769  }
bool tr2::sys::is_directory ( file_status  _Stat)
inline
1663  { // test for directory
1664  return (_Stat.type() == directory_file);
1665  }
Definition: filesystem:34
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::is_directory ( const _Path &  _Pval)
inline
1698  { // test if path is directory
1699  return (is_directory(status(_Pval)));
1700  }
bool is_directory(const _Path &_Pval)
Definition: filesystem:1697
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
template<class _Path >
bool tr2::sys::is_empty ( const _Path &  _Pval)
inline
1716  { // test if path is empty
1717  file_status _Stat = status(_Pval);
1718 
1719  if (!exists(_Stat))
1720  _THROW_NCEE(basic_filesystem_error<_Path>,
1721  "is_empty(p): invalid argument");
1722  else if (is_directory(_Stat))
1723  return (basic_directory_iterator<_Path>(_Pval)
1724  == basic_directory_iterator<_Path>());
1725  else
1726  return (file_size(_Pval) == 0);
1727  }
bool is_directory(const _Path &_Pval)
Definition: filesystem:1697
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
_ULonglong file_size(const _Path &_Pval)
Definition: filesystem:1772
#define _THROW_NCEE(x, y)
Definition: xstddef:79
bool exists(const _Path &_Pval)
Definition: filesystem:1679
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
bool tr2::sys::is_other ( file_status  _Stat)
inline
1673  { // test for other file types
1674  return (exists(_Stat)
1676  }
bool is_directory(const _Path &_Pval)
Definition: filesystem:1697
bool is_regular(const _Path &_Pval)
Definition: filesystem:1685
bool exists(const _Path &_Pval)
Definition: filesystem:1679
bool is_symlink(const _Path &_Pval)
Definition: filesystem:1703
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::is_other ( const _Path &  _Pval)
inline
1710  { // test if path is other file type
1711  return (is_other(status(_Pval)));
1712  }
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
bool is_other(const _Path &_Pval)
Definition: filesystem:1709
bool tr2::sys::is_regular ( file_status  _Stat)
inline
1653  { // test for regular file
1654  return (_Stat.type() == regular_file);
1655  }
Definition: filesystem:34
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::is_regular ( const _Path &  _Pval)
inline
1686  { // test if path is regular
1687  return (is_regular(status(_Pval)));
1688  }
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
bool is_regular(const _Path &_Pval)
Definition: filesystem:1685
bool tr2::sys::is_regular_file ( file_status  _Stat)
inline
1658  { // test for regular file
1659  return (is_regular(_Stat));
1660  }
bool is_regular(const _Path &_Pval)
Definition: filesystem:1685
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::is_regular_file ( const _Path &  _Pval)
inline
1692  { // test if path is regular
1693  return (is_regular(_Pval));
1694  }
bool is_regular(const _Path &_Pval)
Definition: filesystem:1685
bool tr2::sys::is_symlink ( file_status  _Stat)
inline
1668  { // test for symlink
1669  return (_Stat.type() == symlink_file);
1670  }
Definition: filesystem:35
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
bool tr2::sys::is_symlink ( const _Path &  _Pval)
inline
1704  { // test if path is symlink
1705  return (is_symlink(status(_Pval)));
1706  }
file_status status(const _Path &_Pval, error_code &_Code)
Definition: filesystem:1613
bool is_symlink(const _Path &_Pval)
Definition: filesystem:1703
template<class _Path >
time_t tr2::sys::last_write_time ( const _Path &  _Pval)
inline
1785  { // get last write time
1786  return (_Last_write_time(_Pval._Ptr()));
1787  }
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Last_write_time(const wchar_t *, time_t)
template<class _Path >
void tr2::sys::last_write_time ( const _Path &  _Pval,
time_t  _Newtime 
)
inline
1791  { // set last write time
1792  _Last_write_time(_Pval._Ptr(), _Newtime);
1793  }
_FS_DLL void __CLRCALL_PURE_OR_CDECL _Last_write_time(const wchar_t *, time_t)
template<class _String , class _Traits >
bool tr2::sys::operator!= ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
686  { // test for basic_path inequality
687  return (!(_Left == _Right));
688  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path , class _Prefix_directory >
bool tr2::sys::operator!= ( const basic_directory_iterator< _Path, _Prefix_directory > &  _Left,
const basic_directory_iterator< _Path, _Prefix_directory > &  _Right 
)
inline
1404  { // test for basic_directory_iterator inequality
1405  return (!(_Left == _Right));
1406  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
bool tr2::sys::operator!= ( const basic_recursive_directory_iterator< _Path > &  _Left,
const basic_recursive_directory_iterator< _Path > &  _Right 
)
inline
1593  { // test for basic_recursive_directory_iterator inequality
1594  return (!(_Left == _Right));
1595  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
basic_path<_String, _Traits> tr2::sys::operator/ ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
669  { // concatenate paths
670  basic_path<_String, _Traits> _Ans = _Left;
671  return (_Ans /= _Right);
672  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
bool tr2::sys::operator< ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
694  { // test if _Left < _Right
695  return (_Left.string() < _Right.string());
696  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
basic_ostream<typename _String::value_type, typename _String::traits_type>& tr2::sys::operator<< ( basic_ostream< typename _String::value_type, typename _String::traits_type > &  _Ostr,
const basic_path< _String, _Traits > &  _Pval 
)
inline
729  { // insert a basic_path
730  return (_Ostr << _Pval.string());
731  }
template<class _String , class _Traits >
bool tr2::sys::operator<= ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
710  { // test if _Left <= _Right
711  return (!(_Right < _Left));
712  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
bool tr2::sys::operator== ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
678  { // test for basic_path equality
679  return (_Left.string() == _Right.string());
680  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path , class _Prefix_directory >
bool tr2::sys::operator== ( const basic_directory_iterator< _Path, _Prefix_directory > &  _Left,
const basic_directory_iterator< _Path, _Prefix_directory > &  _Right 
)
inline
1395  { // test for basic_directory_iterator equality
1396  return (_Left._Equal(_Right));
1397  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
bool tr2::sys::operator== ( const basic_recursive_directory_iterator< _Path > &  _Left,
const basic_recursive_directory_iterator< _Path > &  _Right 
)
inline
1585  { // test for basic_recursive_directory_iterator equality
1586  return (_Left._Equal(_Right));
1587  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
bool tr2::sys::operator> ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
702  { // test if _Left > _Right
703  return (_Right < _Left);
704  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
bool tr2::sys::operator>= ( const basic_path< _String, _Traits > &  _Left,
const basic_path< _String, _Traits > &  _Right 
)
inline
718  { // test if _Left >= _Right
719  return (!(_Left < _Right));
720  }
const _Ty & _Right
Definition: algorithm:4087
template<class _String , class _Traits >
basic_istream<typename _String::value_type, typename _String::traits_type>& tr2::sys::operator>> ( basic_istream< typename _String::value_type, typename _String::traits_type > &  _Istr,
basic_path< _String, _Traits > &  _Pval 
)
inline
740  { // extract a basic_path
741  _String _Str;
742  _Istr >> _Str;
743  _Pval = _Str;
744  return (_Istr);
745  }
template<class _Path >
bool tr2::sys::remove ( const _Path &  _Pval)
inline
1858  { // remove _Pval
1859  return (_Unlink(_Pval._Ptr()) == 0);
1860  }
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t *)
template<class _Path >
unsigned long tr2::sys::remove_all ( const _Path &  _Pval)
inline
1897  { // recursively remove a directory
1898  unsigned long _Ans = 0;
1899 
1900  _Remove_all(_Pval, _Ans);
1901  return (_Ans);
1902  }
bool _Remove_all(const _Path &_Pval, unsigned long &_Ans)
Definition: filesystem:1869
template<class _Path >
bool tr2::sys::remove_directory ( const _Path &  _Pval)
inline
1810  { // remove a directory
1811  return (_Remove_dir(_Pval._Ptr()));
1812  }
_FS_DLL bool __CLRCALL_PURE_OR_CDECL _Remove_dir(const wchar_t *)
template<class _Path >
bool tr2::sys::remove_filename ( const _Path &  _Pval)
inline
1864  { // remove _Pval
1865  return (remove(_Pval));
1866  }
template<class _Path1 , class _Path2 >
bool tr2::sys::rename ( const _Path1 &  _Oldpval,
const _Path2 &  _Newpval 
)
inline
1908  { // rename _Oldpval as _Newpval
1909  if (exists(_Newpval) && !remove(_Newpval))
1910  return (false);
1911  else
1912  return (_Rename(_Oldpval._Ptr(), _Newpval._Ptr()) == 0);
1913  }
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Rename(const wchar_t *, const wchar_t *)
bool exists(const _Path &_Pval)
Definition: filesystem:1679
template<class _Path >
_Path tr2::sys::replace_extension ( const _Path &  _Pval,
const typename _Path::string_type &  _Newext 
)
inline
1998  { // replace extension with _Newext
1999  _Path _Ans = _Pval;
2000  return (_Ans.replace_extension(_Newext));
2001  }
template<class _Path >
space_info tr2::sys::space ( const _Path &  _Pval)
inline
1779  { // get space information for volume
1780  return (_Statvfs(_Pval._Ptr()));
1781  }
_FS_DLL space_info __CLRCALL_PURE_OR_CDECL _Statvfs(const wchar_t *)
template<class _Path >
file_status tr2::sys::status ( const _Path &  _Pval)
inline
1605  { // get file status
1606  int _Errno = 0;
1607  file_type _Ftype = _Stat(_Pval._Ptr(), _Errno);
1608 
1609  return (file_status(_Ftype));
1610  }
file_type
Definition: filesystem:33
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
template<class _Path >
file_status tr2::sys::status ( const _Path &  _Pval,
error_code _Code 
)
inline
1614  { // get file status
1615  int _Errno = 0;
1616  file_type _Ftype = _Stat(_Pval._Ptr(), _Errno);
1617 
1618  _Code = error_code(_Errno, _STD system_category());
1619  return (file_status(_Ftype));
1620  }
const error_category & system_category() _NOEXCEPT
Definition: system_error:651
file_type
Definition: filesystem:33
Definition: system_error:195
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
bool tr2::sys::status_known ( file_status  _Stat)
inline
1643  { // test if status known
1644  return (_Stat.type() != status_unknown);
1645  }
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Stat(const wchar_t *, int &)
Definition: filesystem:34
template<class _Path >
_Path::string_type tr2::sys::stem ( const _Path &  _Pval)
inline
1991  { // pick off base name in leaf before dot
1992  return (basename(_Pval));
1993  }
_Path::string_type basename(const _Path &_Pval)
Definition: filesystem:1984
template<class _String , class _Traits >
void tr2::sys::swap ( basic_path< _String, _Traits > &  _Left,
basic_path< _String, _Traits > &  _Right 
)
inline
660  { // swap two paths
661  _Left.swap(_Right);
662  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Path >
file_status tr2::sys::symlink_status ( const _Path &  _Pval)
inline
1624  { // get symlink file status
1625  int _Errno = 0;
1626  file_type _Ftype = _Lstat(_Pval._Ptr(), _Errno);
1627 
1628  return (file_status(_Ftype));
1629  }
file_type
Definition: filesystem:33
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat(const wchar_t *, int &)
template<class _Path >
file_status tr2::sys::symlink_status ( const _Path &  _Pval,
error_code _Code 
)
inline
1633  { // get symlink file status
1634  int _Errno = 0;
1635  file_type _Ftype = _Lstat(_Pval._Ptr(), _Errno);
1636 
1637  _Code = error_code(_Errno, _STD system_category());
1638  return (file_status(_Ftype));
1639  }
const error_category & system_category() _NOEXCEPT
Definition: system_error:651
file_type
Definition: filesystem:33
Definition: system_error:195
_FS_DLL file_type __CLRCALL_PURE_OR_CDECL _Lstat(const wchar_t *, int &)
template<class _Path >
_Path tr2::sys::system_complete ( const _Path &  _Pval)
inline
1954  { // complete _Pval
1955  return (_Pval.is_complete() ? _Pval : complete(_Pval,
1956  current_path<_Path>()));
1957  }
_Path complete(const _Path &_Pval, const _Path &_Pbase=initial_path< _Path >())
Definition: filesystem:1937