]> git.lyx.org Git - lyx.git/blob - src/tabular_funcs.h
d231e5592c1c04a694f1c9fc9c49578ac4841ab2
[lyx.git] / src / tabular_funcs.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 2000-2001 The LyX Team.
8  *
9  *           @author: Jürgen Vigna
10  *
11  * ====================================================== 
12  */
13
14 #ifndef TABULAR_FUNCS_H
15 #define TABULAR_FUNCS_H
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "LString.h"
22 #include "layout.h"
23 #include "tabular.h"
24
25
26 // Perfect case for a template... (Lgb)
27 // or perhaps not...
28 template<class T>
29 string const write_attribute(string const & name, T const & t);
30 template<>
31 string const write_attribute(string const & name, bool const & b);
32 template<>
33 string const write_attribute(string const & name, LyXLength const & value);
34 string const tostr(LyXAlignment const & num);
35 string const tostr(LyXTabular::VAlignment const & num);
36 string const tostr(LyXTabular::BoxType const & num);
37
38 // I would have liked a fromstr template a lot better. (Lgb)
39 extern bool string2type(string const str, LyXAlignment & num);
40 extern bool string2type(string const str, LyXTabular::VAlignment & num);
41 extern bool string2type(string const str, LyXTabular::BoxType & num);
42 extern bool string2type(string const str, bool & num);
43 extern bool getTokenValue(string const & str, const char * token, string &ret);
44 extern bool getTokenValue(string const & str, const char * token, int & num);
45 extern bool getTokenValue(string const & str, const char * token,
46                           LyXAlignment & num);
47 extern bool getTokenValue(string const & str, const char * token,
48                           LyXTabular::VAlignment & num);
49 extern bool getTokenValue(string const & str, const char * token,
50                           LyXTabular::BoxType & num);
51 extern bool getTokenValue(string const & str, const char * token, bool & flag);
52 extern bool getTokenValue(string const & str, const char * token,
53                           LyXLength & len);
54 extern void l_getline(istream & is, string & str);
55
56 #endif