-
Notifications
You must be signed in to change notification settings - Fork 2
/
version.cpp
41 lines (36 loc) · 1.4 KB
/
version.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* @file version.cpp
* @author Callum Prentice via Nat Goodspeed
* @date 2020-04-30
* @brief Report library version number - C++ version
* For a library whose version number is tracked in a C++ header
* file, it's more robust to build a helper program to report it than
* to manually parse the header file. The library might change the
* syntax with which it defines the version number, but we can assume
* it will remain valid C / C++.
*
* $LicenseInfo:firstyear=2014&license=internal$
* Copyright (c) 2020, Linden Research, Inc.
* $/LicenseInfo$
*/
#include <iostream>
#include <string>
#include "cef_version.h"
int main(int argc, char* argv[])
{
std::string cef_version = std::string(CEF_VERSION);
// CEF version strings now (as of v75) contain '+' symbols and since we use the
// version string to compose the name of the package and therefore the download
// URL in TeamCity/CodeTicket, this character (not URL escaped) breaks downloads.
// Rather than try to fix CodeTicket to URL escape the package name, we replace
// the bad characters with a good one that is allowed in a URL.
std::string bad = "+";
std::string good = "_";
size_t pos;
while ((pos = cef_version.find(bad)) != std::string::npos)
{
cef_version.replace(pos, 1, good);
}
std::cout << cef_version;
std::cout << std::endl;
}