]> git.lyx.org Git - features.git/blob - src/sgml.h
Output docbook as utf8. Probably quite a bit more work needed, but then help form...
[features.git] / src / sgml.h
1 // -*- C++ -*-
2 /**
3  * \file sgml.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author José Matos
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef SGML_H
14 #define SGML_H
15
16 #include "support/types.h"
17 #include "support/docstream.h"
18
19 #include <iosfwd>
20 #include <string>
21 #include <utility>
22
23 class Buffer;
24 class Paragraph;
25 class OutputParams;
26
27 namespace sgml {
28
29 /**
30  * Escape the given character, if necessary,
31  * to an SGML entity. Returns true
32  * if it was a whitespace character.
33  */
34 std::pair<bool, std::string> escapeChar(char c);
35
36 /// Escape a word instead of a single character
37 std::string escapeString(std::string const & raw);
38
39 /// replaces illegal characters from SGML/XML ID attributes
40 std::string cleanID(Buffer const & buf, OutputParams const & runparams,
41                     std::string const & orig);
42
43 /// returns a unique numeric id
44 std::string const uniqueID(std::string const label);
45
46 /// Opens tag
47 void openTag(lyx::odocstream & os, std::string const & name,
48             std::string const & attribute = std::string());
49
50 /// Open tag
51 void openTag(Buffer const & buf, lyx::odocstream & os,
52              OutputParams const & runparams, Paragraph const & par);
53
54 /// Close tag
55 void closeTag(lyx::odocstream & os, std::string const & name);
56
57 /// Close tag
58 void closeTag(lyx::odocstream & os, Paragraph const & par);
59 }
60 #endif // SGML_H