diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-17 19:42:29 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-17 19:42:29 -0500 |
commit | 8249b28bea29e8ce17eac12776a60ec3f9e47176 (patch) | |
tree | 98318d7564b5f618cfb59e23cc6b918fcab88ee8 /include/libfud.hpp | |
parent | b32e83ece42cec5aa9dee370bcdf349d23dbc8ba (diff) |
Rename InvalidInput to ArgumentInvalid.
Diffstat (limited to 'include/libfud.hpp')
-rw-r--r-- | include/libfud.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/libfud.hpp b/include/libfud.hpp index 5bc1630..bff791d 100644 --- a/include/libfud.hpp +++ b/include/libfud.hpp @@ -19,6 +19,7 @@ #define LIBFUD_HPP #include "fud_array.hpp" +#include "fud_allocator.hpp" #include "fud_result.hpp" #include "fud_status.hpp" #include "fud_string.hpp" @@ -43,12 +44,13 @@ FUD fud(); * \brief Get an environmental variable if it exists. * * \param[in] name The name of the variable to look up. + * \param[in] allocator The allocator used by the string returned. * * \retstmt The value of the string bound to the variable if it exists. * \retcode FudStatus::NullPointer if name is a null pointer. * \retcode FudStatus::NotFound if no binding for the variable exists. */ -Result<String, FudStatus> getEnv(const char* name); +Result<String, FudStatus> getEnv(const char* name, Allocator* allocator= &globalFudAllocator); template <typename T> concept CStringRepr = requires(T strObj) { @@ -56,9 +58,9 @@ concept CStringRepr = requires(T strObj) { }; template <CStringRepr T> -Result<String, FudStatus> getEnv(const T& name) +Result<String, FudStatus> getEnv(const T& name, Allocator* allocator = &globalFudAllocator) { - return getEnv(name.c_str()); + return getEnv(name.c_str(), allocator); } } // namespace fud |