• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
12 #include <boost/nowide/config.hpp>
13 #include <cstdio>
14 
15 namespace boost {
16 namespace nowide {
17 #if !defined(BOOST_WINDOWS) && !defined(BOOST_NOWIDE_DOXYGEN)
18     using std::fopen;
19     using std::freopen;
20     using std::remove;
21     using std::rename;
22 #else
23 
24     ///
25     /// \brief Same as freopen but file_name and mode are UTF-8 strings
26     ///
27     BOOST_NOWIDE_DECL FILE* freopen(const char* file_name, const char* mode, FILE* stream);
28     ///
29     /// \brief Same as fopen but file_name and mode are UTF-8 strings
30     ///
31     BOOST_NOWIDE_DECL FILE* fopen(const char* file_name, const char* mode);
32     ///
33     /// \brief Same as rename but old_name and new_name are UTF-8 strings
34     ///
35     BOOST_NOWIDE_DECL int rename(const char* old_name, const char* new_name);
36     ///
37     /// \brief Same as rename but name is UTF-8 string
38     ///
39     BOOST_NOWIDE_DECL int remove(const char* name);
40 #endif
41     namespace detail {
42         BOOST_NOWIDE_DECL FILE* wfopen(const wchar_t* filename, const wchar_t* mode);
43     }
44 } // namespace nowide
45 } // namespace boost
46 
47 #endif
48