]> git.lyx.org Git - lyx.git/blob - src/support/lyxlib.h
small changes and two patches from Dekel
[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 // This should have been a namespace
22 #ifdef CXX_WORKING_NAMESPACES
23 ///
24 namespace lyx {
25         ///
26         char * getcwd(char * buffer, size_t size);
27         ///
28         int chdir(char const * name);
29         ///
30         int chdir(string const & name);
31         /// Returns false it it fails
32         bool rename(char const * from, char const * to);
33         /// Returns false if it fails
34         bool rename(string const & from, string const & to);
35         /// Returns false it it fails
36         bool copy(string const & from, string const & to);
37         /// generates a checksum
38         unsigned long sum(char const * file);
39         /// generates a checksum
40         unsigned long sum(string const & file);
41         /// returns a date string (not used currently)
42         char * date(); 
43         /// returns the name of the user (not used currently)
44         string const getUserName();
45         ///
46         int kill(int pid, int sig);
47         ///
48         void abort();
49         ///
50         int mkdir(string const & pathname, unsigned long int mode);
51         ///
52         int putenv(char const * str);
53         ///
54         int unlink(string const & file);
55         ///
56         int rmdir(string const & file);
57         ///
58         int atoi(string const & nstr);
59 }
60 #else
61 ///
62 struct lyx {
63         ///
64         static char * getcwd(char * buffer, size_t size);
65         ///
66         static int chdir(char const * name);
67         ///
68         static int chdir(string const & name);
69         /// Returns false it it fails
70         static bool rename(char const * from, char const * to);
71         /// Returns false if it fails
72         static bool rename(string const & from, string const & to);
73         /// Returns false it it fails
74         static bool copy(string const & from, string const & to);
75         /// generates a checksum
76         static unsigned long sum(char const * file);
77         /// generates a checksum
78         static unsigned long sum(string const & file);
79         /// returns a date string (not used currently)
80         static char * date(); 
81         /// returns the name of the user (not used currently)
82         static string const getUserName();
83         ///
84         static int kill(int pid, int sig);
85         ///
86         static void abort();
87         ///
88         static int mkdir(string const & pathname, unsigned long int mode);
89         ///
90         static int putenv(char const * str);
91         ///
92         static int unlink(string const & file);
93         ///
94         static int rmdir(string const & file);
95         ///
96         static int atoi(string const & nstr);
97 };
98 #endif // CXX_WORKING_NAMESPACES
99 #endif