FormFile.h Source File

Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# FormFile.h

Go to the documentation of this file.

    00001 /* -*-c++-*- */
    00002 /*
    00003  *  $Id: FormFile.h,v 1.6 2002/03/06 02:49:55 sbooth Exp $
    00004  *
    00005  *  Copyright (C) 1996 - 2002 Stephen F. Booth
    00006  *
    00007  *  This library is free software; you can redistribute it and/or
    00008  *  modify it under the terms of the GNU Lesser General Public
    00009  *  License as published by the Free Software Foundation; either
    00010  *  version 2.1 of the License, or (at your option) any later version.
    00011  *
    00012  *  This library is distributed in the hope that it will be useful,
    00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015  *  Lesser General Public License for more details.
    00016  *
    00017  *  You should have received a copy of the GNU Lesser General Public
    00018  *  License along with this library; if not, write to the Free Software
    00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00020  */
    00021
    00022 #ifndef _FORMFILE_H_
    00023 #define _FORMFILE_H_ 1
    00024
    00025 #ifdef __GNUG__
    00026 #  pragma interface
    00027 #endif
    00028
    00038 #include <iostream>
    00039 #include <string>
    00040
    00041 #include "cgicc/CgiDefs.h"
    00042
    00043 CGICC_BEGIN_NAMESPACE
    00044
    00045 // ============================================================
    00046 // Class FormFile
    00047 // ============================================================
    00048
    00062 class CGICC_API FormFile
    00063 {
    00064 public:
    00065
    00066   // ============================================================
    00067
    00070
    00076   inline
    00077   FormFile()
    00078     {}
    00079
    00089   FormFile(const STDNS string& name,
    00090            const STDNS string& filename,
    00091            const STDNS string& dataType,
    00092            const STDNS string& data);
    00093
    00100   inline
    00101   FormFile(const FormFile& file)
    00102     { operator=(file); }
    00103
    00109   inline
    00110   ~FormFile()
    00111     {}
    00113
    00114   // ============================================================
    00115
    00118
    00126   bool
    00127   operator== (const FormFile& file)                     const;
    00128
    00136   inline bool
    00137   operator!= (const FormFile& file)                     const
    00138     { return ! operator==(file); }
    00139
    00140 #ifdef WIN32
    00141   /* Dummy operator for MSVC++ */
    00142   inline bool
    00143   operator< (const FormFile& file)                      const
    00144   { return false; }
    00145 #endif
    00146
    00154   FormFile&
    00155   operator= (const FormFile& file);
    00157
    00158   // ============================================================
    00159
    00164
    00171   void
    00172   writeToStream(STDNS ostream& out)                     const;
    00173
    00181   inline STDNS string
    00182   getName()                                             const
    00183     { return fName; }
    00184
    00191   inline STDNS string
    00192   getFilename()                                         const
    00193     { return fFilename; }
    00194
    00201   inline STDNS string
    00202   getDataType()                                         const
    00203     { return fDataType; }
    00204
    00211   inline STDNS string
    00212   getData()                                     const
    00213     { return fData; }
    00214
    00221   inline STDNS string::size_type
    00222   getDataLength()                               const
    00223     { return fData.length(); }
    00225
    00226 private:
    00227   STDNS string  fName;
    00228   STDNS string  fFilename;
    00229   STDNS string  fDataType;
    00230   STDNS string  fData;
    00231 };
    00232
    00233 CGICC_END_NAMESPACE
    00234
    00235 #endif /* ! _FORMFILE_H_ */