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
padovan string c++ program

Write a program to illustrate array of structures? struct customer { int id; char name[15]; }; struct customer c[100]; . In the above instance, the array of Structures is

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

Define  T y pe c o m p a t i b i li t y? T o a s s i g n i n t t o s m a l l i n t t h e v a r i a b l e should b e

#questAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets wit

want the codings for these topic in ur experts

People sometimes give their phone numbers using one or more alphabetic characters. Create a program that converts the alphabetic characters to their corresponding numbers. For exam

Description A long time ago in a galaxy far, far away, the country Mafghanistan had n cities and m old roads, where each road connected a pair of cities. Due to the treacherous mo

Presently we are using several spreadsheets to give weekly activity and income reports. Much of the information is being frequently re-keyed into several spreadsheets - we are look

hello i have about 15 hours the dead line I Need a program in c language that''s determine the router ip or the gateway ip of the current NIC example the router ip is: