1 /* ***************************************************************** 2 MESQUITE -- The Mesh Quality Improvement Toolkit 3 4 Copyright 2007 Sandia National Laboratories. Developed at the 5 University of Wisconsin--Madison under SNL contract number 6 624796. The U.S. Government and the University of Wisconsin 7 retain certain rights to this software. 8 9 This library is free software; you can redistribute it and/or 10 modify it under the terms of the GNU Lesser General Public 11 License as published by the Free Software Foundation; either 12 version 2.1 of the License, or (at your option) any later version. 13 14 This library is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 Lesser General Public License for more details. 18 19 You should have received a copy of the GNU Lesser General Public License 20 (lgpl.txt) along with this library; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 23 (2008) kraftche@cae.wisc.edu 24 25 ***************************************************************** */ 26 27 28 /** \file ManPage.hpp 29 * \brief 30 * \author Jason Kraftcheck 31 */ 32 33 #ifndef MSQ_MAN_PAGE_HPP 34 #define MSQ_MAN_PAGE_HPP 35 36 #include "Mesquite.hpp" 37 #include <iostream> 38 #include <string> 39 40 class ManPage 41 { 42 public: begin_bold(std::ostream & str)43 static std::ostream& begin_bold( std::ostream& str ) 44 { return str << std::endl << ".B" << std::endl; } end_bold(std::ostream & str)45 static std::ostream& end_bold( std::ostream& str ) 46 { return str << std::endl; } bold(std::ostream & str,const std::string & s)47 static std::ostream& bold( std::ostream& str, const std::string& s ) 48 { return end_bold( begin_bold(str) << s ); } 49 begin_italic(std::ostream & str)50 static std::ostream& begin_italic( std::ostream& str ) 51 { return str << std::endl << ".I" << std::endl; } end_italic(std::ostream & str)52 static std::ostream& end_italic( std::ostream& str ) 53 { return str << std::endl; } italic(std::ostream & str,const std::string & s)54 static std::ostream& italic( std::ostream& str, const std::string& s ) 55 { return end_italic( begin_italic(str) << s ); } 56 begin_section(std::ostream & str,const std::string & name)57 static std::ostream& begin_section( std::ostream& str, const std::string& name ) 58 { return str << std::endl << ".SH " << name << std::endl; } 59 begin_subsection(std::ostream & str,const std::string & name)60 static std::ostream& begin_subsection( std::ostream& str, const std::string& name ) 61 { return str << std::endl << ".SS " << name << std::endl; } 62 begin_paragraph(std::ostream & str)63 static std::ostream& begin_paragraph( std::ostream& str ) 64 { return str << std::endl << ".P " << std::endl; } 65 begin_hanging_paragraph(std::ostream & str)66 static std::ostream& begin_hanging_paragraph( std::ostream& str ) 67 { return str << std::endl << ".HP " << std::endl; } 68 begin_indent(std::ostream & str)69 static std::ostream& begin_indent( std::ostream& str ) 70 { return str << std::endl << ".RS " << std::endl; } end_indent(std::ostream & str)71 static std::ostream& end_indent( std::ostream& str ) 72 { return str << std::endl << ".RE " << std::endl; } 73 begin_manpage(std::ostream & str,const std::string & name,int section)74 static std::ostream& begin_manpage( std::ostream& str, const std::string& name, int section ) 75 { return str << std::endl << ".TH " << name << " " << section << std::endl; } 76 77 static std::ostream& write_text( std::ostream& str, bool hanging_indent, const std::string& text ); 78 }; 79 80 #endif 81