Skip to content

Commit

Permalink
Added sexp_simple_string_t::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 25bd9d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/sexpp/sexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ 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 25bd9d7

Please sign in to comment.