MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / to_string

Method to_string

libminifi/src/utils/Id.cpp:110–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110SmallString<36> Identifier::to_string() const {
111 SmallString<36> uuidStr;
112 // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx is 36 long: 16 bytes * 2 hex digits / byte + 4 hyphens
113 int byteIdx = 0;
114 int charIdx = 0;
115
116 // [xxxxxxxx]-xxxx-xxxx-xxxx-xxxxxxxxxxxx
117 while (byteIdx < 4) {
118 uuidStr[charIdx++] = hex_lut[data_[byteIdx] >> 4];
119 uuidStr[charIdx++] = hex_lut[data_[byteIdx++] & 0xf];
120 }
121 // xxxxxxxx[-]xxxx-xxxx-xxxx-xxxxxxxxxxxx
122 uuidStr[charIdx++] = '-';
123
124 // xxxxxxxx-[xxxx-xxxx-xxxx-]xxxxxxxxxxxx - 3x 2 bytes and a hyphen
125 for (int idx = 0; idx < 3; ++idx) {
126 uuidStr[charIdx++] = hex_lut[data_[byteIdx] >> 4];
127 uuidStr[charIdx++] = hex_lut[data_[byteIdx++] & 0xf];
128 uuidStr[charIdx++] = hex_lut[data_[byteIdx] >> 4];
129 uuidStr[charIdx++] = hex_lut[data_[byteIdx++] & 0xf];
130 uuidStr[charIdx++] = '-';
131 }
132
133 // xxxxxxxx-xxxx-xxxx-xxxx-[xxxxxxxxxxxx] - the rest, i.e. until byte 16
134 while (byteIdx < 16) {
135 uuidStr[charIdx++] = hex_lut[data_[byteIdx] >> 4];
136 uuidStr[charIdx++] = hex_lut[data_[byteIdx++] & 0xf];
137 }
138
139 // null terminator
140 uuidStr[charIdx] = 0;
141 return uuidStr;
142}
143
144utils::optional<Identifier> Identifier::parse(const std::string &str) {
145 Identifier id;

Callers 15

create_processorFunction · 0.45
create_instance_objFunction · 0.45
generateMethod · 0.45
DeSerializeMethod · 0.45
stopMethod · 0.45
onScheduleMethod · 0.45
setImplMethod · 0.45
getImplMethod · 0.45
removeImplMethod · 0.45
setPropertyMethod · 0.45
getDynamicPropertyMethod · 0.45

Calls

no outgoing calls

Tested by 2

create_instance_objFunction · 0.36