cpp-common/bt2: use bt2c::CStringView in parameters and return values throughout
[babeltrace.git] / src / cpp-common / bt2 / trace-ir.hpp
index 74ad36790ae93ce05741c62d71262b1260f2729b..7171138d340ca309ab900c53198dbc954f6a604b 100644 (file)
@@ -445,7 +445,7 @@ public:
         return bt_stream_get_id(this->libObjPtr());
     }
 
-    void name(const char * const name) const
+    void name(const bt2c::CStringView name) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstStream`.");
 
@@ -456,11 +456,6 @@ public:
         }
     }
 
-    void name(const std::string& name) const
-    {
-        this->name(name.data());
-    }
-
     bt2c::CStringView name() const noexcept
     {
         return bt_stream_get_name(this->libObjPtr());
@@ -637,7 +632,7 @@ public:
 
     Class cls() const noexcept;
 
-    void name(const char * const name) const
+    void name(const bt2c::CStringView name) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
 
@@ -648,11 +643,6 @@ public:
         }
     }
 
-    void name(const std::string& name) const
-    {
-        this->name(name.data());
-    }
-
     bt2c::CStringView name() const noexcept
     {
         return bt_trace_get_name(this->libObjPtr());
@@ -689,7 +679,7 @@ public:
         return _Spec::streamById(this->libObjPtr(), id);
     }
 
-    void environmentEntry(const char * const name, const std::int64_t val) const
+    void environmentEntry(const bt2c::CStringView name, const std::int64_t val) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
 
@@ -700,12 +690,7 @@ public:
         }
     }
 
-    void environmentEntry(const std::string& name, const std::int64_t val) const
-    {
-        this->environmentEntry(name.data(), val);
-    }
-
-    void environmentEntry(const char * const name, const char * const val) const
+    void environmentEntry(const bt2c::CStringView name, const bt2c::CStringView val) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
 
@@ -716,21 +701,6 @@ public:
         }
     }
 
-    void environmentEntry(const std::string& name, const char * const val) const
-    {
-        this->environmentEntry(name.data(), val);
-    }
-
-    void environmentEntry(const char * const name, const std::string& val) const
-    {
-        this->environmentEntry(name, val.data());
-    }
-
-    void environmentEntry(const std::string& name, const std::string& val) const
-    {
-        this->environmentEntry(name.data(), val.data());
-    }
-
     std::uint64_t environmentSize() const noexcept
     {
         return bt_trace_get_environment_entry_count(this->libObjPtr());
@@ -746,16 +716,11 @@ public:
         return ConstEnvironmentEntry {name, ConstValue {libObjPtr}};
     }
 
-    OptionalBorrowedObject<ConstValue> environmentEntry(const char * const name) const noexcept
+    OptionalBorrowedObject<ConstValue> environmentEntry(const bt2c::CStringView name) const noexcept
     {
         return bt_trace_borrow_environment_entry_value_by_name_const(this->libObjPtr(), name);
     }
 
-    OptionalBorrowedObject<ConstValue> environmentEntry(const std::string& name) const noexcept
-    {
-        return this->environmentEntry(name.data());
-    }
-
     template <typename LibValT>
     void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
     {
@@ -942,7 +907,7 @@ public:
         return bt_event_class_get_id(this->libObjPtr());
     }
 
-    void name(const char * const name) const
+    void name(const bt2c::CStringView name) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
 
@@ -953,11 +918,6 @@ public:
         }
     }
 
-    void name(const std::string& name) const
-    {
-        this->name(name.data());
-    }
-
     bt2c::CStringView name() const noexcept
     {
         return bt_event_class_get_name(this->libObjPtr());
@@ -982,7 +942,7 @@ public:
         return bt2s::nullopt;
     }
 
-    void emfUri(const char * const emfUri) const
+    void emfUri(const bt2c::CStringView emfUri) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
 
@@ -993,11 +953,6 @@ public:
         }
     }
 
-    void emfUri(const std::string& emfUri) const
-    {
-        this->emfUri(emfUri.data());
-    }
-
     bt2c::CStringView emfUri() const noexcept
     {
         return bt_event_class_get_emf_uri(this->libObjPtr());
@@ -1285,7 +1240,7 @@ public:
         return bt_stream_class_get_id(this->libObjPtr());
     }
 
-    void name(const char * const name) const
+    void name(const bt2c::CStringView name) const
     {
         static_assert(!std::is_const<LibObjT>::value,
                       "Not available with `bt2::ConstStreamClass`.");
@@ -1297,11 +1252,6 @@ public:
         }
     }
 
-    void name(const std::string& name) const
-    {
-        this->name(name.data());
-    }
-
     bt2c::CStringView name() const noexcept
     {
         return bt_stream_class_get_name(this->libObjPtr());
This page took 0.026362 seconds and 4 git commands to generate.