Program of file data, C/C++ Programming

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;


        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;


Posted Date: 10/18/2012 7:47:59 AM | Location : United States

Related Discussions:- Program of file data, Assignment Help, Ask Question on Program of file data, Get Answer, Expert's Help, Program of file data Discussions

Write discussion on Program of file data
Your posts are moderated
Related Questions
A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

Create an array of Strings and fill it with some interesting text, such as vacation destinations, album names, or weapon names from a CRPG. Display three elements of the array on t

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Define a structure to store roll no, name and marks of a student. b) Using the structure of Q2. a), above write a ''C'' program to create a file "student.dat". There must be one r

Project Description: I want a person who will be able to program a flex PCB for my device as i meet the person i will be able to describe all my needs Skills required are C P

Need assignment help What's the order that local objects are destructed?

This is a test program that tests the Student and ITECH7603Class classes.     In this assignment you are provided with three input text files associated with this program:

Using a Friend Using a friend function is quite easy. The following example explains a friend function to access members of two classes. class Bclass;

a program to accept average, if average is 75 to 85 print it out else bypass using counter. enter and process 5 records