-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix revision ID - move version interface out of the exception header - add better interface to get ASTM & library versions - deprecate Utilities::getVersions()
- Loading branch information
Showing
11 changed files
with
144 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#pragma once | ||
// Copyright © 2022 Andy Maloney <asmaloney@gmail.com> | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// @file E57Version.h ASTM & libE57Format version information. | ||
|
||
#include <string> | ||
|
||
#include "E57Export.h" | ||
|
||
namespace e57 | ||
{ | ||
namespace Version | ||
{ | ||
/*! | ||
@brief Get the version of the ASTM E57 standard that libE57Format supports. | ||
@returns The version as a string (e.g. "1.0") | ||
*/ | ||
E57_DLL std::string astm(); | ||
|
||
/*! | ||
@brief Get the major version of the ASTM E57 standard that libE57Format supports. | ||
@returns The major version | ||
*/ | ||
E57_DLL uint32_t astmMajor(); | ||
|
||
/*! | ||
@brief Get the minor version of the ASTM E57 standard that libE57Format supports. | ||
@returns The minor version | ||
*/ | ||
E57_DLL uint32_t astmMinor(); | ||
|
||
/*! | ||
@brief Get the version of libE57Format library. | ||
@returns The version as a string (e.g. "E57Format-3.0.0-x86_64-darwin"). | ||
*/ | ||
E57_DLL std::string library(); | ||
|
||
/*! | ||
@brief Get the version of ASTM E57 standard that the API implementation supports, and library | ||
id string. | ||
@param [out] astmMajor The major version number of the ASTM E57 standard supported. | ||
@param [out] astmMinor The minor version number of the ASTM E57 standard supported. | ||
@param [out] libraryId A string identifying the implementation of the API. | ||
@details | ||
Since the E57 implementation may be dynamically linked underneath the API, the version string | ||
for the implementation and the ASTM version that it supports can't be determined at | ||
compile-time. This function returns these identifiers from the underlying implementation. | ||
@throw No E57Exceptions. | ||
*/ | ||
E57_DLL void get( uint32_t &astmMajor, uint32_t &astmMinor, std::string &libraryId ); | ||
} | ||
|
||
namespace Utilities | ||
{ | ||
/*! | ||
@copydetails Version::get() | ||
@deprecated Will be removed in 4.0. Use Version::get() or other functions in the Version | ||
namespace. | ||
*/ | ||
[[deprecated( "Will be removed in 4.0. Use Version::get() or other functions in the Version " | ||
"namespace." )]] E57_DLL void | ||
getVersions( int &astmMajor, int &astmMinor, std::string &libraryId ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Copyright 2020 Andy Maloney <asmaloney@gmail.com> | ||
|
||
#include <sstream> | ||
|
||
#include "ASTMVersion.h" | ||
#include "E57Version.h" | ||
|
||
namespace e57 | ||
{ | ||
// REVISION_ID should be passed from compiler command line | ||
#ifndef REVISION_ID | ||
#error "Need to specify REVISION_ID on command line" | ||
#endif | ||
|
||
std::string Version::astm() | ||
{ | ||
std::ostringstream stringStream; | ||
stringStream << E57_FORMAT_MAJOR << "." << E57_FORMAT_MINOR; | ||
return stringStream.str(); | ||
} | ||
|
||
uint32_t Version::astmMajor() | ||
{ | ||
return E57_FORMAT_MAJOR; | ||
} | ||
|
||
uint32_t Version::astmMinor() | ||
{ | ||
return E57_FORMAT_MINOR; | ||
} | ||
|
||
std::string Version::library() | ||
{ | ||
return REVISION_ID; | ||
} | ||
|
||
void Version::get( uint32_t &astmMajor, uint32_t &astmMinor, std::string &libraryId ) | ||
{ | ||
astmMajor = E57_FORMAT_MAJOR; | ||
astmMinor = E57_FORMAT_MINOR; | ||
libraryId = REVISION_ID; | ||
} | ||
|
||
namespace Utilities | ||
{ | ||
void getVersions( int &astmMajor, int &astmMinor, std::string &libraryId ) | ||
{ | ||
astmMajor = E57_FORMAT_MAJOR; | ||
astmMinor = E57_FORMAT_MINOR; | ||
libraryId = REVISION_ID; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters