//
// 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_LIST_H
#define AEIMPORT_CHANGE_SET_FILE_LIST_H
#include // must be first
#include
#include
/**
* The change_set_file_list class is used to represent the list of
* files involved in a single change set.
*/
class change_set_file_list
{
public:
/**
* The destructor.
* DO NOT subclass me, I'm not virtual.
*/
~change_set_file_list();
/**
* The default constructor.
*/
change_set_file_list();
/**
* The size method is used to obtain the number of items in the list.
*/
size_t size(void) const { return content.size(); }
bool empty(void) const { return content.empty(); }
/**
* The [] operator is used to obtain the nth element of the array.
* This has O(1) performance.
*
* \note
* No bounds checking is performed.
*/
change_set_file operator[](size_t n) const { return content[n]; }
change_set_file &operator[](size_t n) { return content[n]; }
/**
* The clear method may be used to discard all of the items in the
* list.
*/
void clear(void);
/**
* The push_back method is used to append an item to the end of the
* list. This has O(1) behaviour.
*/
void push_back(const change_set_file &csf);
/**
* The validate method is used at debug to to check that this list
* is still valid.
*/
bool valid(void) const;
/**
* assert(valid());
*/
void validate(void) const;
/**
* The append method is used to append an item to the end of the
* list. This has O(1) behaviour.
*/
void append(const nstring &a_filename,
const nstring &a_edit, change_set_file::action_t a_action,
const nstring_list &a_tags);
private:
typedef std::vector content_t;
/**
* The content instance variableis used to remember the files in
* this list.
*/
content_t content;
/**
* The copy constructor. Do not use.
*/
change_set_file_list(const change_set_file_list &rhs);
/**
* The assignment operator. Do not use.
*/
change_set_file_list &operator=(const change_set_file_list &rhs);
};
DEPRECATED
void change_set_file_list_constructor(change_set_file_list *csflp);
DEPRECATED
void change_set_file_list_destructor(change_set_file_list *csflp);
DEPRECATED
void change_set_file_list_append(change_set_file_list *csflp,
const nstring &arg2, const nstring &arg3, change_set_file::action_t arg4,
const nstring_list &arg5);
DEPRECATED
void change_set_file_list_validate(change_set_file_list *csflp);
#endif // AEIMPORT_CHANGE_SET_FILE_LIST_H
// vim: set ts=8 sw=4 et :