00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1999, 2002, 2005, 2006, 2008 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 00008 // (at 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 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef AEDIST_OUTPUT_CPIO_CHILD_H 00021 #define AEDIST_OUTPUT_CPIO_CHILD_H 00022 00023 #include <common/ac/time.h> 00024 00025 #include <common/nstring.h> 00026 #include <libaegis/output.h> 00027 00032 class output_cpio_child: 00033 public output 00034 { 00035 public: 00039 virtual ~output_cpio_child(); 00040 00041 private: 00058 output_cpio_child(const output::pointer &deeper, const nstring &name, 00059 long len, time_t mtime); 00060 00061 public: 00078 static pointer create(const output::pointer &deeper, const nstring &name, 00079 long len, time_t mtime); 00080 00081 protected: 00082 // See base class for documentation. 00083 nstring filename() const ; 00084 00085 // See base class for documentation. 00086 const char *type_name() const; 00087 00088 // See base class for documentation. 00089 long ftell_inner() const; 00090 00091 // See base class for documentation. 00092 void write_inner(const void *data, size_t length); 00093 00094 // See base class for documentation. 00095 void end_of_line_inner(); 00096 00097 private: 00102 output::pointer deeper; 00103 00108 nstring name; 00109 00114 long length; 00115 00120 long pos; 00121 00126 bool bol; 00127 00133 void changed_size(); 00134 00139 void padding(); 00140 00145 void hex8(long); 00146 00151 void header(); 00152 00157 time_t mtime; 00158 00162 output_cpio_child(); 00163 00167 output_cpio_child(const output_cpio_child &); 00168 00172 output_cpio_child &operator=(const output_cpio_child &); 00173 }; 00174 00175 #endif // AEDIST_OUTPUT_CPIO_CHILD_H