2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000-2001 The LyX Team.
9 * @author: Jürgen Vigna
11 * ======================================================
14 #ifndef TABULAR_FUNCS_H
15 #define TABULAR_FUNCS_H
26 // Perfect case for a template... (Lgb)
29 string const write_attribute(string const & name, T const & t)
34 string str = " " + name + "=\"" + tostr(t) + "\"";
38 string const write_attribute(string const & name, bool const & b);
40 string const write_attribute(string const & name, int const & b);
42 string const write_attribute(string const & name, LyXLength const & value);
43 string const tostr(LyXAlignment const & num);
44 string const tostr(LyXTabular::VAlignment const & num);
45 string const tostr(LyXTabular::BoxType const & num);
47 // I would have liked a fromstr template a lot better. (Lgb)
48 extern bool string2type(string const str, LyXAlignment & num);
49 extern bool string2type(string const str, LyXTabular::VAlignment & num);
50 extern bool string2type(string const str, LyXTabular::BoxType & num);
51 extern bool string2type(string const str, bool & num);
52 extern bool getTokenValue(string const & str, char const * token, string &ret);
53 extern bool getTokenValue(string const & str, char const * token, int & num);
54 extern bool getTokenValue(string const & str, char const * token,
56 extern bool getTokenValue(string const & str, char const * token,
57 LyXTabular::VAlignment & num);
58 extern bool getTokenValue(string const & str, char const * token,
59 LyXTabular::BoxType & num);
60 extern bool getTokenValue(string const & str, char const * token, bool & flag);
61 extern bool getTokenValue(string const & str, char const * token,
63 extern void l_getline(std::istream & is, string & str);