FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-sdk/samples/main.cpp at main · configcat/cpp-sdk · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
configcat
/
cpp-sdk
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
22
Code
Issues
0
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-sdk
/
samples
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (27 loc) · 1.15 KB
Breadcrumbs
cpp-sdk
/
samples
/
main.cpp
Copy path
File metadata and controls
35 lines (27 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
include
<
configcat/configcat.h
>
#
include
<
configcat/consolelogger.h
>
#
include
<
iostream
>
using
namespace
std
;
using
namespace
configcat
;
int
main
(
int
/*
argc
*/
,
char
**
/*
argv
*/
) {
//
Info level logging helps to inspect the feature flag evaluation process.
//
Use the default warning level to avoid too detailed logging in your application.
auto
logger = make_shared<ConsoleLogger>(
LOG_LEVEL_INFO
);
//
Print the ConfigCat C++ SDK version.
cout <<
"
ConfigCat C++ SDK version:
"
<< configcat::version << endl;
//
Initialize the ConfigCatClient with an SDK Key.
ConfigCatOptions options;
options.
logger
= logger;
auto
client =
ConfigCatClient::get
(
"
PKDVCLf-Hq-h-kCzMp-L7Q/HhOWfwVtZ0mb30i9wi17GQ
"
, &options);
//
Creating a user object to identify your user (optional).
auto
user =
ConfigCatUser::create
(
"
user-id
"
,
"
configcat@example.com
"
,
"
country
"
,
{ {
"
version
"
,
"
1.0.0
"
} }
);
bool
value = client->
getValue
(
"
isPOCFeatureEnabled
"
,
false
, user);
cout <<
"
isPOCFeatureEnabled value from ConfigCat:
"
<< (value ==
true
?
"
true
"
:
"
false
"
);
ConfigCatClient::closeAll
();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL