mime.h

Go to the documentation of this file.
00001 /*
00002  * mime.h
00003  *
00004  * Multipurpose Internet Mail Extensions support classes.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-2002 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Log: mime.h,v $
00027  * Revision 1.21  2005/11/30 12:47:37  csoutheren
00028  * Removed tabs, reformatted some code, and changed tags for Doxygen
00029  *
00030  * Revision 1.20  2004/03/23 06:38:51  csoutheren
00031  * Update for change in location of Base64 routines
00032  *
00033  * Revision 1.19  2004/03/23 05:59:17  csoutheren
00034  * Moved the Base64 routines into cypher.cxx, which is a more sensible
00035  * place and reduces the inclusion of unrelated code
00036  *
00037  * Revision 1.18  2002/11/06 22:47:24  robertj
00038  * Fixed header comment (copyright etc)
00039  *
00040  * Revision 1.17  2002/09/16 01:08:59  robertj
00041  * Added #define so can select if #pragma interface/implementation is used on
00042  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00043  *
00044  * Revision 1.16  2001/10/03 00:24:57  robertj
00045  * Split out function for adding a single line of MIME info, reduces
00046  *    duplicated code and is useful in some other areas such as HTTP/1.1
00047  *
00048  * Revision 1.15  2001/09/28 00:41:18  robertj
00049  * Added SetInteger() function to set numeric MIME fields.
00050  * Removed HasKey() as is confusing due to ancestor Contains().
00051  * Overrides of SetAt() and Contains() to assure PCaselessString used.
00052  *
00053  * Revision 1.14  2000/11/09 00:18:26  robertj
00054  * Cosmetic change: removed blank lines.
00055  *
00056  * Revision 1.13  1999/03/09 08:01:46  robertj
00057  * Changed comments for doc++ support (more to come).
00058  *
00059  * Revision 1.12  1999/02/16 08:07:10  robertj
00060  * MSVC 6.0 compatibility changes.
00061  *
00062  * Revision 1.11  1998/11/30 02:50:52  robertj
00063  * New directory structure
00064  *
00065  * Revision 1.10  1998/09/23 06:19:42  robertj
00066  * Added open source copyright license.
00067  *
00068  * Revision 1.9  1997/02/05 11:53:11  robertj
00069  * Changed construction of MIME dictionary to be delayed untill it is used.
00070  *
00071  * Revision 1.8  1996/09/14 13:09:15  robertj
00072  * Major upgrade:
00073  *   rearranged sockets to help support IPX.
00074  *   added indirect channel class and moved all protocols to descend from it,
00075  *   separating the protocol from the low level byte transport.
00076  *
00077  * Revision 1.7  1996/07/15 10:28:31  robertj
00078  * Changed memory block base64 conversion functions to be void *.
00079  *
00080  * Revision 1.6  1996/03/16 04:38:09  robertj
00081  * Fixed bug in MIME write function, should be const.
00082  *
00083  * Revision 1.5  1996/02/25 03:04:32  robertj
00084  * Added decoding of Base64 to a block of memory instead of PBYTEArray.
00085  *
00086  * Revision 1.4  1996/01/28 14:14:30  robertj
0008 name="l00045">00045  *
00046  * Revision 1.1  2002/06/26 09:01:19  craigs
00047  * Initial version
00048  *
00049  */
00050 
00051 #ifndef _PMEMFILE
00052 #define _PMEMFILE
00053 
00054 #ifdef P_USE_PRAGMA
00055 #pragma interface
00056 #endif
00057 
00058 #include <ptlib.h>
00059 
00062 class PMemoryFile : public PFile
00063 {
00064   PCLASSINFO(PMemoryFile, PFile);
00065   public:
00070     PMemoryFile();
00071 
00074     PMemoryFile(
00075       const PBYTEArray & data  
00076     );
00078 
00079 
00088     Comparison Compare(
00089       const PObject & obj   
00090     ) const;
00092 
00093 
00107     virtual BOOL Read(
00108       void * buf,   
00109       PINDEX len    
00110     );
00111 
00121     virtual BOOL Write(
00122       const void * buf, 
00123       PINDEX len        
00124     );
00126 
00127 
00136     off_t GetLength() const;
00137       
00144     BOOL SetLength(
00145       off_t len   
00146     );
00147 
00158     BOOL SetPosition(
00159       off_t pos,                         
00160       FilePositionOrigin origin = Start  
00161     );
00162 
00169     off_t GetPosition() const;
00171 
00172 
00177     const PBYTEArray & GetData() const { return data; }
00179 
00180 
00181   protected:
00182     PBYTEArray data;
00183     off_t position;
00184 };
00185 
00186 
00187 #endif // _PMEMFILE
00188 
00189 
00190 // End of File ///////////////////////////////////////////////////////////////
00191 

Generated on Tue Dec 9 12:57:48 2008 for PWLib by  doxygen 1.5.1
./usr/share/doc/libpt-doc/html/mime_8h-source.html0000644000000000000000000005427711117465514020750 0ustar rootroot PWLib: mime.h Source File

mime.h

Go to the documentation of this file.
00001 /*
00002  * mime.h
00003  *
00004  * Multipurpose Internet Mail Extensions support classes.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-2002 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Log: mime.h,v $
00027  * Revision 1.21  2005/11/30 12:47:37  csoutheren
00028  * Removed tabs, reformatted some code, and changed tags for Doxygen
00029  *
00030  * Revision 1.20  2004/03/23 06:38:51  csoutheren
00031  * Update for change in location of Base64 routines
00032  *
00033  * Revision 1.19  2004/03/23 05:59:17  csoutheren
00034  * Moved the Base64 routines into cypher.cxx, which is a more sensible
00035  * place and reduces the inclusion of unrelated code
00036  *
00037  * Revision 1.18  2002/11/06 22:47:24  robertj
00038  * Fixed header comment (copyright etc)
00039  *
00040  * Revision 1.17  2002/09/16 01:08:59  robertj
00041  * Added #define so can select if #pragma interface/implementation is used on
00042  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00043  *
00044  * Revision 1.16  2001/10/03 00:24:57  robertj
00045  * Split out function for adding a single line of MIME info, reduces
00046  *    duplicated code and is useful in some other areas such as HTTP/1.1
00047  *
00048  * Revision 1.15  2001/09/28 00:41:18  robertj
00049  * Added SetInteger() function to set numeric MIME fields.
00050  * Removed HasKey() as is confusing due to ancestor Contains().
00051  * Overrides of SetAt() and Contains() to assure PCaselessString used.
00052  *
00053  * Revision 1.14  2000/11/09 00:18:26  robertj
00054  * Cosmetic change: removed blank lines.