]> git.lyx.org Git - lyx.git/blob - src/support/os.h
06f7a051c723b98663f3bb055e63e81842b1a455
[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 lyx {
19 namespace support {
20 namespace os {
21
22 //
23 enum shell_type {
24         UNIX,   // Do we have to distinguish sh and csh?
25         CMD_EXE
26 };
27
28 // do some work just once
29 void init(int * argc, char ** argv[]);
30 // returns path of LyX binary
31 string binpath();
32 // returns name of LyX binary
33 string binname();
34 //
35 void setTmpDir(string const & p);
36 //
37 string getTmpDir();
38 //
39 string current_root();
40 //
41 shell_type shell();
42 // DBCS aware!
43 string::size_type common_path(string const & p1, string const & p2);
44 // no-op on UNIX, '\\'->'/' on OS/2 and Win32, ':'->'/' on MacOS, etc.
45 string slashify_path(string const & p);
46 // converts a host OS path to unix style
47 string external_path(string const & p);
48 // converts a unix path to host OS style
49 string internal_path(string const & p);
50 // is path absolute?
51 bool is_absolute_path(string const & p);
52 // returns a string suitable to be passed to popen when
53 // same for popen().
54         char const * popen_read_mode();
55 //
56 void warn(string const & mesg);
57
58 } // namespace os
59 } // namespace support
60 } // namespace lyx
61
62 #endif