Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
AddFile Class Reference
Inheritance diagram for AddFile:
Inheritance graph
[legend]
Collaboration diagram for AddFile:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AddFile ()
virtual int Parse (char *line)
virtual int Prepare ()
virtual int Execute ()
virtual void Finish (int status)

Private Attributes

const char * mFile

Detailed Description

Definition at line 642 of file updater.cpp.


Constructor & Destructor Documentation

AddFile::AddFile ( ) [inline]

Definition at line 645 of file updater.cpp.

: mFile(NULL) { }

Member Function Documentation

int AddFile::Execute ( ) [virtual]

Implements Action.

Reimplemented in AddIfFile.

Definition at line 677 of file updater.cpp.

{
  LOG(("EXECUTE ADD %s\n", mFile));

  int rv;

  // First make sure that we can actually get rid of any existing file.
  if (access(mFile, F_OK) == 0)
  {
    rv = backup_create(mFile);
    if (rv)
      return rv;

    rv = ensure_remove(mFile);
    if (rv)
      return WRITE_ERROR;
  }
  else
  {
    rv = ensure_parent_dir(mFile);
    if (rv)
      return rv;
  }
    
  return gArchiveReader.ExtractFile(mFile, mFile);
}

Here is the call graph for this function:

void AddFile::Finish ( int  status) [virtual]

Implements Action.

Reimplemented in AddIfFile.

Definition at line 705 of file updater.cpp.

{
  LOG(("FINISH ADD %s\n", mFile));

  backup_finish(mFile, status);
}

Here is the call graph for this function:

int AddFile::Parse ( char *  line) [virtual]

Implements Action.

Reimplemented in AddIfFile.

Definition at line 657 of file updater.cpp.

{
  // format "<newfile>"

  mFile = mstrtok(kQuote, &line);
  if (!mFile)
    return PARSE_ERROR;

  return OK;
}

Here is the call graph for this function:

int AddFile::Prepare ( ) [virtual]

Implements Action.

Reimplemented in AddIfFile.

Definition at line 669 of file updater.cpp.

{
  LOG(("PREPARE ADD %s\n", mFile));

  return OK;
}

Member Data Documentation

const char* AddFile::mFile [private]

Definition at line 653 of file updater.cpp.


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