2003-08-23 00:17:00 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-08-09 00:42:12 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file sgml.h
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-09 00:42:12 +00:00
|
|
|
|
*
|
|
|
|
|
* \author Jos<EFBFBD> Matos
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-08-09 00:42:12 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef SGML_H
|
|
|
|
|
#define SGML_H
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2003-09-06 17:23:08 +00:00
|
|
|
|
#include "support/types.h"
|
2006-10-19 21:00:33 +00:00
|
|
|
|
#include "support/docstream.h"
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2002-10-21 16:21:56 +00:00
|
|
|
|
#include <iosfwd>
|
2004-10-25 08:14:48 +00:00
|
|
|
|
#include <string>
|
2003-09-07 21:25:37 +00:00
|
|
|
|
#include <utility>
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2004-10-24 20:55:22 +00:00
|
|
|
|
class Buffer;
|
2004-10-28 13:07:45 +00:00
|
|
|
|
class Paragraph;
|
2004-11-02 11:25:20 +00:00
|
|
|
|
class OutputParams;
|
2004-10-24 20:55:22 +00:00
|
|
|
|
|
2002-08-09 00:42:12 +00:00
|
|
|
|
namespace sgml {
|
|
|
|
|
|
|
|
|
|
/**
|
2004-10-24 20:55:22 +00:00
|
|
|
|
* Escape the given character, if necessary,
|
2006-10-21 11:38:43 +00:00
|
|
|
|
* to an SGML entity.
|
2002-08-09 00:42:12 +00:00
|
|
|
|
*/
|
2006-10-21 11:38:43 +00:00
|
|
|
|
docstring escapeChar(char_type c);
|
2002-08-09 00:42:12 +00:00
|
|
|
|
|
2004-10-25 00:26:05 +00:00
|
|
|
|
/// Escape a word instead of a single character
|
2006-10-21 11:38:43 +00:00
|
|
|
|
docstring escapeString(docstring const & raw);
|
2004-10-25 00:26:05 +00:00
|
|
|
|
|
2004-11-02 11:25:20 +00:00
|
|
|
|
/// replaces illegal characters from SGML/XML ID attributes
|
2006-10-22 11:00:04 +00:00
|
|
|
|
docstring cleanID(Buffer const & buf, OutputParams const & runparams,
|
|
|
|
|
docstring const & orig);
|
2004-10-29 23:08:04 +00:00
|
|
|
|
|
2004-11-02 11:25:20 +00:00
|
|
|
|
/// returns a unique numeric id
|
2006-10-22 11:00:04 +00:00
|
|
|
|
docstring const uniqueID(docstring const label);
|
2004-10-29 23:08:04 +00:00
|
|
|
|
|
2004-10-24 20:55:22 +00:00
|
|
|
|
/// Opens tag
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void openTag(odocstream & os, std::string const & name,
|
2004-10-28 13:07:45 +00:00
|
|
|
|
std::string const & attribute = std::string());
|
|
|
|
|
|
|
|
|
|
/// Open tag
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void openTag(Buffer const & buf, odocstream & os,
|
2004-11-02 11:25:20 +00:00
|
|
|
|
OutputParams const & runparams, Paragraph const & par);
|
2002-10-21 16:21:56 +00:00
|
|
|
|
|
2004-10-24 20:55:22 +00:00
|
|
|
|
/// Close tag
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void closeTag(odocstream & os, std::string const & name);
|
2003-10-29 13:48:21 +00:00
|
|
|
|
|
2004-10-28 13:07:45 +00:00
|
|
|
|
/// Close tag
|
2006-10-21 00:16:43 +00:00
|
|
|
|
void closeTag(odocstream & os, Paragraph const & par);
|
|
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
|
} // namespace sgml
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
2006-10-22 10:15:23 +00:00
|
|
|
|
|
2002-08-09 00:42:12 +00:00
|
|
|
|
#endif // SGML_H
|