seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
seams::detail Namespace Reference

Classes

class  Handle

Functions

void check (int status, const void *handle)
template<class Call>
std::string copy_text (Call call, const void *handle)

Function Documentation

◆ check()

void seams::detail::check ( int status,
const void * handle )
inline

Definition at line 557 of file seams.hpp.

557 {
558 if (status == SEAMS_OK) {
559 return;
560 }
561 const char *text = seams_handle_error(handle);
562 throw Error(status, text == nullptr ? std::string() : std::string(text));
563}
Failure from the C API, or from a rejected argument.
Definition seams.hpp:177
SEAMS_API const char * seams_handle_error(const void *handle)
Detail string stored on a handle.
@ SEAMS_OK
The call succeeded.
Definition seams.h:154

◆ copy_text()

template<class Call>
std::string seams::detail::copy_text ( Call call,
const void * handle )
inline

Definition at line 597 of file seams.hpp.

597 {
598 std::size_t n_out = 0;
599 check(call(handle, nullptr, 0, &n_out), handle);
600 std::string text(n_out + 1, '\0');
601 check(call(handle, text.data(), text.size(), &n_out), handle);
602 text.resize(n_out);
603 return text;
604}
void check(int status, const void *handle)
Definition seams.hpp:557