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

C++ Program Please see where i do mistake, #include #include #include ...

#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

Decode the code, smugglers transfer the messages from one to another by usi...

smugglers transfer the messages from one to another by using the mobile

Calculate the area of circle using c program, Calculate the area of circle ...

Calculate the area of circle using c program: const float Pi = 3.1415926;   inline float area(const float r) {return Pi * r * r;}   main() {    float radius;

Built a web crawler , To develop a web crawler such that when given a base ...

To develop a web crawler such that when given a base URL, it will traverse the entire web tree and then build an index of keywords and what URL link they appear on.   The web crawl

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Program, program to check whether a given point lies inside a rectangle or ...

program to check whether a given point lies inside a rectangle or not

Linear search in array - c program, Linear search in array - C program: ...

Linear search in array - C program: Write a program in c to define a linear search in array. void main()                 {                 clrscr();

Boolean functions and simple logic design, The digital signal is one which ...

The digital signal is one which only consists of two states i.e. logic '1'   (+5 volts) and logic '0' (0 volts). Various electronic blocks use logic and these form the basis of a m

Calculation, write a program to calculate the cuboid

write a program to calculate the cuboid

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