move_file.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/fs.h>
  5. #include<__vic/windows/wchar.h>
  6. #include<windows.h>
  7. namespace __vic {
  8. void move_file_(const wchar_t * , const wchar_t * , DWORD );
  9. //----------------------------------------------------------------------------
  10. void move_file(const wchar_t *src_path, const wchar_t *dest_path)
  11. {
  12. move_file_(src_path, dest_path, MOVEFILE_COPY_ALLOWED);
  13. }
  14. //----------------------------------------------------------------------------
  15. void move_file_replace(const wchar_t *src_path, const wchar_t *dest_path)
  16. {
  17. move_file_(src_path, dest_path,
  18. MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
  19. }
  20. //----------------------------------------------------------------------------
  21. void move_file(const char *src_path, const char *dest_path)
  22. {
  23. using windows::utf8to16;
  24. move_file(utf8to16(src_path), utf8to16(dest_path));
  25. }
  26. //----------------------------------------------------------------------------
  27. void move_file_replace(const char *src_path, const char *dest_path)
  28. {
  29. using windows::utf8to16;
  30. move_file_replace(utf8to16(src_path), utf8to16(dest_path));
  31. }
  32. //----------------------------------------------------------------------------
  33. } // namespace