]> git.lyx.org Git - lyx.git/blob - src/support/os.h
6edc51178644e2b4a121d80a2b3b4b66dbafcfd7
[lyx.git] / src / support / os.h
1 // -*- C++ -*-
2 /**
3  * \file os.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Ruurd A. Reitsma
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef OS_H
13 #define OS_H
14
15 #include "LString.h"
16
17 /// wrap OS specific stuff
18 namespace os {
19         //
20         enum shell_type {
21                 UNIX,   // Do we have to distinguish sh and csh?
22                 CMD_EXE
23         };
24
25         // do some work just once
26         void init(int * argc, char ** argv[]);
27         // returns path of LyX binary
28         string binpath();
29         // returns name of LyX binary
30         string binname();
31         // system_tempdir actually doesn't belong here
32         // I put it here only to avoid a global variable.
33         void setTmpDir(string const & p);
34         // 
35         string getTmpDir();
36         //
37         string current_root();
38         //
39         shell_type shell();
40         // DBCS aware!
41         string::size_type common_path(string const & p1, string const & p2);
42         // no-op on UNIX, '\\'->'/' on OS/2 and Win32, ':'->'/' on MacOS, etc.
43         string slashify_path(string const & p);
44         // converts a host OS path to unix style
45         string external_path(string const & p);
46         // converts a unix path to host OS style
47         string internal_path(string const & p);
48         // is path absolute?
49         bool is_absolute_path(string const & p);
50         // returns a string suitable to be passed to popen when
51         // same for popen().
52         char const * popen_read_mode();
53         //
54         void warn(string const & mesg);
55 }
56
57 #endif