-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
70 lines (55 loc) · 2.46 KB
/
main.cpp
File metadata and controls
70 lines (55 loc) · 2.46 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <brewtils/base64.h>
#include <brewtils/date.h>
#include <brewtils/env.h>
#include <brewtils/os.h>
#include <brewtils/string.h>
#include <brewtils/url.h>
#include <brewtils/uuid.h>
int main(int argc, char **argv) {
brewtils::env::init("../.env");
logger::info("USER: " + brewtils::env::get("USER", "adit"));
logger::info(brewtils::uuid::v4());
logger::info(brewtils::uuid::v5("6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"hello world"));
std::string data =
" {\"widget\" : {\"debug\" : \"on\", \"window\" : { "
"\"title\" "
": \"Sample Konfabulator Widget\", \"name\" : \"main_window\", "
" \"width\" : 500, \"height\" : 500 }, \"image\" : { "
" \"src\" : \"Images/Sun.png\", \"name\" : \"sun1\", "
"\"hOffset\" : 250, \"vOffset\" : 250, \"alignment\" : "
"\"center\" }, \"text\" : { \"data\" : \"Click Here\", "
" \"size\" : 36, \"style\" : \"bold\", \"name\" : "
"\"text1\", \"hOffset\" : 250, \"vOffset\" : 100, "
"\"alignment\" : \"center\", \"onMouseUp\" : \"sun1.opacity = "
"(sun1.opacity / 100) * 90;\" } } } ";
std::string encoded = brewtils::base64::encode(data);
logger::info(encoded);
std::string decoded = brewtils::base64::decode(encoded);
logger::info(decoded);
std::string trimmedData = brewtils::string::trim(data);
logger::info(trimmedData);
std::vector<std::string> strings = brewtils::string::split(data, " ");
std::string joined = brewtils::string::join(strings, "");
logger::info(joined);
data = "https://www.google.com/search?q=hello+world";
encoded = brewtils::url::encode(data);
logger::info(encoded);
decoded = brewtils::url::decode(encoded);
logger::info(decoded);
for (std::string file : brewtils::os::dir::list("/")) {
logger::info(file);
}
logger::info("---------------------------");
for (std::string file : brewtils::os::dir::tree("../")) {
logger::info(file);
}
logger::info("---------------------------");
logger::info(brewtils::os::isDocker() ? "Running in Docker"
: "Not in Docker");
logger::info("---------------------------");
logger::info(brewtils::os::file::getMimeType("test.txt"));
logger::info("---------------------------");
logger::info(brewtils::date::getCurrentUTC());
return EXIT_SUCCESS;
}