Poco库版本打印

Poco库版本打印

#include "Poco/Version.h"
#include <limits>
#include <iostream>
#include <cstring>
#include <string>

int main()
{
    
    
int ver = POCO_VERSION;
char ch[4]={
    
    0};
ch[0] = (char)ver;
ch[1] = *((char*)&ver + 1);
ch[2] = *((char*)&ver + 2);
ch[3] = *((char*)&ver + 3);
std::string version = std::to_string((int)ch[3]) + "." + std::to_string((int)ch[2]) + "." +  std::to_string( (int)ch[1]) + "." + std::to_string((int)ch[0]);
std::cout << version << std::endl;
return 0;
}

Version.h文件:

//
// Version.h
//
// Library: Foundation
// Package: Core
// Module:  Version
//
// Version information for the POCO C++ Libraries.
//
// Copyright (c) 2004-2016, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier:	BSL-1.0
//


#ifndef Foundation_Version_INCLUDED
#define Foundation_Version_INCLUDED


//
// Version Information
//
// Since 1.6.0, we're using Semantic Versioning 2.0
// (http://semver.org/spec/v2.0.0.html)
//
// Version format is 0xAABBCCDD, where
//    - AA is the major version number,
//    - BB is the minor version number,
//    - CC is the patch	version number, and
//    - DD is the pre-release designation/number.
//      The pre-release designation hex digits have a special meaning:
//      00: final/stable releases
//      Dx: development releases
//      Ax: alpha releases
//      Bx: beta releases
//
#define POCO_VERSION 0x010A0100


#endif // Foundation_Version_INCLUDED

猜你喜欢

转载自blog.csdn.net/weixin_44328568/article/details/116135608