X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsgml.h;h=ed0f1403a5475d9f59c01869a9ffe790cd204702;hb=af92f60df99994db9f88663a62fa276022b3b2b2;hp=e3040e57eaddcf02045c533282d3ee307c9a2fb4;hpb=0b95bed2953cf7d9dcdf950851fea08a12f21af6;p=lyx.git diff --git a/src/sgml.h b/src/sgml.h index e3040e57ea..ed0f1403a5 100644 --- a/src/sgml.h +++ b/src/sgml.h @@ -1,30 +1,60 @@ +// -*- C++ -*- /** * \file sgml.h - * Copyright 2002 the LyX Team - * Read the file COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * \author José Matos - * \author John Levon + * \author José Matos + * \author John Levon + * + * Full author contact details are available in file CREDITS. */ #ifndef SGML_H #define SGML_H - -#include -#include "LString.h" - -#include - +#include "support/types.h" +#include "support/docstring.h" + +namespace lyx { + +class Buffer; +class Paragraph; +class OutputParams; + namespace sgml { /** - * Escape the given character if necessary - * to an SGML entity. The bool return is true - * if it was a whitespace character. + * Escape the given character, if necessary, + * to an SGML entity. */ -std::pair escapeChar(char c); +docstring escapeChar(char_type c); + +/// Escape a word instead of a single character +docstring escapeString(docstring const & raw); + +/// replaces illegal characters from SGML/XML ID attributes +docstring cleanID(Buffer const & buf, OutputParams const & runparams, + docstring const & orig); + +/// returns a unique numeric id +docstring const uniqueID(docstring const label); + +/// Opens tag +void openTag(odocstream & os, std::string const & name, + std::string const & attribute = std::string()); + +/// Open tag +void openTag(Buffer const & buf, odocstream & os, + OutputParams const & runparams, Paragraph const & par); + +/// Close tag +void closeTag(odocstream & os, std::string const & name); + +/// Close tag +void closeTag(odocstream & os, Paragraph const & par); -} +} // namespace sgml +} // namespace lyx #endif // SGML_H