cstdio.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Copyright (c) 2012 Artyom Beilis (Tonkikh)
  3. // Copyright (c) 2020 Alexander Grund
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // https://www.boost.org/LICENSE_1_0.txt
  7. #ifndef BOOST_NOWIDE_CSTDIO_HPP_INCLUDED
  8. #define BOOST_NOWIDE_CSTDIO_HPP_INCLUDED
  9. #include <boost/nowide/config.hpp>
  10. #include <cstdio>
  11. namespace boost {
  12. namespace nowide {
  13. #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
  14. using std::fopen;
  15. using std::freopen;
  16. using std::remove;
  17. using std::rename;
  18. #else
  19. ///
  20. /// \brief Same as freopen but file_name and mode are UTF-8 strings
  21. ///
  22. BOOST_NOWIDE_DECL FILE* freopen(const char* file_name, const char* mode, FILE* stream);
  23. ///
  24. /// \brief Same as fopen but file_name and mode are UTF-8 strings
  25. ///
  26. BOOST_NOWIDE_DECL FILE* fopen(const char* file_name, const char* mode);
  27. ///
  28. /// \brief Same as rename but old_name and new_name are UTF-8 strings
  29. ///
  30. BOOST_NOWIDE_DECL int rename(const char* old_name, const char* new_name);
  31. ///
  32. /// \brief Same as rename but name is UTF-8 string
  33. ///
  34. BOOST_NOWIDE_DECL int remove(const char* name);
  35. #endif
  36. namespace detail {
  37. BOOST_NOWIDE_DECL FILE* wfopen(const wchar_t* filename, const wchar_t* mode);
  38. }
  39. } // namespace nowide
  40. } // namespace boost
  41. #endif