Consider the case where there is not any layout name.
[lyx.git] / src / sgml.h
blobdfb3c65660700ad1668699ceddb2bb017dd1e217
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.
7 * \author José Matos
8 * \author John Levon
10 * Full author contact details are available in file CREDITS.
13 #ifndef SGML_H
14 #define SGML_H
16 #include "support/types.h"
18 #include <iosfwd>
19 #include <string>
20 #include <utility>
22 class Buffer;
23 class Paragraph;
24 class OutputParams;
26 namespace sgml {
28 /**
29 * Escape the given character, if necessary,
30 * to an SGML entity. Returns true
31 * if it was a whitespace character.
33 std::pair<bool, std::string> escapeChar(char c);
35 /// Escape a word instead of a single character
36 std::string escapeString(std::string const & raw);
38 /// replaces illegal characters from SGML/XML ID attributes
39 std::string cleanID(Buffer const & buf, OutputParams const & runparams,
40 std::string const & orig);
42 /// returns a unique numeric id
43 std::string const uniqueID(std::string const label);
45 /// Opens tag
46 void openTag(std::ostream & os, std::string const & name,
47 std::string const & attribute = std::string());
49 /// Open tag
50 void openTag(Buffer const & buf, std::ostream & os,
51 OutputParams const & runparams, Paragraph const & par);
53 /// Close tag
54 void closeTag(std::ostream & os, std::string const & name);
56 /// Close tag
57 void closeTag(std::ostream & os, Paragraph const & par);
59 #endif // SGML_H