]> git.lyx.org Git - lyx.git/blob - src/support/os.h
tostr -> convert and some bformat work
[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  * wrap OS-specific stuff
12  */
13
14 #ifndef OS_H
15 #define OS_H
16
17 #include <string>
18
19
20 namespace lyx {
21 namespace support {
22 namespace os {
23
24 //
25 enum shell_type {
26         UNIX,   // Do we have to distinguish sh and csh?
27         CMD_EXE
28 };
29
30 // do some work just once
31 void init(int argc, char * argv[]);
32 // returns path of LyX binary
33 std::string const & binpath();
34 // returns name of LyX binary
35 std::string const & binname();
36 //
37 void setTmpDir(std::string const & p);
38 //
39 std::string const & getTmpDir();
40 // Returns the user's home directory ($HOME in the unix world).
41 std::string const & homepath();
42 // Returns the name of the NULL device (/dev/null, null).
43 std::string const & nulldev();
44 //
45 std::string current_root();
46 //
47 shell_type shell();
48 // DBCS aware!
49 std::string::size_type common_path(std::string const & p1, std::string const & p2);
50 // Converts a unix style path to host OS style.
51 std::string external_path(std::string const & p);
52 // Converts a host OS style path to unix style.
53 std::string internal_path(std::string const & p);
54 // is path absolute?
55 bool is_absolute_path(std::string const & p);
56 // returns a string suitable to be passed to popen when
57 // same for popen().
58         char const * popen_read_mode();
59 //
60 void warn(std::string const & mesg);
61
62 } // namespace os
63 } // namespace support
64 } // namespace lyx
65
66 #endif