Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

sgml Namespace Reference


Functions

pair< bool, string > escapeChar (char c)
 Escape the given character if necessary to an SGML entity. More...

int openTag (ostream &os, Paragraph::depth_type depth, bool mixcont, string const &latexname)
 FIXME. More...

int closeTag (ostream &os, Paragraph::depth_type depth, bool mixcont, string const &latexname)
 FIXME. More...


Function Documentation

int sgml::closeTag std::ostream &    os,
Paragraph::depth_type    depth,
bool    mixcont,
string const &    latexname
 

FIXME.

Definition at line 98 of file sgml.C.

Referenced by InsetText::docbook, Buffer::makeDocBookFile, and Buffer::makeLinuxDocFile.

00100 {
00101         if (!latexname.empty() && latexname != "!-- --") {
00102                 if (!mixcont)
00103                         os << endl << string(depth, ' ');
00104                 os << "</" << latexname << '>';
00105         }
00106 
00107         if (!mixcont)
00108                 os << endl;
00109 
00110         return !mixcont;
00111 }

std::pair< bool, string > sgml::escapeChar char    c
 

Escape the given character if necessary to an SGML entity.

Returns true if it was a whitespace character.

Definition at line 24 of file sgml.C.

Referenced by Buffer::simpleDocBookOnePar, and Buffer::simpleLinuxDocOnePar.

00025 {
00026         string str;
00027 
00028         switch (c) {
00029         case ' ':
00030                 return make_pair(true, string(" "));
00031                 break;
00032         case '\0': // Ignore :-)
00033                 str.erase();
00034                 break;
00035         case '&':
00036                 str = "&amp;";
00037                 break;
00038         case '<':
00039                 str = "&lt;";
00040                 break;
00041         case '>':
00042                 str = "&gt;";
00043                 break;
00044         case '$':
00045                 str = "&dollar;";
00046                 break;
00047         case '#':
00048                 str = "&num;";
00049                 break;
00050         case '%':
00051                 str = "&percnt;";
00052                 break;
00053         case '[':
00054                 str = "&lsqb;";
00055                 break;
00056         case ']':
00057                 str = "&rsqb;";
00058                 break;
00059         case '{':
00060                 str = "&lcub;";
00061                 break;
00062         case '}':
00063                 str = "&rcub;";
00064                 break;
00065         case '~':
00066                 str = "&tilde;";
00067                 break;
00068         case '"':
00069                 str = "&quot;";
00070                 break;
00071         case '\\':
00072                 str = "&bsol;";
00073                 break;
00074         default:
00075                 str = c;
00076                 break;
00077         }
00078         return make_pair(false, str);
00079 }

int sgml::openTag std::ostream &    os,
Paragraph::depth_type    depth,
bool    mixcont,
string const &    latexname
 

FIXME.

Definition at line 82 of file sgml.C.

Referenced by InsetText::docbook, Buffer::makeDocBookFile, and Buffer::makeLinuxDocFile.

00084 {
00085         if (!latexname.empty() && latexname != "!-- --") {
00086                 if (!mixcont)
00087                         os << string(depth, ' ');
00088                 os << '<' << latexname << '>';
00089         }
00090 
00091         if (!mixcont)
00092                 os << endl;
00093 
00094         return !mixcont;
00095 }


Generated on Fri Jul 18 01:19:12 2003 for lyx by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002