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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值