]> git.lyx.org Git - lyx.git/blob - src/sgml.h
ff495d7882ea5ce99498a3b159ee813eafa91efa
[lyx.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
18 #include <iosfwd>
19 #include <string>
20 #include <utility>
21
22 class Buffer;
23 class Paragraph;
24
25 namespace sgml {
26
27 /**
28  * Escape the given character, if necessary,
29  * to an SGML entity. Returns true
30  * if it was a whitespace character.
31  */
32 std::pair<bool, std::string> escapeChar(char c);
33
34 /// Escape a word instead of a single character
35 std::string escapeString(std::string const & raw);
36
37 /// Opens tag
38 void openTag(std::ostream & os, std::string const & name,
39             std::string const & attribute = std::string());
40
41 /// Open tag
42 void openTag(Buffer const & buf, std::ostream & os, Paragraph const & par);
43
44 /// Close tag
45 void closeTag(std::ostream & os, std::string const & name);
46
47 /// Close tag
48 void closeTag(std::ostream & os, Paragraph const & par);
49 }
50 #endif // SGML_H