// // aegis - project change supervisor // Copyright (C) 1999, 2003-2008, 2011, 2012, 2014 Peter Miller // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or (at // your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // #include #include #include #include #include #include output_cpio::~output_cpio() { // // Emit the archive trailer. // (An empty file with a magic name.) // nstring fn("TRAILER!!!"); output_cpio_child::create(deeper, fn, 0L, mtime); } output_cpio::output_cpio(const output::pointer &a_deeper, time_t a_mtime) : deeper(a_deeper), mtime(a_mtime) { } output_cpio::pointer output_cpio::create(const output::pointer &a_deeper, time_t a_mtime) { return pointer(new output_cpio(a_deeper, a_mtime)); } nstring output_cpio::filename(void) const { return deeper->filename(); } long output_cpio::ftell_inner(void) const { return 0; } void output_cpio::write_inner(const void *, size_t) { this_is_a_bug(); } void output_cpio::end_of_line_inner(void) { this_is_a_bug(); } nstring output_cpio::type_name(void) const { return "cpio archive"; } output::pointer output_cpio::child(const nstring &name, long len) { if (len < 0) { // // With no length given, we have to use the memory caching // version, which stashes the data in memory until the end, and // then we can write it out with the length in the header. // return output_cpio_child2::create(deeper, name, mtime); } return output_cpio_child::create(deeper, name, len, mtime); } // vim: set ts=8 sw=4 et :