GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lo-sysdep.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1996-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_lo_sysdep_h)
27 #define octave_lo_sysdep_h 1
28 
29 #include "octave-config.h"
30 
31 #include <fstream>
32 #include <string>
33 
34 #include <sys/types.h>
35 
36 #include "lo-ieee.h"
37 
38 class string_vector;
39 
41 
43 
44 extern OCTAVE_API int system (const std::string& cmd_str);
45 
46 extern OCTAVE_API std::string getcwd (void);
47 
48 extern OCTAVE_API int chdir (const std::string&);
49 
50 extern OCTAVE_API bool
51 get_dirlist (const std::string& dirname, string_vector& dirlist,
52  std::string& msg);
53 
54 extern OCTAVE_API std::FILE *
55 fopen (const std::string& name, const std::string& mode);
56 
57 extern OCTAVE_API std::FILE *
58 fopen_tmp (const std::string& name, const std::string& mode);
59 
61 fstream (const std::string& name,
62  const std::ios::openmode mode = std::ios::in | std::ios::out);
63 
65 ifstream (const std::string& name,
66  const std::ios::openmode mode = std::ios::in);
67 
69 ofstream (const std::string& name,
70  const std::ios::openmode mode = std::ios::out);
71 
72 extern OCTAVE_API void
73 putenv_wrapper (const std::string& name, const std::string& value);
74 
75 extern OCTAVE_API std::string getenv_wrapper (const std::string&);
76 
77 extern OCTAVE_API int unsetenv_wrapper (const std::string&);
78 
79 extern OCTAVE_API std::wstring u8_to_wstring (const std::string&);
80 
81 extern OCTAVE_API std::string u8_from_wstring (const std::wstring&);
82 
83 extern OCTAVE_API std::string
84 get_ASCII_filename (const std::string& long_file_name,
85  const bool allow_locale = false);
86 
89 
90 #endif
OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string dirname(const std::string &path)
Definition: file-ops.cc:360
OCTAVE_API std::FILE * fopen_tmp(const std::string &name, const std::string &mode)
Definition: lo-sysdep.cc:386
OCTAVE_API std::ifstream ifstream(const std::string &name, const std::ios::openmode mode=std::ios::in)
Definition: lo-sysdep.cc:424
OCTAVE_API std::string getcwd(void)
Definition: lo-sysdep.cc:71
OCTAVE_API std::string get_ASCII_filename(const std::string &long_file_name, const bool allow_locale=false)
Definition: lo-sysdep.cc:605
OCTAVE_API std::fstream fstream(const std::string &name, const std::ios::openmode mode=std::ios::in|std::ios::out)
Definition: lo-sysdep.cc:410
OCTAVE_API std::string u8_from_wstring(const std::wstring &)
Definition: lo-sysdep.cc:537
OCTAVE_API std::ofstream ofstream(const std::string &name, const std::ios::openmode mode=std::ios::out)
Definition: lo-sysdep.cc:438
OCTAVE_API bool get_dirlist(const std::string &dirname, string_vector &dirlist, std::string &msg)
Definition: lo-sysdep.cc:119
OCTAVE_API void putenv_wrapper(const std::string &name, const std::string &value)
Definition: lo-sysdep.cc:452
OCTAVE_API std::string getenv_wrapper(const std::string &)
Definition: lo-sysdep.cc:488
OCTAVE_API std::wstring u8_to_wstring(const std::string &)
Definition: lo-sysdep.cc:514
OCTAVE_API int chdir(const std::string &)
Definition: lo-sysdep.cc:106
OCTAVE_API int system(const std::string &cmd_str)
Definition: lo-sysdep.cc:59
OCTAVE_API int unsetenv_wrapper(const std::string &)
Definition: lo-sysdep.cc:501
OCTAVE_API std::FILE * fopen(const std::string &name, const std::string &mode)
Definition: lo-sysdep.cc:314
#define OCTAVE_API
Definition: main.in.cc:55