]> git.lyx.org Git - lyx.git/blob - src/support/lyxlib.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / support / lyxlib.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYX_LIB_H
13 #define LYX_LIB_H
14
15 #include "LString.h"
16
17 // Where can I put this?  I found the occurence of the same code
18 // three/four times. Don't you think it better to use a macro definition
19 // (an inlined member of some class)?
20
21 // Use a namespace if we can, a struct otherwise
22 #ifdef CXX_WORKING_NAMESPACES
23 #define OPT_STATIC
24 namespace lyx {
25 #else
26 #define OPT_STATIC static
27 struct lyx {
28 #endif  
29         ///
30         OPT_STATIC string const getcwd();
31         ///
32         OPT_STATIC int chdir(string const & name);
33         /// Returns false if it fails
34         OPT_STATIC bool rename(string const & from, string const & to);
35         /// Returns false it it fails
36         OPT_STATIC bool copy(string const & from, string const & to);
37         /// generates a checksum
38         OPT_STATIC unsigned long sum(string const & file);
39         /// returns a date string (not used currently)
40         OPT_STATIC char * date(); 
41         /// returns the name of the user (not used currently)
42         OPT_STATIC string const getUserName();
43         ///
44         OPT_STATIC int kill(int pid, int sig);
45         ///
46         OPT_STATIC void abort();
47         ///
48         OPT_STATIC int mkdir(string const & pathname, unsigned long int mode);
49         ///
50         OPT_STATIC int putenv(char const * str);
51         ///
52         OPT_STATIC int unlink(string const & file);
53         ///
54         OPT_STATIC int rmdir(string const & file);
55         ///
56         OPT_STATIC int atoi(string const & nstr);
57         ///
58         OPT_STATIC string const tempName(string const & dir = string(),
59                                          string const & mask = string());
60 #ifdef CXX_WORKING_NAMESPACES
61 }
62 #else
63 };
64 #endif
65
66 #undef OPT_STATIC
67         
68 #endif /* LYX_LIB_H */