Commit graph

1 commit

Author SHA1 Message Date
John Baldwin
b3127a2dc2 libutil++: New library containing C++ utility classes for use in base
- freebsd::FILE_up is a wrapper class for std::unique_ptr<> for FILE
  objects which uses a custom deleter that calls fclose().

- freebsd::malloc_up<T> is a wrapper class for std::unique_ptr<> which
  uses a custom deleter that calls free().  It is useful for pointers
  allocated by malloc() such as strdup().

- The freebsd::stringf() functions return a std::string constructed
  using a printf format string.

  The current implementation of freebsd::stringf() uses fwopen() where
  the write function appends to a std::string.

Sponsored by:	Chelsio Communications
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1794
2025-08-04 15:38:06 -04:00