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

body.h

Go to the documentation of this file.
00001 /* 
00002  * This file is part of the rfc822 library (C) rebel42@users.sourceforge.net.
00003  *
00004  * The rfc822 library is released under the terms of the GNU Library General Public License as
00005  * published by the Free Software Foundation; either version 2 of the
00006  * License, or (at your option) any later version. See the file COPYING
00007  * as included in the distribution for details.
00008  */
00009 #ifndef RFC822_BODY_H
00010 #define RFC822_BODY_H
00011 
00012 #include <string>
00013 
00014 using namespace std;
00015 
00016 class ostream;
00017 
00018 namespace rfc822
00019 {
00020 
00022 
00032 class body: public string
00033 {
00034         bool m_fNeedsEscape;
00035 
00036 public:
00037         body(): m_fNeedsEscape(false)
00038                 { }
00039                 
00040         body(const string& s, bool fNeedsEscape = true): 
00041                 string(s), m_fNeedsEscape(fNeedsEscape)
00042                 { }
00043         body(const body& b): string(b), m_fNeedsEscape(b.m_fNeedsEscape)
00044                 { }
00045         
00046         body& operator = (const body& b)
00047                 { return setText(b, b.m_fNeedsEscape); }
00048         body& operator = (const string& s)
00049                 { return setText(s, true); }
00050         
00051         body& setText(const string& s, bool f)
00052         {
00053                 string::operator = (s);
00054                 m_fNeedsEscape = f;
00055                 return *this;
00056         }
00057 
00058         bool needsEscape() const
00059                 { return m_fNeedsEscape; }
00060                 
00061         string escaped() const;
00062         ostream& printEscaped(ostream& o) const;
00063 };
00064 
00065 };      // namespace rfc822
00066 
00067 #endif

Generated on Mon Oct 22 17:03:48 2001 for rfc822 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001