Skip to content

Commit

Permalink
Added c_str method for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jun 1, 2024
1 parent 5df529e commit de3318a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/sexpp/sexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ class SEXP_PUBLIC_SYMBOL sexp_simple_string_t : public std::vector<octet_t>,
}

uint32_t as_unsigned() const noexcept;

std::string as_string(void) const
{
return std::string(reinterpret_cast<const char *>(data()), size());
}

std::string c_str(void) const { return as_string(); }

};

inline bool operator==(const sexp_simple_string_t *left, const std::string &right) noexcept
Expand Down

0 comments on commit de3318a

Please sign in to comment.