// // aegis - project change supervisor // Copyright (C) 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 . // #ifndef AEDIST_OFORMAT_CPIO_H #define AEDIST_OFORMAT_CPIO_H #include class output_cpio; // forward class input; // forward /** * The oformat_cpio class is used to represent creating a CPIO archive * to hold an Aegis change set. This originally thid was the only * format that aedist understood. */ class oformat_cpio: public oformat { public: /** * The destructor. */ virtual ~oformat_cpio(); static bool candidate(const output_pointer &ofp); /** * The create class method is used to create new dynamically * allocated instances of this class. * * @param ofp * The file to write to. * @param when * The time stamp to use for arcvhive members. */ static pointer create(const output_pointer &ofp, time_t when); protected: // See base class or documentation. void emit_project_name(const nstring &name); // See base class or documentation. void emit_change_number(const nstring &name); // See base class or documentation. void emit_change_set_meta_data(cstate_ty *csp); // See base class or documentation. void emit_patch(const nstring &file_name, const input_pointer &value); // See base class or documentation. void emit_source(const nstring &file_name, const input_pointer &value, bool executable); private: /** * The constructor. * It is private on purpose, the the #create class method. * * @param ofp * The file to write to. * @param when * The time stamp to use for arcvhive members. */ oformat_cpio(const output_pointer &ofp, time_t when); typedef aegis_shared_ptr output_cpio_pointer; /** * The ofp instance variable is used to remember the output archive * file to write the serialised change set. One archive member per * file. */ output_cpio_pointer cpio_p; /** * The default constructor. * Do not use. */ oformat_cpio(); /** * The copy constructor. Do not use. * * @param rhs * The archive to copy */ oformat_cpio(const oformat_cpio &rhs); /** * The assignment operator. Do not use. */ oformat_cpio &operator=(const oformat_cpio &); }; // vim: set ts=8 sw=4 et : #endif // AEDIST_OFORMAT_CPIO_H