MCPcopy Create free account
hub / github.com/cocos/cocos-engine / stringify

Method stringify

native/cocos/network/SocketIO.cpp:177–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177ccstd::string SocketIOPacket::stringify() const {
178 ccstd::string outS;
179 if (_type == "message") {
180 outS = _args[0];
181 } else {
182 rapidjson::StringBuffer s;
183 rapidjson::Writer<rapidjson::StringBuffer> writer(s);
184
185 writer.StartObject();
186 writer.String("name");
187 writer.String(_name.c_str());
188
189 writer.String("args");
190
191 writer.StartArray();
192
193 for (const auto &item : _args) {
194 writer.String(item.c_str());
195 }
196
197 writer.EndArray();
198 writer.EndObject();
199
200 outS = s.GetString();
201
202 CC_LOG_INFO("create args object: %s:", outS.c_str());
203 }
204
205 return outS;
206}
207
208SocketIOPacketV10x::SocketIOPacketV10x() {
209 _separator = "";

Callers 15

toStringMethod · 0.95
compileDeserializeNativeFunction · 0.80
_deserializeFireClassMethod · 0.80
mergeMethod · 0.80
decodeMeshFunction · 0.80
dequantizeMeshFunction · 0.80
_createUnitMeshMethod · 0.80
escapeForJSFunction · 0.80
parseFunction · 0.80
skeletonJsonStrMethod · 0.80
stringifyFunction · 0.80

Calls 4

EndArrayMethod · 0.80
EndObjectMethod · 0.80
GetStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected