Ignore:
Timestamp:
Jan 22, 2012, 4:35:37 PM (4 years ago)
Author:
chris
Message:

Allow constructing a BackupClientFileAttributes? from a struct EMU_STAT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/backupstore/BackupClientFileAttributes.cpp

    r2972 r3067  
    124124//
    125125// Function
     126//              Name:    BackupClientFileAttributes::BackupClientFileAttributes()
     127//              Purpose: Artifical constructor
     128//              Created: 2011/12/06
     129//
     130// --------------------------------------------------------------------------
     131BackupClientFileAttributes::BackupClientFileAttributes(const EMU_STRUCT_STAT &st)
     132: mpClearAttributes(0)
     133{
     134        ASSERT(sizeof(u_int64_t) == sizeof(box_time_t));
     135        StreamableMemBlock *pnewAttr = new StreamableMemBlock;
     136        FillAttributes(*pnewAttr, (const char *)NULL, st, true);
     137
     138        // Attributes ready. Encrypt into this block
     139        EncryptAttr(*pnewAttr);
     140       
     141        // Store the new attributes
     142        RemoveClear();
     143        mpClearAttributes = pnewAttr;
     144        pnewAttr = 0;
     145}
     146
     147// --------------------------------------------------------------------------
     148//
     149// Function
    126150//              Name:    BackupClientFileAttributes::BackupClientFileAttributes(const BackupClientFileAttributes &)
    127151//              Purpose: Copy constructor
     
    437461//
    438462// Function
    439 //              Name:    BackupClientFileAttributes::ReadAttributesLink()
     463//              Name:    BackupClientFileAttributes::FillAttributes()
    440464//              Purpose: Private function, handles standard attributes for all objects
    441465//              Created: 2003/10/07
    442466//
    443467// --------------------------------------------------------------------------
    444 void BackupClientFileAttributes::FillAttributes(StreamableMemBlock &outputBlock, const char *Filename, EMU_STRUCT_STAT &st, bool ZeroModificationTimes)
     468void BackupClientFileAttributes::FillAttributes(
     469        StreamableMemBlock &outputBlock, const char *Filename,
     470        const EMU_STRUCT_STAT &st, bool ZeroModificationTimes
     471)
    445472{
    446473        outputBlock.ResizeBlock(sizeof(attr_StreamFormat));
     
    476503//
    477504// Function
    478 //              Name:    BackupClientFileAttributes::ReadAttributesLink()
     505//              Name:    BackupClientFileAttributes::FillAttributesLink(
     506//                       StreamableMemBlock &outputBlock,
     507//                       const char *Filename, struct stat &st)
    479508//              Purpose: Private function, handles the case where a symbolic link is needed
    480509//              Created: 2003/10/07
     
    508537//
    509538// Function
    510 //              Name:    BackupClientFileAttributes::ReadExtendedAttr(const char *, unsigned char**)
     539//              Name:    BackupClientFileAttributes::FillExtendedAttr(const char *, unsigned char**)
    511540//              Purpose: Private function, read the extended attributes of the file into the block
    512541//              Created: 2005/06/12
Note: See TracChangeset for help on using the changeset viewer.