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

When i develop a destructor, When I develop a destructor, do I require to e...

When I develop a destructor, do I require to explicitly call the destructors for my member objects?

C program, Just need the answers to the following 3 questions. "NO NEED to ...

Just need the answers to the following 3 questions. "NO NEED to write a program compile or run it, do not need it. Just need the answers for the following questions. Example quest

Lexicographically preceding permutation, Given an integer n and a permutati...

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Write a program to implement operator functions, Implementing Operator Func...

Implementing Operator Functions The general format of the Operator function is: return_type operator op ( argument list );   Where op is the symbol for the operator be

Priority Queue, Ask question #Minimum 100 words acceptedEducational Objecti...

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Decode the code, Smugglers are becoming very smart day by day. Now they hav...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

How many non-letters are included in the string, Write a fully modular C pr...

Write a fully modular C program that reads in a string of a defined size from the keyboard and reports how many times each letter of the alphabet occurs within that string (ignorin

Displays the lower case and upper case alphabetical letters, Write a progra...

Write a program that displays both the lower case and upper case alphabetical letters using the following Format Lowercase        Uppercase a                        A

What is the maximum number of constructors, Question: (a) (i) Explain...

Question: (a) (i) Explain how class members can be accessed when using objects of the class. Use a suitable example to illustrate your answer. (ii) Explain how the privat

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