MCPcopy Create free account
hub / github.com/apache/tvm-ffi / String

Class String

include/tvm/ffi/string.h:402–825  ·  view source on GitHub ↗

! * \brief String container class. */

Source from the content-addressed store, hash-verified

400 * \brief String container class.
401 */
402class String {
403 public:
404 /*!
405 * \brief avoid misuse of nullptr
406 */
407 String(std::nullptr_t) = delete; // NOLINT(*)
408 /*!
409 * \brief constructor
410 */
411 String() { data_.InitTypeIndex(TypeIndex::kTVMFFISmallStr); }
412 // constructors from Any
413 /*!
414 * \brief Copy constructor
415 * \param other The other string
416 */
417 String(const String& other) = default; // NOLINT(*)
418 /*!
419 * \brief Move constructor
420 * \param other The other string
421 */
422 String(String&& other) = default; // NOLINT(*)
423 /*!
424 * \brief Copy assignment operator
425 * \param other The other string
426 */
427 String& operator=(const String& other) = default; // NOLINT(*)
428 /*!
429 * \brief Move assignment operator
430 * \param other The other string
431 */
432 String& operator=(String&& other) = default; // NOLINT(*)
433
434 /*!
435 * \brief Swap this String with another string
436 * \param other The other string
437 */
438 void swap(String& other) noexcept { // NOLINT(*)
439 std::swap(data_, other.data_);
440 }
441
442 /*!
443 * \brief Copy assignment operator
444 * \param other The other string
445 */
446 String& operator=(const std::string& other) {
447 String(other).swap(*this); // NOLINT(*)
448 return *this;
449 }
450 /*!
451 * \brief Move assignment operator
452 * \param other The other string
453 */
454 String& operator=(std::string&& other) {
455 String(std::move(other)).swap(*this); // NOLINT(*)
456 return *this;
457 }
458
459 /*!

Callers 15

substrMethod · 0.70
EscapeStringJSONFunction · 0.70
EscapedStringPyFunction · 0.70
MoveFromAnyAfterCheckMethod · 0.70
TypeTraits<String>Class · 0.70
MoveToAnyMethod · 0.70
MoveToAnyMethod · 0.70
MoveToAnyMethod · 0.70
TypeTableMethod · 0.50

Calls 1

swapMethod · 0.45

Tested by 15

SchemaAllTypesObjMethod · 0.40
MaybeConcatMethod · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
ParseMetadataToSchemaFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40