Skip to content
Snippets Groups Projects
Commit 6349451c authored by Juergen Hannappel's avatar Juergen Hannappel
Browse files

add function to create a aspao-string from a c string

parent 2aa9bf48
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ void* asapo_new_handle(); ...@@ -20,6 +20,7 @@ void* asapo_new_handle();
void asapo_error_explain(const AsapoErrorHandle error, char* buf, size_t max_size); void asapo_error_explain(const AsapoErrorHandle error, char* buf, size_t max_size);
AsapoBool asapo_is_error(AsapoErrorHandle err); AsapoBool asapo_is_error(AsapoErrorHandle err);
AsapoStringHandle asapo_string_create(const char* str);
const char* asapo_string_c_str(const AsapoStringHandle str); const char* asapo_string_c_str(const AsapoStringHandle str);
size_t asapo_string_size(const AsapoStringHandle str); size_t asapo_string_size(const AsapoStringHandle str);
......
...@@ -32,6 +32,12 @@ AsapoHandle* handle_or_null(AsapoHandle* handle, AsapoErrorHandle* error, asapo: ...@@ -32,6 +32,12 @@ AsapoHandle* handle_or_null(AsapoHandle* handle, AsapoErrorHandle* error, asapo:
extern "C" { extern "C" {
AsapoStringHandle asapo_string_create(const char* str) {
return AsapoStringHandle(new std::string(str));
}
//! free handle memory, set handle to NULL //! free handle memory, set handle to NULL
/// \param[in] pointer to an ASAPO handle /// \param[in] pointer to an ASAPO handle
void asapo_free_handle(void** handle) { void asapo_free_handle(void** handle) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment