Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/input/multipart.h
Go to the documentation of this file.
00001 //
00002 // aegis - project change supervisor
00003 // Copyright (C) 2009 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or (at
00008 // your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License along
00016 // with this program. If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef LIBAEGIS_INPUT_MULTIPART_H
00020 #define LIBAEGIS_INPUT_MULTIPART_H
00021 
00022 #include <libaegis/input.h>
00023 
00028 class input_multipart:
00029     public input_ty
00030 {
00031 public:
00035     virtual ~input_multipart();
00036 
00037 private:
00047     input_multipart(input &deeper, const nstring &boundary);
00048 
00049 public:
00059     static input create(input &deeper, const nstring &boundary);
00060 
00061     // See base class for documentation.
00062     nstring name();
00063 
00064     // See base class for documentation.
00065     off_t length();
00066 
00067     // See base class for documentation.
00068     void keepalive();
00069 
00070     // See base class for documentation.
00071     ssize_t read_inner(void *data, size_t nbytes);
00072 
00073     // See base class for documentation.
00074     off_t ftell_inner();
00075 
00076     // See base class for documentation.
00077     bool is_remote() const;
00078 
00079 private:
00084     input deeper;
00085 
00086     nstring boundary1;
00087     nstring boundary2;
00088     int state;
00089     unsigned long spos;
00090 
00091     enum line_type_t
00092     {
00093         line_type_content,
00094         line_type_empty,
00095         line_type_boundary,
00096         line_type_last_boundary,
00097     };
00098 
00099     line_type_t line_type(const nstring &line);
00100 
00104     input_multipart();
00105 
00109     input_multipart(const input_multipart &arg);
00110 
00114     input_multipart &operator=(const input_multipart &arg);
00115 };
00116 
00117 #endif // LIBAEGIS_INPUT_MULTIPART_H