summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2025-01-02 16:27:56 -0600
committerDominick Allen <djallen@librehumanitas.org>2025-01-02 16:27:56 -0600
commit8f12614f2da8221438a3807b1d234517650fbdb6 (patch)
tree18b4aebe99b1d64628546ca5811c10aeb139f1e7 /include
parent87071200872c2450c947047350132aee493033c1 (diff)
Clang tidy fixes.
Diffstat (limited to 'include')
-rw-r--r--include/fud_csv.hpp19
-rw-r--r--include/fud_option.hpp2
-rw-r--r--include/fud_vector.hpp2
3 files changed, 14 insertions, 9 deletions
diff --git a/include/fud_csv.hpp b/include/fud_csv.hpp
index 38b1b81..237c56f 100644
--- a/include/fud_csv.hpp
+++ b/include/fud_csv.hpp
@@ -25,8 +25,6 @@
#include "fud_utf8.hpp"
#include "fud_vector.hpp"
-#include <functional> // reference_wrapper
-
namespace fud {
using TextBuffer = Vector<std::byte>;
@@ -70,19 +68,26 @@ struct Csv {
static Csv make(Allocator& entryAllocator, Allocator& bufferAllocator);
/** Consume and return the CSV. */
- static FudStatus parseFromFilename(
+ static FudStatus parseFromFilenameUnbuffered(
+ Csv& csv,
+ StringView filename,
+ OpenFlags flags = OpenFlags{},
+ Option<int> dirFdOption = NullOpt,
+ size_t maxExtraAttempts = 0);
+
+ static FudStatus parseFromFilenameBuffered(
Csv& csv,
- Option<TextBuffer&&> bufferOption,
+ TextBuffer&& buffer,
StringView filename,
OpenFlags flags = OpenFlags{},
Option<int> dirFdOption = NullOpt,
- Option<size_t> maxExtraAttempts = NullOpt);
+ size_t maxExtraAttempts = 0);
// assumes file is at start
- static FudStatus parseFromUnbufferedFile(Csv& csv, RegularFile&& file, Option<size_t> maxExtraAttempts);
+ static FudStatus parseFromUnbufferedFile(Csv& csv, RegularFile&& file, size_t maxExtraAttempts);
// assumes file is at start
- static FudStatus parseFromBufferedFile(Csv& csv, BufferedRegularFile& file, Option<size_t> maxExtraAttempts);
+ static FudStatus parseFromBufferedFile(Csv& csv, BufferedRegularFile& file, size_t maxExtraAttempts);
};
} // namespace fud
diff --git a/include/fud_option.hpp b/include/fud_option.hpp
index af2fcd3..3c94eaa 100644
--- a/include/fud_option.hpp
+++ b/include/fud_option.hpp
@@ -229,7 +229,7 @@ class Option {
m_data.clear();
}
- static constexpr auto Align = std::max(alignof(T), alignof(std::reference_wrapper<T>));
+ static constexpr auto Align = std::max(alignof(ValueType), alignof(std::reference_wrapper<ValueType>));
alignas(Align) option_detail::DataArray<Size> m_data{};
bool m_engaged;
diff --git a/include/fud_vector.hpp b/include/fud_vector.hpp
index 1730c50..2942e71 100644
--- a/include/fud_vector.hpp
+++ b/include/fud_vector.hpp
@@ -205,7 +205,7 @@ class Vector {
return FudStatus::NullPointer;
}
} else {
- allocator = rhs.allocator;
+ allocator = rhs.m_allocator;
if (allocator == nullptr) {
return FudStatus::ArgumentInvalid;
}