MCPcopy Create free account
hub / github.com/csyonghe/Spire / SubString

Method SubString

Source/CoreLib/LibString.h:257–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255 }
256
257 String SubString(int id, int len) const
258 {
259 if (len == 0)
260 return "";
261 if (id + len > length)
262 len = length - id;
263#if _DEBUG
264 if (id < 0 || id >= length || (id + len) > length)
265 throw "SubString: index out of range.";
266 if (len < 0)
267 throw "SubString: length less than zero.";
268#endif
269 String res;
270 res.buffer = new char[len + 1];
271 res.length = len;
272 strncpy_s(res.buffer.Ptr(), len + 1, buffer + id, len);
273 res.buffer[len] = 0;
274 return res;
275 }
276
277 const char * Buffer() const
278 {

Callers 11

ReadSourceFunction · 0.80
TruncateExtMethod · 0.80
GetFileNameMethod · 0.80
GetFileNameWithoutEXTMethod · 0.80
GetFileExtMethod · 0.80
GetDirectoryNameMethod · 0.80
ReplaceAllMethod · 0.80
GetFuncOriginalNameMethod · 0.80
ResolveAttributesMethod · 0.80
GetFuncOriginalNameFunction · 0.80
OpBinaryInstrMethod · 0.80

Calls 2

strncpy_sFunction · 0.85
PtrMethod · 0.45

Tested by

no test coverage detected