Main Page | Class List | File List | Class Members

InstallVersion Class Reference

#include <version.h>

List of all members.

Public Member Functions

 InstallVersion (char *file, char *date, char *version)


Detailed Description

This is a convienence class, which allows any C++ program to easily maintain a list of all the files + version numbers in it.

Usage is extremely simple, in each C++ file include the following two lines, near the top:

 #include "version.h"
 InstallVersion dummy( __ FILE __, __ DATE __, "$Revision: 1.2 $" );

This will install the current file into the versioning system, which you may then query, like this:

      printf( "\nSource Versions:\n" );
      std::vector< CVersionRecord *> *versions;
      versions = CVersion::GetInstance()->GetVersionRecords();
        
      std::vector< CVersionRecord *>::iterator i;

      for( i = versions->begin(); i != versions->end(); i++ )
      {
          CVersionRecord *v = *i;
          printf("\t%s \t %s\n",
                 v->GetVersion(),
                 v->GetFile() );
      }

See also:
CVersion CVersionRecord
Author:
Steve Kemp http://www.steve.org.uk/
Version:
Revision
1.2


Constructor & Destructor Documentation

InstallVersion::InstallVersion char *  file,
char *  date,
char *  version
[inline]
 

Constructor. The sole purpose of this class, and its constructor is to provide a simple means of instantiating an instance of the CVersion class - then adding information about the current file to it.

This makes manual addition needless, and makes this versioning system simple to use.

Parameters:
file The name of the current source file, use _ _FILE_ _
date The current date, use _ _ DATE _ _
version The version to go along with this string, use
Revision
1.2


The documentation for this class was generated from the following file:
Generated on Tue Oct 25 23:04:38 2005 for fortress by  doxygen 1.4.2