#include <babeltrace2/babeltrace.h>
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "cpp-common/uuid-view.hpp"
#include "borrowed-object.hpp"
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_clock_class_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_clock_class_get_name(this->libObjPtr());
}
void description(const char * const description) const
this->description(description.data());
}
- nonstd::optional<bpstd::string_view> description() const noexcept
+ const char *description() const noexcept
{
- const auto description = bt_clock_class_get_description(this->libObjPtr());
-
- if (description) {
- return description;
- }
-
- return nonstd::nullopt;
+ return bt_clock_class_get_description(this->libObjPtr());
}
void uuid(const std::uint8_t * const uuid) const noexcept
#include "common/assert.h"
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "borrowed-object-iterator.hpp"
#include "borrowed-object.hpp"
internal::ConstEnumerationFieldClassMappingSpec<LibObjT>::ranges(this->libObjPtr())};
}
- bpstd::string_view label() const noexcept
+ const char *label() const noexcept
{
return internal::ConstEnumerationFieldClassMappingSpec<LibObjT>::label(this->libObjPtr());
}
return CommonStructureFieldClassMember<const bt_field_class_structure_member> {*this};
}
- bpstd::string_view name() const noexcept
+ const char *name() const noexcept
{
return bt_field_class_structure_member_get_name(this->libObjPtr());
}
return CommonVariantFieldClassOption<const bt_field_class_variant_option> {*this};
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_field_class_variant_option_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_field_class_variant_option_get_name(this->libObjPtr());
}
_FieldClass fieldClass() const noexcept
return ConstVariantFieldClassOption {_Spec::asBaseOption(this->libObjPtr())};
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
return this->asBaseOption().name();
}
#include "common/assert.h"
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "borrowed-object.hpp"
#include "field-class.hpp"
return _mLen;
}
- bpstd::string_view operator[](const std::uint64_t index) const noexcept
+ const char *operator[](const std::uint64_t index) const noexcept
{
return _mLabels[index];
}
#include <babeltrace2/babeltrace.h>
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "borrowed-object.hpp"
#include "clock-class.hpp"
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_stream_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_stream_get_name(this->libObjPtr());
}
template <typename LibValT>
struct ConstEnvironmentEntry
{
- bpstd::string_view name;
+ const char *name;
ConstValue value;
};
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_trace_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_trace_get_name(this->libObjPtr());
}
void uuid(const bt2_common::UuidView& uuid) const noexcept
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_event_class_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_event_class_get_name(this->libObjPtr());
}
void logLevel(const LogLevel logLevel) const noexcept
this->emfUri(emfUri.data());
}
- nonstd::optional<bpstd::string_view> emfUri() const noexcept
+ const char *emfUri() const noexcept
{
- const auto emfUri = bt_event_class_get_emf_uri(this->libObjPtr());
-
- if (emfUri) {
- return emfUri;
- }
-
- return nonstd::nullopt;
+ return bt_event_class_get_emf_uri(this->libObjPtr());
}
void payloadFieldClass(const StructureFieldClass fc) const
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_stream_class_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_stream_class_get_name(this->libObjPtr());
}
void assignsAutomaticEventClassId(const bool val) const noexcept
#include "common/assert.h"
#include "common/common.h"
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "borrowed-object-iterator.hpp"
#include "borrowed-object.hpp"
* First argument is the entry's key, second is its value.
*/
template <typename ObjT>
-using CommonMapValueForEachUserFunc = std::function<void(const bpstd::string_view&, ObjT)>;
+using CommonMapValueForEachUserFunc = std::function<void(const char *, ObjT)>;
/*
* Template of a function to be passed to bt_value_map_foreach_entry()