Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sys.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SYS_H
3#define SEEN_SYS_H
4
5/*
6 * System abstraction utility routines
7 *
8 * WARNING:
9 * Most of these routines should not be used. Filenames should always
10 * be std::string, not utf8 encoded. Filenames should be converted
11 * to/from Glib::ustring when used in the GUI.
12 *
13 * Authors:
14 * Jon A. Cruz <jon@joncruz.org>
15 *
16 * Copyright (C) 2004-2005 Authors
17 *
18 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
19 */
20
21#include <cstdio>
22#include <string>
23
24#include <glib.h>
25#include <glibmm/ustring.h>
26
27/*#####################
28## U T I L I T Y
29#####################*/
30
31namespace Inkscape::IO {
32
33void dump_fopen_call( char const *utf8name, char const *id );
34
35FILE *fopen_utf8name( char const *utf8name, char const *mode );
36
37bool file_test( char const *utf8name, GFileTest test );
38
39bool file_is_writable( char const *utf8name);
40
41Glib::ustring sanitizeString(char const *str);
42
43Glib::ustring get_file_extension(Glib::ustring const &path);
44
45std::string get_file_extension(std::string const &path);
46void remove_file_extension(std::string &path);
47
48} // namespace Inkscape::IO
49
50#endif // SEEN_SYS_H
int test()
Definition 2junctions.cpp:5
Low-level IO code.
Glib::ustring get_file_extension(Glib::ustring const &path)
Definition sys.cpp:214
Glib::ustring sanitizeString(char const *str)
Definition sys.cpp:183
bool file_test(char const *utf8name, GFileTest test)
Definition sys.cpp:116
bool file_is_writable(char const *utf8name)
Definition sys.cpp:149
void remove_file_extension(std::string &path)
Removes a file extension, if found, from the given path.
Definition sys.cpp:233
void dump_fopen_call(char const *utf8name, char const *id)
Definition sys.cpp:37
FILE * fopen_utf8name(char const *utf8name, char const *mode)
Open a file with g_fopen().
Definition sys.cpp:72
int mode