4646
4747namespace tvm {
4848namespace ffi {
49-
49+ namespace details {
5050/* ! \brief Base class for bytes and string. */
5151class BytesObjBase : public Object , public TVMFFIByteArray {};
5252
@@ -73,8 +73,6 @@ class StringObj : public BytesObjBase {
7373 TVM_FFI_DECLARE_STATIC_OBJECT_INFO (StringObj, Object);
7474};
7575
76- namespace details {
77-
7876// String moved from std::string
7977// without having to trigger a copy
8078template <typename Base>
@@ -115,21 +113,21 @@ class Bytes : public ObjectRef {
115113 * \param other a char array.
116114 */
117115 Bytes (const char * data, size_t size) // NOLINT(*)
118- : ObjectRef(details::MakeInplaceBytes<BytesObj>(data, size)) {}
116+ : ObjectRef(details::MakeInplaceBytes<details:: BytesObj>(data, size)) {}
119117 /* !
120118 * \brief constructor from char [N]
121119 *
122120 * \param other a char array.
123121 */
124122 Bytes (TVMFFIByteArray bytes) // NOLINT(*)
125- : ObjectRef(details::MakeInplaceBytes<BytesObj>(bytes.data, bytes.size)) {}
123+ : ObjectRef(details::MakeInplaceBytes<details:: BytesObj>(bytes.data, bytes.size)) {}
126124 /* !
127125 * \brief constructor from char [N]
128126 *
129127 * \param other a char array.
130128 */
131129 Bytes (std::string other) // NOLINT(*)
132- : ObjectRef(make_object<details::BytesObjStdImpl<BytesObj>>(std::move(other))) {}
130+ : ObjectRef(make_object<details::BytesObjStdImpl<details:: BytesObj>>(std::move(other))) {}
133131 /* !
134132 * \brief Swap this String with another string
135133 * \param other The other string
@@ -163,7 +161,7 @@ class Bytes : public ObjectRef {
163161 */
164162 operator std::string () const { return std::string{get ()->data , size ()}; }
165163
166- TVM_FFI_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (Bytes, ObjectRef, BytesObj);
164+ TVM_FFI_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (Bytes, ObjectRef, details:: BytesObj);
167165
168166 /* !
169167 * \brief Compare two char sequence
@@ -245,7 +243,7 @@ class String : public ObjectRef {
245243 */
246244 template <size_t N>
247245 String (const char other[N]) // NOLINT(*)
248- : ObjectRef(details::MakeInplaceBytes<StringObj>(other, N)) {}
246+ : ObjectRef(details::MakeInplaceBytes<details:: StringObj>(other, N)) {}
249247
250248 /* !
251249 * \brief constructor
@@ -258,37 +256,37 @@ class String : public ObjectRef {
258256 * \param other a char array.
259257 */
260258 String (const char * other) // NOLINT(*)
261- : ObjectRef(details::MakeInplaceBytes<StringObj>(other, std::strlen(other))) {}
259+ : ObjectRef(details::MakeInplaceBytes<details:: StringObj>(other, std::strlen(other))) {}
262260
263261 /* !
264262 * \brief constructor from raw string
265263 *
266264 * \param other a char array.
267265 */
268266 String (const char * other, size_t size) // NOLINT(*)
269- : ObjectRef(details::MakeInplaceBytes<StringObj>(other, size)) {}
267+ : ObjectRef(details::MakeInplaceBytes<details:: StringObj>(other, size)) {}
270268
271269 /* !
272270 * \brief Construct a new string object
273271 * \param other The std::string object to be copied
274272 */
275273 String (const std::string& other) // NOLINT(*)
276- : ObjectRef(details::MakeInplaceBytes<StringObj>(other.data(), other.size())) {}
274+ : ObjectRef(details::MakeInplaceBytes<details:: StringObj>(other.data(), other.size())) {}
277275
278276 /* !
279277 * \brief Construct a new string object
280278 * \param other The std::string object to be moved
281279 */
282280 String (std::string&& other) // NOLINT(*)
283- : ObjectRef(make_object<details::BytesObjStdImpl<StringObj>>(std::move(other))) {}
281+ : ObjectRef(make_object<details::BytesObjStdImpl<details:: StringObj>>(std::move(other))) {}
284282
285283 /* !
286284 * \brief constructor from TVMFFIByteArray
287285 *
288286 * \param other a TVMFFIByteArray.
289287 */
290288 explicit String (TVMFFIByteArray other)
291- : ObjectRef(details::MakeInplaceBytes<StringObj>(other.data, other.size)) {}
289+ : ObjectRef(details::MakeInplaceBytes<details:: StringObj>(other.data, other.size)) {}
292290
293291 /* !
294292 * \brief Swap this String with another string
@@ -423,7 +421,7 @@ class String : public ObjectRef {
423421 */
424422 operator std::string () const { return std::string{get ()->data , size ()}; }
425423
426- TVM_FFI_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (String, ObjectRef, StringObj);
424+ TVM_FFI_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (String, ObjectRef, details:: StringObj);
427425
428426 private:
429427 /* !
0 commit comments