diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-16 14:20:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-08-16 14:20:15 +0100 |
commit | ef583245356015ce29961e0f7ffdb5880edc5fc2 (patch) | |
tree | c4c8aa3149da38f443a75bf63d2d33d0dab9a61c /src/libutil | |
parent | 5ffee59dfce8b60669f93fc59c8304f9ec4703f7 (diff) | |
download | rspamd-ef583245356015ce29961e0f7ffdb5880edc5fc2.tar.gz rspamd-ef583245356015ce29961e0f7ffdb5880edc5fc2.zip |
[Rework] More steps to do refactoring
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/cxx/file_util.hxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libutil/cxx/file_util.hxx b/src/libutil/cxx/file_util.hxx index a0c624726..45289053e 100644 --- a/src/libutil/cxx/file_util.hxx +++ b/src/libutil/cxx/file_util.hxx @@ -1,11 +1,11 @@ -/*- - * Copyright 2022 Vsevolod Stakhov +/* + * Copyright 2023 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -33,7 +33,16 @@ public: virtual ~raii_file() noexcept; static auto open(const char *fname, int flags) -> tl::expected<raii_file, error>; + static auto open(const std::string &fname, int flags) -> tl::expected<raii_file, error> + { + return open(fname.c_str(), flags); + }; static auto create(const char *fname, int flags, int perms) -> tl::expected<raii_file, error>; + static auto create(const std::string &fname, int flags, int perms) -> tl::expected<raii_file, error> + { + return create(fname.c_str(), flags, perms); + }; + static auto create_temp(const char *fname, int flags, int perms) -> tl::expected<raii_file, error>; static auto mkstemp(const char *pattern, int flags, int perms) -> tl::expected<raii_file, error>; |