]> git.lyx.org Git - features.git/blob - src/sgml.h
move everything into namespace lyx
[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
24 namespace lyx {
25
26 class Buffer;
27 class Paragraph;
28 class OutputParams;
29
30 namespace sgml {
31
32 /**
33  * Escape the given character, if necessary,
34  * to an SGML entity. Returns true
35  * if it was a whitespace character.
36  */
37 std::pair<bool, std::string> escapeChar(char c);
38
39 /// Escape a word instead of a single character
40 std::string escapeString(std::string const & raw);
41
42 /// replaces illegal characters from SGML/XML ID attributes
43 std::string cleanID(Buffer const & buf, OutputParams const & runparams,
44                     std::string const & orig);
45
46 /// returns a unique numeric id
47 std::string const uniqueID(std::string const label);
48
49 /// Opens tag
50 void openTag(odocstream & os, std::string const & name,
51             std::string const & attribute = std::string());
52
53 /// Open tag
54 void openTag(Buffer const & buf, odocstream & os,
55              OutputParams const & runparams, Paragraph const & par);
56
57 /// Close tag
58 void closeTag(odocstream & os, std::string const & name);
59
60 /// Close tag
61 void closeTag(odocstream & os, Paragraph const & par);
62
63
64 } // namespace lyx
65 }
66 #endif // SGML_H