1 // $Id: unix_system.hxx,v 1.8 2003/07/24 12:22:49 grumbel Exp $
3 // Construo - A wire-frame construction game
4 // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef HEADER_CONSTRUO_UNIX_SYSTEM_HXX
21 #define HEADER_CONSTRUO_UNIX_SYSTEM_HXX
24 #include "system_context.hxx"
26 /** This class wraps a bunch of unix functions to provide file-io and
28 class UnixSystem
: public SystemContext
31 unsigned int start_time
;
33 /** The location of the users construo directory, aka ~/.construo/,
34 the name contains a trailing slash */
35 std::string construo_rc_path
;
39 virtual ~UnixSystem ();
40 unsigned int get_time ();
41 void sleep (unsigned long);
42 std::string
get_construo_rc_path();
43 std::string
get_user_realname();
44 std::string
get_user_email();
46 FILE* open_input_file(const std::string
& filename
);
47 FILE* open_output_file(const std::string
& filename
);
49 unsigned int get_mtime (const std::string
& filename
);
51 FileType
get_file_type(const std::string
& filename
);
52 std::vector
<std::string
> read_directory(const std::string
& pathname
);
54 std::string
translate_filename (const std::string
&);