#include <ctime>
#include <fstream>
#include <string>
#include <iostream>
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
| main application for getting version / date and generating the ossimVersion.h file. More...
|
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
main application for getting version / date and generating the ossimVersion.h file.
- Parameters
-
Definition at line 30 of file version-config.cpp.
50 std::string versionString =
"Version ";
51 versionString += argv[2];
52 std::string versionNumber = argv[2];
53 std::string majorVersion;
54 std::string minorVersion =
"0";
55 std::string releaseVersion =
"0";
56 std::string::size_type pos1 = std::string::npos;
57 std::string::size_type pos2 = std::string::npos;
59 pos1 = versionNumber.find(
".", 0);
60 if(pos1 != std::string::npos)
62 majorVersion = std::string(versionNumber.begin(),
63 versionNumber.begin()+pos1);
64 pos2 = versionNumber.find(
".", pos1+1);
65 if(pos2 != std::string::npos)
67 minorVersion = std::string(versionNumber.begin()+pos1+1,
68 versionNumber.begin()+pos2);
69 releaseVersion = std::string(versionNumber.begin()+pos2+1,
75 majorVersion = versionNumber;
82 tm* lt = localtime(&t);
83 strftime(s, 11,
"(%Y%m%d)", lt);
87 os <<
"// Auto generated by version-config - DO NOT EDIT\n" 88 <<
"#ifndef ossimVersion_HEADER\n" 89 <<
"#define ossimVersion_HEADER\n" 91 <<
"#include <ossim/ossimConfig.h>\n" 93 <<
"#ifndef OSSIM_VERSION\n" 94 <<
"# define OSSIM_VERSION " <<
"\"" << versionString <<
"\"\n" 95 <<
"# define OSSIM_VERSION_NUMBER " <<
"\"" << versionNumber <<
"\"\n" 96 <<
"# define OSSIM_MAJOR_VERSION_NUMBER " << majorVersion <<
"\n" 97 <<
"# define OSSIM_MINOR_VERSION_NUMBER " << minorVersion <<
"\n" 98 <<
"# define OSSIM_RELEASE_NUMBER " << releaseVersion <<
"\n" 101 <<
"// date format = (yyyymmdd)\n" 102 <<
"#ifndef OSSIM_BUILD_DATE\n" 103 <<
"# define OSSIM_BUILD_DATE " <<
"\"" << date <<
"\"\n" 106 <<
"#endif /* End of #ifndef ossimVersion_HEADER */" 111 std::cout <<
"wrote file: " << argv[1] << std::endl;
std::basic_ofstream< char > ofstream
Class for char output file streams.