cstdio.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. (See
  6. // accompanying file LICENSE or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. #ifndef BOOST_NOWIDE_CSTDIO_HPP_INCLUDED
  10. #define BOOST_NOWIDE_CSTDIO_HPP_INCLUDED
  11. #include <boost/nowide/config.hpp>
  12. #include <cstdio>
  13. namespace boost {
  14. namespace nowide {
  15. #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
  16. using std::fopen;
  17. using std::freopen;
  18. using std::remove;
  19. using std::rename;
  20. #else
  21. ///
  22. /// \brief Same as freopen but file_name and mode are UTF-8 strings
  23. ///
  24. BOOST_NOWIDE_DECL FILE* freopen(const char* file_name, const char* mode, FILE* stream);
  25. ///
  26. /// \brief Same as fopen but file_name and mode are UTF-8 strings
  27. ///
  28. BOOST_NOWIDE_DECL FILE* fopen(const char* file_name, const char* mode);
  29. ///
  30. /// \brief Same as rename but old_name and new_name are UTF-8 strings
  31. ///
  32. BOOST_NOWIDE_DECL int rename(const char* old_name, const char* new_name);
  33. ///
  34. /// \brief Same as rename but name is UTF-8 string
  35. ///
  36. BOOST_NOWIDE_DECL int remove(const char* name);
  37. #endif
  38. namespace detail {
  39. BOOST_NOWIDE_DECL FILE* wfopen(const wchar_t* filename, const wchar_t* mode);
  40. }
  41. } // namespace nowide
  42. } // namespace boost
  43. #endif