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;

    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;

}

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
Project Description: Online game development Online Live Baccarat Game is needed - client program. - server program(IOCP or ect..). - web program(ASP or PHP or etc..

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

Project Description: Project Description: I am seeking a programmer who will be able to design some software that will allow the user to: 1) Repeatedly monitor Nike twitter a

Deliverables: you are required to upload your c code in the assignment dropbox set in Moodle. You are supposed to work with Linux gcc compiler and pico editor for compiling via the

Find out initial basic feasible solution for the given transportation problem using Least Cost Method (LCM).

Demonstration using Moss Open Source Machine Translation Project Description: Moses is an open source Statistical Machine Translation System. I need someone to provide me a d

I. COURSE DESCRIPTION Develops a working knowledge of object-oriented concepts in areas of classes, inheritance, data structures, error handling, templates and file processing.

A: Multiple providers of libraries might employ common global identifiers causing a name collision whereas an application attempt to link with two or more such libraries. The names

#questio c++ program for drawing thick line

What is Ms dos?