GNU Octave  9.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-2024 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 ();
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 bool
55 file_exists (const std::string& filename, bool is_dir = true);
56 
57 extern OCTAVE_API bool
58 file_exists (const std::string& filename, bool is_dir, std::string& msg);
59 
60 extern OCTAVE_API bool dir_exists (const std::string& dirname);
61 
62 extern OCTAVE_API bool
63 dir_exists (const std::string& dirname, std::string& msg);
64 
65 extern OCTAVE_API bool
66 same_file (const std::string& f, const std::string& g);
67 
68 extern OCTAVE_API std::FILE *
69 fopen (const std::string& name, const std::string& mode);
70 
71 extern OCTAVE_API std::FILE *
72 fopen_tmp (const std::string& name, const std::string& mode);
73 
75 fstream (const std::string& name,
76  const std::ios::openmode mode = std::ios::in | std::ios::out);
77 
79 ifstream (const std::string& name,
80  const std::ios::openmode mode = std::ios::in);
81 
83 ofstream (const std::string& name,
84  const std::ios::openmode mode = std::ios::out);
85 
86 extern OCTAVE_API void
87 putenv_wrapper (const std::string& name, const std::string& value);
88 
89 extern OCTAVE_API std::string getenv_wrapper (const std::string&);
90 
91 extern OCTAVE_API bool isenv_wrapper (const std::string&);
92 
93 extern OCTAVE_API int unsetenv_wrapper (const std::string&);
94 
95 extern OCTAVE_API std::wstring u8_to_wstring (const std::string&);
96 
97 extern OCTAVE_API std::string u8_from_wstring (const std::wstring&);
98 
99 extern OCTAVE_API std::string
100 get_ASCII_filename (const std::string& long_file_name,
101  const bool allow_locale = false);
102 
103 OCTAVE_END_NAMESPACE(sys)
104 OCTAVE_END_NAMESPACE(octave)
105 
106 #endif
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string dirname(const std::string &path)
F77_RET_T const F77_DBLE const F77_DBLE * f
std::ifstream ifstream(const std::string &name, const std::ios::openmode mode=std::ios::in)
Definition: lo-sysdep.cc:621
int system(const std::string &cmd_str)
Definition: lo-sysdep.cc:60
int chdir(const std::string &)
Definition: lo-sysdep.cc:107
bool isenv_wrapper(const std::string &)
Definition: lo-sysdep.cc:711
bool dir_exists(const std::string &dirname)
Definition: lo-sysdep.cc:389
bool file_exists(const std::string &filename, bool is_dir=true)
Definition: lo-sysdep.cc:341
std::string u8_from_wstring(const std::wstring &)
Definition: lo-sysdep.cc:746
std::ofstream ofstream(const std::string &name, const std::ios::openmode mode=std::ios::out)
Definition: lo-sysdep.cc:635
std::wstring u8_to_wstring(const std::string &)
Definition: lo-sysdep.cc:723
std::string getcwd()
Definition: lo-sysdep.cc:72
std::string get_ASCII_filename(const std::string &long_file_name, const bool allow_locale=false)
Definition: lo-sysdep.cc:814
void putenv_wrapper(const std::string &name, const std::string &value)
Definition: lo-sysdep.cc:649
bool get_dirlist(const std::string &dirname, string_vector &dirlist, std::string &msg)
Definition: lo-sysdep.cc:120
std::FILE * fopen(const std::string &name, const std::string &mode)
Definition: lo-sysdep.cc:511
int unsetenv_wrapper(const std::string &)
Definition: lo-sysdep.cc:698
std::fstream fstream(const std::string &name, const std::ios::openmode mode=std::ios::in|std::ios::out)
Definition: lo-sysdep.cc:607
std::string getenv_wrapper(const std::string &)
Definition: lo-sysdep.cc:685
std::FILE * fopen_tmp(const std::string &name, const std::string &mode)
Definition: lo-sysdep.cc:583
bool same_file(const std::string &f, const std::string &g)
Definition: lo-sysdep.cc:437
#define OCTAVE_API
Definition: main.cc:55