MCPcopy Create free account
hub / github.com/catboost/catboost / TEvent

Class TEvent

library/cpp/json/ut/json_reader_fast_ut.cpp:27–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 };
26
27 struct TEvent {
28 ETestEvent Type = E_NO_EVENT;
29
30 i64 INum = 0;
31 double DNum = 0;
32 TString Str;
33
34 TEvent(ETestEvent e = E_NO_EVENT)
35 : Type(e)
36 {
37 }
38
39 TEvent(double v, ETestEvent e)
40 : Type(e)
41 , DNum(v)
42 {
43 }
44
45 TEvent(i64 v, ETestEvent e)
46 : Type(e)
47 , INum(v)
48 {
49 }
50
51 TEvent(TStringBuf t, ETestEvent e)
52 : Type(e)
53 , Str(NEscJ::EscapeJ<true, false>(t))
54 {
55 }
56
57 TString ToString() const {
58 switch (Type) {
59 default:
60 return "YOUFAILED";
61 case E_ERROR:
62 return Sprintf("error: %s", Str.data());
63 case E_DICT_OPEN:
64 return "{";
65 case E_DICT_CLOSE:
66 return "}";
67 case E_ARR_OPEN:
68 return "[";
69 case E_ARR_CLOSE:
70 return "]";
71 case E_NULL:
72 return "null";
73 case E_BOOL:
74 return INum ? "true" : "false";
75 case E_INT:
76 return ::ToString(INum);
77 case E_FLT:
78 return ::ToString(DNum);
79 case E_STR:
80 return Sprintf("%s", Str.data());
81 case E_KEY:
82 return Sprintf("key: %s", Str.data());
83 }
84 }

Callers 7

OnBooleanMethod · 0.70
OnIntegerMethod · 0.70
OnDoubleMethod · 0.70
OnStringMethod · 0.70
OnMapKeyMethod · 0.70
OnErrorMethod · 0.70
DoTestParseMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected