This module has no guide yet: start with the summary above and the reference in the tabs.
version
Stores and returns the application name and version as a C string, <code>std::string</code> or <code>CAString</code>.
version_inc.hpp
#include <ethereal/cpp/version/version_inc.hpp>version.hpp
#include <ethereal/cpp/version/version.hpp>void SetAppVersion( const char * sProjectName, const char * sVersion );Sets the version of the application/project.
sProjectName- Name of the project or application.
sVersion- Version of the project or application.
const char * GetAppVersion( void );Gets the version of the application.
std::string GetAppSVersion( void );Gets the version of the application.
String::CAString GetAppAVersion( void );Gets the version of the application.
version.h
#include <ethereal/c/version/version.h>C layer of the Version module: the version of the library and the version line of the application.
The library version is the one of the CMake project, compiled into the library (ETHEREAL_VERSION_MAJOR, _MINOR and _PATCH). It is the version of the binary that answers, not of the header the caller compiled with.
The application version is the one of 'ethereal/cpp/version/ version.hpp': the caller gives a name and a version, and the library keeps one line, "<name> v<version> (Build: <date> <time>) <kind>", where date and time are the ones of the library build and kind is "Release (x64)", "Debug (x86)" and so on. The C++ side takes the x64 mark from _WIN64, so outside Windows the kind reads x86 on any machine. The line is cut at 255 bytes. Setting it is not thread safe.
There is no version comparison: the C++ side has none.
Text output always ends in '\0'. The size written does not count it. When the buffer is too small, the call writes the capacity needed (text plus '\0'), so 'uCap = 0' asks for it.
Every export returns 'int'. Zero is success, negative is an error. The values are part of the ABI.
#define ETLC_VERSION_OK ETLC_OKSuccess.
const char * ETLC_VersionStatusName( int iStatus ) noexcept;Name of a status code, in English. Never null: an unknown code gives "unknown".
int ETLC_VersionLibrary( int * pMajor, int * pMinor, int * pPatch ) noexcept;The version of the library binary.
pMajor- Receives the major number.
pMinor- Receives the minor number.
pPatch- Receives the patch number.
int ETLC_VersionLibraryText( char * pOut, size_t uCap, size_t * pWritten ) noexcept;The version of the library binary as text, "<major>.<minor>.<patch>".
pOut- Receives the text.
uCap- Capacity of pOut.
pWritten- Receives the size of the text, or the capacity needed when the buffer is too small. Cannot be null.
int ETLC_VersionSetApp( const char * sName, const char * sVersion ) noexcept;Sets the version line of the application.
sName- Name of the application, null terminated.
sVersion- Version of the application, null terminated.
int ETLC_VersionApp( char * pOut, size_t uCap, size_t * pWritten ) noexcept;The version line of the application. Empty before ETLC_VersionSetApp.
pOut- Receives the text.
uCap- Capacity of pOut.
pWritten- Receives the size of the text, or the capacity needed when the buffer is too small. Cannot be null.