//
// aegis - project change supervisor
// Copyright (C) 2001, 2002, 2004-2006, 2008, 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 AEIMPORT_CHANGE_SET_FILE_H
#define AEIMPORT_CHANGE_SET_FILE_H
#include
/**
* The change_set_file class is used to represent a single operation
* on a single file in a single change set.
*/
struct change_set_file
{
public:
enum action_t
{
action_create,
action_modify,
action_remove
};
/**
* The destructor.
* DO NOT subclass me, I'm not virtual.
*/
~change_set_file();
/**
* The constructor.
*/
change_set_file(const nstring &filename, const nstring &edit,
action_t action, const nstring_list &tag);
/**
* The copy constructor.
*/
change_set_file(const change_set_file &rhs);
/**
* The assignment operator.
*/
change_set_file &operator=(const change_set_file &rhs);
void swap(change_set_file &rhs);
void validate(void) const;
bool valid(void) const;
void merge(const change_set_file &from);
static const char *action_name(action_t);
// private:
/**
* The filename instance variable is used to remember the name of
* the file in a change set.
*/
nstring filename;
/**
* The edit instance variable is used to remember the edit number
* of the file in a change set.
*/
nstring edit;
/**
* The filename instance variable is used to remember what is being
* done to the file in a change set.
*/
action_t action;
/**
* The filename instance variable is used to remember the tag names
* attached to a file in a change set.
*/
nstring_list tag;
private:
/**
* The default constructor. Do not use.
*/
change_set_file();
};
DEPRECATED
const char *change_set_file_action_name(change_set_file::action_t);
DEPRECATED
void change_set_file_validate(change_set_file *csfp);
#endif // AEIMPORT_CHANGE_SET_FILE_H
// vim: set ts=8 sw=4 et :