GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
lo-sysdep.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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
38class string_vector;
39
41
43
44extern OCTAVE_API int system (const std::string& cmd_str);
45
46extern OCTAVE_API std::string getcwd ();
47
48extern OCTAVE_API int chdir (const std::string&);
49
50extern OCTAVE_API bool
51get_dirlist (const std::string& dirname, string_vector& dirlist,
52 std::string& msg);
53
54extern OCTAVE_API bool
55file_exists (const std::string& filename, bool is_dir = true);
56
57extern OCTAVE_API bool
58file_exists (const std::string& filename, bool is_dir, std::string& msg);
59
60extern OCTAVE_API bool dir_exists (const std::string& dirname);
61
62extern OCTAVE_API bool
63dir_exists (const std::string& dirname, std::string& msg);
64
65extern OCTAVE_API bool
66same_file (const std::string& f, const std::string& g);
67
68extern OCTAVE_API std::FILE *
69fopen (const std::string& name, const std::string& mode);
70
71extern OCTAVE_API std::FILE *
72fopen_tmp (const std::string& name, const std::string& mode);
73
74extern OCTAVE_API std::fstream
75fstream (const std::string& name,
76 const std::ios::openmode mode = std::ios::in | std::ios::out);
77
78extern OCTAVE_API std::ifstream
79ifstream (const std::string& name,
80 const std::ios::openmode mode = std::ios::in);
81
82extern OCTAVE_API std::ofstream
83ofstream (const std::string& name,
84 const std::ios::openmode mode = std::ios::out);
85
86extern OCTAVE_API void
87putenv_wrapper (const std::string& name, const std::string& value);
88
89extern OCTAVE_API std::string getenv_wrapper (const std::string&);
90
91extern OCTAVE_API bool isenv_wrapper (const std::string&);
92
93extern OCTAVE_API int unsetenv_wrapper (const std::string&);
94
95extern OCTAVE_API std::wstring u8_to_wstring (const std::string&);
96
97extern OCTAVE_API std::string u8_from_wstring (const std::wstring&);
98
99extern OCTAVE_API std::string
100get_ASCII_filename (const std::string& long_file_name,
101 const bool allow_locale = false);
102
103OCTAVE_END_NAMESPACE(sys)
104OCTAVE_END_NAMESPACE(octave)
105
106#endif
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string dirname(const std::string &path)
Definition file-ops.cc:369
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::FILE * fopen_tmp(const std::string &name, const std::string &mode)
Definition lo-sysdep.cc:583
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::FILE * fopen(const std::string &name, const std::string &mode)
Definition lo-sysdep.cc:511
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
int unsetenv_wrapper(const std::string &)
Definition lo-sysdep.cc:698
std::string getenv_wrapper(const std::string &)
Definition lo-sysdep.cc:685
bool same_file(const std::string &f, const std::string &g)
Definition lo-sysdep.cc:437
#define OCTAVE_API
Definition main.in.cc:55