Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

strtmesg.cpp

Go to the documentation of this file.
00001 /*
00002     This file is part of Advanced Strategic Command; http://www.asc-hq.de
00003     Copyright (C) 1994-2005  Martin Bickel  and  Marc Schellenberger
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; see the file COPYING. If not, write to the
00017     Free Software Foundation, Inc., 59 Temple Place, Suite 330,
00018     Boston, MA  02111-1307  USA
00019 */
00020 
00021 
00022 // These strings should be the same as the release tags in CVS !
00023 // don't alter the format of this string, as quite a lot of tools evaluate it!
00024 const char* asc_release="ASC2.1.4.2";
00025 
00026 #include <stdio.h>
00027 #include "strtmesg.h"
00028 #include "stringtokenizer.h"
00029 #include "misc.h"
00030 
00031 
00032 const char* getVersionString()
00033 {
00034   return &asc_release[3];
00035 }
00036 
00037 int getNumericVersion()
00038 {
00039    int vers = 0;
00040    const char* d = asc_release+3;
00041    for ( int i = 0; i < 4; i++ ) {
00042       vers *= 256;
00043       if ( *d ) {
00044          const char* start = d;
00045          do 
00046            d++;
00047          while ( *d != '.' && *d != 0 );
00048 
00049          ASCString s ( start, d-start );
00050          vers += atoi ( s.c_str() );
00051          if ( *d )
00052            d++;
00053       }
00054    }
00055    return vers;
00056 }
00057 
00058 const char* getFullVersionString (  )
00059 {
00060   return asc_release;
00061 }
00062 
00063 ASCString getVersionAndCompilation()
00064 {
00065    char startupmessagebuffer[1000];
00066    sprintf( startupmessagebuffer, "Version: %s\nCompiled %s      %s\n", asc_release, __DATE__, __TIME__);
00067    return ASCString(startupmessagebuffer);
00068 }
00069 
00070 ASCString getstartupmessage (  )
00071 {
00072    ASCString s = "\nAdvanced Strategic Command\n" + getVersionAndCompilation();
00073    return s;
00074 }
00075 
00076 ASCString getaboutmessage (  )
00077 {
00078     char startupmessagebuffer[1000];
00079     sprintf( startupmessagebuffer, "Advanced Strategic Command : %s ; made %s ; %s", asc_release, __DATE__, __TIME__);
00080     return ASCString(startupmessagebuffer);
00081 }
00082 
00083 ASCString kgetstartupmessage (  )
00084 {
00085     char startupmessagebuffer[1000];
00086     sprintf( startupmessagebuffer, "\n      Mapeditor for\nAdvanced Strategic Command \n%s\nmade %s      %s\n\n", asc_release, __DATE__, __TIME__);
00087     return ASCString(startupmessagebuffer);
00088 }
00089 
00090 ASCString kgetaboutmessage (  )
00091 {
00092     char startupmessagebuffer[1000];
00093     sprintf( startupmessagebuffer, "Mapeditor for Advanced Strategic Command : %s ; made %s ; %s", asc_release, __DATE__, __TIME__);
00094     return ASCString(startupmessagebuffer);
00095 }
00096 
00097 ASCString getVersionString ( int version )
00098 {
00099    ASCString s = strrr(version>>24);
00100    s += ".";
00101    s += strrr((version>>16) & 0xff);
00102    s += ".";
00103    s += strrr((version>>8) & 0xff);
00104    s += ".";
00105    s += strrr(version & 0xff);
00106    return s;
00107 }
00108 

Generated on Tue Jun 24 01:27:52 2008 for Advanced Strategic Command by  doxygen 1.4.2