<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html lang="en" dir="LTR"> <head> <!-- $Id: header.html,v 1.3 2002/03/09 18:30:37 sbooth Exp $ --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>CgiUtils.h Source File</title> <link rev="made" href="mailto:bug-cgicc@gnu.org" /> <link href="cgicc-doc.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- Generated by Doxygen 1.2.13.1 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>CgiUtils.h</h1><a href="CgiUtils_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/* -*-c++-*- */</font> 00002 <font class="comment">/*</font> 00003 <font class="comment"> * $Id: CgiUtils.h,v 1.5 2002/03/06 02:49:55 sbooth Exp $</font> 00004 <font class="comment"> *</font> 00005 <font class="comment"> * Copyright (C) 1996 - 2002 Stephen F. Booth</font> 00006 <font class="comment"> *</font> 00007 <font class="comment"> * This library is free software; you can redistribute it and/or</font> 00008 <font class="comment"> * modify it under the terms of the GNU Lesser General Public</font> 00009 <font class="comment"> * License as published by the Free Software Foundation; either</font> 00010 <font class="comment"> * version 2.1 of the License, or (at your option) any later version.</font> 00011 <font class="comment"> *</font> 00012 <font class="comment"> * This library is distributed in the hope that it will be useful,</font> 00013 <font class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</font> 00014 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> 00015 <font class="comment"> * Lesser General Public License for more details.</font> 00016 <font class="comment"> *</font> 00017 <font class="comment"> * You should have received a copy of the GNU Lesser General Public</font> 00018 <font class="comment"> * License along with this library; if not, write to the Free Software</font> 00019 <font class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</font> 00020 <font class="comment"> */</font> 00021 00022 <font class="preprocessor">#ifndef _CGIUTILS_H_</font> 00023 <font class="preprocessor"></font><font class="preprocessor">#define _CGIUTILS_H_ 1</font> 00024 <font class="preprocessor"></font> 00025 <font class="preprocessor">#ifdef __GNUG__</font> 00026 <font class="preprocessor"></font><font class="preprocessor"># pragma interface</font> 00027 <font class="preprocessor"></font><font class="preprocessor">#endif</font> 00028 <font class="preprocessor"></font> 00036 <font class="preprocessor">#include <new></font> 00037 <font class="preprocessor">#include <string></font> 00038 <font class="preprocessor">#include <fstream></font> 00039 00040 <font class="preprocessor">#include "<a class="code" href="CgiDefs_8h.html">cgicc/CgiDefs.h</a>"</font> 00041 00042 <font class="preprocessor">#if DEBUG</font> 00043 <font class="preprocessor"></font> 00044 <font class="keyword">extern</font> STDNS ofstream gLogFile; 00045 <font class="preprocessor">#define LOGLN(s) gLogFile << s << STDNS endl;</font> 00046 <font class="preprocessor"></font><font class="preprocessor">#define LOG(s) gLogFile << s;</font> 00047 <font class="preprocessor"></font> 00048 <font class="preprocessor">#else</font> 00049 <font class="preprocessor"></font> <a name="l00056"></a><a class="code" href="CgiUtils_8h.html#a1">00056</a> <font class="preprocessor">#define LOGLN(s)</font> 00057 <font class="preprocessor"></font> <a name="l00064"></a><a class="code" href="CgiUtils_8h.html#a2">00064</a> <font class="preprocessor">#define LOG(s)</font> 00065 <font class="preprocessor"></font> 00066 <font class="preprocessor">#endif</font> 00067 <font class="preprocessor"></font> 00068 00069 CGICC_BEGIN_NAMESPACE 00070 00079 CGICC_API STDNS string 00080 <a class="code" href="namespacecgicc.html#a6">safeGetenv</a>(<font class="keyword">const</font> <font class="keywordtype">char</font> *varName); 00081 00090 CGICC_API <font class="keywordtype">bool</font> 00091 <a class="code" href="namespacecgicc.html#a7">stringsAreEqual</a>(<font class="keyword">const</font> STDNS string& s1, 00092 <font class="keyword">const</font> STDNS string& s2); 00093 00103 CGICC_API <font class="keywordtype">bool</font> 00104 <a class="code" href="namespacecgicc.html#a7">stringsAreEqual</a>(<font class="keyword">const</font> STDNS string& s1, 00105 <font class="keyword">const</font> STDNS string& s2, 00106 size_t n); 00107 00116 CGICC_API <font class="keywordtype">int</font> 00117 <a class="code" href="namespacecgicc.html#a9">saferSystem</a>(<font class="keyword">const</font> STDNS string& command); 00118 00128 CGICC_API STDNS string 00129 <a class="code" href="namespacecgicc.html#a10">unescapeString</a>(<font class="keyword">const</font> STDNS string& src); 00130 00145 CGICC_API <font class="keywordtype">char</font> 00146 <a class="code" href="namespacecgicc.html#a11">hexToChar</a>(<font class="keywordtype">char</font> first, 00147 <font class="keywordtype">char</font> second); 00148 00164 STDNS string 00165 <a class="code" href="namespacecgicc.html#a12">extractBetween</a>(<font class="keyword">const</font> STDNS string& data, 00166 <font class="keyword">const</font> STDNS string& separator1, 00167 <font class="keyword">const</font> STDNS string& separator2); 00168 00177 <font class="keyword">inline</font> STDNS string 00178 <a class="code" href="namespacecgicc.html#a12">extractBetween</a>(<font class="keyword">const</font> STDNS string& data, 00179 <font class="keyword">const</font> STDNS string& separator) 00180 { <font class="keywordflow">return</font> <a class="code" href="namespacecgicc.html#a12">extractBetween</a>(data, separator, separator); } 00181 00189 <font class="keywordtype">void</font> 00190 <a class="code" href="namespacecgicc.html#a14">writeString</a>(STDNS ostream& out, 00191 <font class="keyword">const</font> STDNS string& s); 00192 00200 <font class="keywordtype">void</font> 00201 <a class="code" href="namespacecgicc.html#a15">writeLong</a>(STDNS ostream& out, 00202 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> l); 00203 00211 STDNS string 00212 <a class="code" href="namespacecgicc.html#a16">readString</a>(STDNS istream& in); 00213 00221 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> 00222 <a class="code" href="namespacecgicc.html#a17">readLong</a>(STDNS istream& in); 00223 00224 CGICC_END_NAMESPACE 00225 00226 <font class="preprocessor">#endif </font><font class="comment">/* ! _CGIUTILS_H_ */</font> </pre></div><!-- $Id: footer.html,v 1.3 2002/03/09 18:30:37 sbooth Exp $ --> <hr> <address><small> GNU cgicc - A C++ class library for writing CGI applications<br /> Copyright © 1996 - 2002 <a href="mailto:sbooth@gnu.org">Stephen F. Booth</a><br /> Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.<br /> Documentation generated Sun Mar 17 16:40:57 2002 for cgicc by <a HREF="http://www.doxygen.org/index.html">doxygen</a> 1.2.13.1 </small></address> </body> </html>