E57 Foundation API v1.1.312  Aug. 10, 2011
Functions
examples/Versions.cpp File Reference

example: get versions of the E57 implementation library More...

Include dependency graph for Versions.cpp:

Functions

int main (int, char **)
 Example use of E57Utilities::getVersion function.

Detailed Description

example: get versions of the E57 implementation library

Also see listing at end of this page for source without line numbers (to cut&paste from).

00001 /*** Versions.cpp example: get versions of the E57 implementation library */
00004 #include <iostream>
00005 #include "E57Foundation.h"
00006 using namespace e57;
00007 using namespace std;
00008 
00010 int main(int /*argc*/, char** /*argv*/) {
00011     int astmMajor;
00012     int astmMinor;
00013     ustring libraryId;
00014     E57Utilities().getVersions(astmMajor, astmMinor, libraryId);
00015 
00016     cout << "astm major version     = " << astmMajor << endl;        
00017     cout << "astm minor version     = " << astmMinor << endl;        
00018     cout << "implementation library = " << libraryId << endl;        
00019     return(0);
00020 }

This example program demonstrates the use of a utility function to fetch version information from the underlying API implementation.

The getVersion function is a member function of an object that is created at run-time, by E57Utilities::E57Utilities. The reason for this unusual invocation is explained in E57Utilities::E57Utilities.

Once E57Utilities is constructed on source line 14, the E57Utilities::getVersions function is called which returns three variables that are printed on source lines 16-18.

Once the ASTM draft standard is approved and the testing phase of the Reference Implementation is complete, astmMajor=1 and astmMinor=0 will be returned.

The following console output is produced:

The XML section of the temp._e57 E57 file produced by this example program is as follows:

Here is the source code without line numbers to cut&paste from:

/*** Versions.cpp example: get versions of the E57 implementation library */
#include <iostream>
#include "E57Foundation.h"
using namespace e57;
using namespace std;

int main(int /*argc*/, char** /*argv*/) {
    int astmMajor;
    int astmMinor;
    ustring libraryId;
    E57Utilities().getVersions(astmMajor, astmMinor, libraryId);

    cout << "astm major version     = " << astmMajor << endl;        
    cout << "astm minor version     = " << astmMinor << endl;        
    cout << "implementation library = " << libraryId << endl;        
    return(0);
}
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines