lyx_mirror/src/tabular_funcs.h
Lars Gullik Bjønnes b922cdd796 2001-12-28 Lars Gullik Bj�nnes <larsbj@birdstep.com>
* Makefile.am: added the new files to sources, removed layout.C

* layout.C: removed file

* layout.h: remove LYX_DUMMY_LAYOUT

* lyxtextclasslist.C (NumberOfLayout): do not special case dummy
layout.

* lyxlayout.[Ch]:
* lyxtextclass.[Ch]:
* lyxtextclasslist.[Ch]: new files

* include order changes to a lot of files, also changes because of
the six new files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3269 a592a061-630c-0410-9148-cb99ea01b6c8
2001-12-28 13:26:54 +00:00

61 lines
2.0 KiB
C++

// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 2000-2001 The LyX Team.
*
* @author: Jürgen Vigna
*
* ======================================================
*/
#ifndef TABULAR_FUNCS_H
#define TABULAR_FUNCS_H
#ifdef __GNUG__
#pragma interface
#endif
#include "LString.h"
#include "tabular.h"
#include <iosfwd>
// Perfect case for a template... (Lgb)
// or perhaps not...
template<class T>
string const write_attribute(string const & name, T const & t)
{
string str = " " + name + "=\"" + tostr(t) + "\"";
return str;
}
template<>
string const write_attribute(string const & name, bool const & b);
template<>
string const write_attribute(string const & name, LyXLength const & value);
string const tostr(LyXAlignment const & num);
string const tostr(LyXTabular::VAlignment const & num);
string const tostr(LyXTabular::BoxType const & num);
// I would have liked a fromstr template a lot better. (Lgb)
extern bool string2type(string const str, LyXAlignment & num);
extern bool string2type(string const str, LyXTabular::VAlignment & num);
extern bool string2type(string const str, LyXTabular::BoxType & num);
extern bool string2type(string const str, bool & num);
extern bool getTokenValue(string const & str, char const * token, string &ret);
extern bool getTokenValue(string const & str, char const * token, int & num);
extern bool getTokenValue(string const & str, char const * token,
LyXAlignment & num);
extern bool getTokenValue(string const & str, char const * token,
LyXTabular::VAlignment & num);
extern bool getTokenValue(string const & str, char const * token,
LyXTabular::BoxType & num);
extern bool getTokenValue(string const & str, char const * token, bool & flag);
extern bool getTokenValue(string const & str, char const * token,
LyXLength & len);
extern void l_getline(std::istream & is, string & str);
#endif