MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / copy

Function copy

example/cacheHierarchy/fkYAML/node.hpp:2438–2445  ·  view source on GitHub ↗

@brief Copys the referenced character sequence values from `pos` by `n` size. @warning Throws an fkyaml::out_of_range exception if the given `pos` is bigger than the length. @param p_str The pointer to a character sequence buffer for output. @param n The number of elements to write into `p_str`. @param pos The offset of the beginning position to copy values. @return The number of elements to be wr

Source from the content-addressed store, hash-verified

2436 /// @param pos The offset of the beginning position to copy values.
2437 /// @return The number of elements to be written into `p_str`.
2438 size_type copy(CharT* p_str, size_type n, size_type pos = 0) const {
2439 if FK_YAML_UNLIKELY (pos > m_len) {
2440 throw fkyaml::out_of_range(static_cast<int>(pos));
2441 }
2442 const size_type rlen = std::min(n, m_len - pos);
2443 traits_type::copy(p_str, mp_str + pos, rlen);
2444 return rlen;
2445 }
2446
2447 /// @brief Constructs a sub basic_str_view object from `pos` by `n` size.
2448 /// @warning Throws an fkyaml::out_of_range exception if the given `pos` is bigger than the length.

Callers 5

output_mrcMethod · 0.85
operator()Method · 0.85
operator()Method · 0.85
compressMethod · 0.85
decompressMethod · 0.85

Calls 1

out_of_rangeClass · 0.85

Tested by

no test coverage detected