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