undo_item_rename Class Reference

#include <rename.h>

Inheritance diagram for undo_item_rename:

undo_item

Public Member Functions

virtual ~undo_item_rename ()
 undo_item_rename (const nstring &oldpath, const nstring &newpath)
bool operator== (const undo_item_rename &rhs) const
void action ()
void unfinished ()

Private Member Functions

 undo_item_rename ()
 undo_item_rename (const undo_item_rename &)
undo_item_renameoperator= (const undo_item_rename &)

Private Attributes

nstring oldpath
nstring newpath

Detailed Description

The undo_item_rename class is used to represent a rename action to be performed in the event of an error.

It renames a file, moving it between directories if required.

Any other hard links to the file (as created using link(2)) are unaffected.

If newpath already exists it will be atomically replaced (subject to a few conditions), so that there is no point at which another process attempting to access newpath will find it missing.

If newpath exists but the operation fails for some reason rename guarantees to leave an instance of newpath in place.

However, when overwriting there will probably be a window in which both oldpath and newpath refer to the file being renamed.

If oldpath refers to a symbolic link the link is renamed; if newpath refers to a symbolic link the link will be overwritten.

Definition at line 48 of file rename.h.


Constructor & Destructor Documentation

virtual undo_item_rename::~undo_item_rename (  )  [virtual]

The destructor.

undo_item_rename::undo_item_rename ( const nstring oldpath,
const nstring newpath 
)

The constructor.

Parameters:
oldpath What the file is called now.
newpath What the file will be called then.

undo_item_rename::undo_item_rename (  )  [private]

The default constructor. Do not use.

undo_item_rename::undo_item_rename ( const undo_item_rename  )  [private]

The copy constructor. Do not use.


Member Function Documentation

bool undo_item_rename::operator== ( const undo_item_rename rhs  )  const [inline]

The equality operator is used to see if two rename items are equal.

Definition at line 72 of file rename.h.

void undo_item_rename::action (  )  [virtual]

The action method is used to perform the undo action.

Implements undo_item.

void undo_item_rename::unfinished (  )  [virtual]

The unfinished method is used to print a warning about unfinished undo action. This happens when there is an undo error. The default action says nothing.

Implements undo_item.

undo_item_rename& undo_item_rename::operator= ( const undo_item_rename  )  [private]

The assignment operator. Do not use.


Field Documentation

The oldpath instance variable is used to remember what the file is called now.

Definition at line 89 of file rename.h.

The newpath instance variable is used to remember what the file will be called then.

Definition at line 95 of file rename.h.


The documentation for this class was generated from the following file:

Generated on Wed Mar 12 23:37:45 2008 for Aegis by  doxygen 1.5.5