Program of file data, C/C++ Programming

Assignment Help:

Program of file data:

FileData::FileData( ffblk& blk ) :

    fileName( blk.ff_name ),

    fileDate( (blk.ff_fdate >> 5) & 0x000F,

              blk.ff_fdate & 0x0001F,

              (blk.ff_fdate >> 9) + 1980 ),

    fileSize( blk.ff_fsize ),

    fileTime( blk.ff_ftime >> 11,

              (blk.ff_ftime >> 5) & 0x3F,

              blk.ff_ftime & 0x1F )

{

}

 

void FileData::printOn( ostream& outputStream ) const

{

    outputStream << setw( 14 ) << setiosflags( ios::left )   << fileName

                 << setw( 18 ) << fileDate

                 << setw( 17 ) << resetiosflags( ios::left ) << fileTime

                 << setw( 10 ) << fileSize << " bytes";

}

 

int FilesByName::isEqual( const Object& testFile ) const

{

    return fileName == ( (FilesByName&)testFile ).fileName;

}

 

int FilesByName::isLessThan( const Object& testFile ) const

{

    return fileName < ( (FilesByName&)testFile ).fileName;

}

 

int FilesByDate::isEqual( const Object& testFile ) const

{

    return fileDate == ( (FilesByDate&)testFile ).fileDate &&

           fileTime == ( (FilesByDate&)testFile ).fileTime;

}

 

int FilesByDate::isLessThan( const Object& testFile ) const

{

    if( fileDate == ( (FilesByDate&)testFile ).fileDate )

        return fileTime < ( (FilesByDate&)testFile ).fileTime;

    else

        return fileDate < ( (FilesByDate&)testFile ).fileDate;

}

 

int FilesBySize::isEqual( const Object& testFile ) const

{

    return fileSize == ( (FilesBySize&)testFile ).fileSize;

}

 

int FilesBySize::isLessThan( const Object& testFile ) const

{

    return fileSize < ( (FilesBySize&)testFile ).fileSize;

}


Related Discussions:- Program of file data

If one won''t explicitly call the destructor of a local then , if one won't...

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

Hw8, Asks the user for an integer. if the number is less than 21, ask them ...

Asks the user for an integer. if the number is less than 21, ask them for a number again; repeat this until you get a number bigger than 20. 20 is not an acceptable number. Once yo

Finnishing C++ Project, i havea a small C++ i need help with. should not be...

i havea a small C++ i need help with. should not be anything special for an experienced programmer

Electrical eng, calculate the total resisitance of a series circuit?

calculate the total resisitance of a series circuit?

Program to display stock containing item code, THIS PROGRAM IS TO DISPLAY A...

THIS PROGRAM IS TO DISPLAY A STOCK CONTAINING ITEM CODE,ITEM NAME,PRICE AND ANOTHER STOCK WITH CODE & QUANTITY AND DISPLAY COMPLETE INFORMATION #include #include #include

Described assignment operator?, Default assignment operator mange assigning...

Default assignment operator mange assigning one object to another object of the same class. It is member to member copy as shallow copy.

Compiler design limiting instruction, Ravi is a newbie to the programming a...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with '

What is buddy systems, Buddy systems : A method of handling the storage man...

Buddy systems : A method of handling the storage management problem is kept individual free lists for blocks of dissimilar sizes. Every list having free blocks of only one particul

Explain brief about class and objects, Question 1 Write a program that acc...

Question 1 Write a program that accepts a 3x3 matrix from the user and finds the transpose of it Question 2 Explain Brief about class and objects. Also describe friend functi

Reading from a Hash table in C, I''m having trouble with my C code to red f...

I''m having trouble with my C code to red from a Hash table. Not sure what it is I''m doing wrong and stumped. I need to get it figured out by tomorrow at 4:00 p.m. Eastern time. C

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd