Skip to content

Commit 49452ce

Browse files
committed
Address rabbit comments.
1 parent 26449d8 commit 49452ce

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

components/core/src/clp_s/FileWriter.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <cstdio>
77
#include <string>
8+
#include <utility>
89

910
#include "ErrorCode.hpp"
1011
#include "TraceableException.hpp"
@@ -34,18 +35,16 @@ class FileWriter {
3435
auto operator=(FileWriter const&) -> FileWriter& = delete;
3536

3637
// Define custom move constructor/assignment operator
37-
FileWriter(FileWriter&& writer) {
38-
m_file = writer.m_file;
39-
m_fd = writer.m_fd;
40-
writer.m_file = nullptr;
41-
writer.m_fd = -1;
42-
}
38+
FileWriter(FileWriter&& writer)
39+
: m_file{std::exchange(writer.m_file, nullptr)},
40+
m_fd{std::exchange(writer.m_fd, -1)} {}
4341

4442
auto operator=(FileWriter&& writer) -> FileWriter& {
45-
m_file = writer.m_file;
46-
m_fd = writer.m_fd;
47-
writer.m_file = nullptr;
48-
writer.m_fd = -1;
43+
if (this == &writer) {
44+
return *this;
45+
}
46+
m_file = std::exchange(writer.m_file, nullptr);
47+
m_fd = std::exchange(writer.m_fd, -1);
4948
return *this;
5049
}
5150

components/core/src/clp_s/log_converter/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(
22
CLP_S_CONVERTER_SOURCES
33
CommandLineArguments.cpp
4-
CommandLineArguments.cpp
4+
CommandLineArguments.hpp
55
LogConverter.cpp
66
LogConverter.hpp
77
LogSerializer.cpp
@@ -19,7 +19,9 @@ if(CLP_BUILD_EXECUTABLES)
1919
log-converter
2020
PRIVATE
2121
Boost::program_options
22+
clp_s::clp_dependencies
2223
clp_s::io
24+
fmt::fmt
2325
log_surgeon::log_surgeon
2426
msgpack-cxx
2527
nlohmann_json::nlohmann_json

components/core/src/clp_s/log_converter/LogConverter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ constexpr std::string_view cTimestampSchema{
3232
R"((Dec(ember){0,1}))[ /\-]\d{2,4})[ T:][ 0-9]{2}:[ 0-9]{2}:[ 0-9]{2})"
3333
R"(([,\.:]\d{1,9}){0,1}([ ]{0,1}(UTC){0,1}[\+\-]\d{2}(:{0,1}\d{2}){0,1}Z{0,1}){0,1})"
3434
};
35-
constexpr std::string_view cDelimeters{R"(delimiters: \t\r\n\[\(:)"};
35+
constexpr std::string_view cDelimiters{R"(delimiters: \t\r\n\[\(:)"};
3636
} // namespace
3737

3838
auto LogConverter::refill_buffer(std::shared_ptr<clp::ReaderInterface>& reader)
@@ -84,7 +84,7 @@ auto LogConverter::convert_file(
8484
std::string_view output_dir
8585
) -> bool {
8686
log_surgeon::Schema schema;
87-
schema.add_delimiters(cDelimeters);
87+
schema.add_delimiters(cDelimiters);
8888
schema.add_variable(cTimestampSchema, -1);
8989
log_surgeon::BufferParser parser{std::move(schema.release_schema_ast_ptr())};
9090
parser.reset();

components/core/src/clp_s/log_converter/log_converter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using clp_s::log_converter::LogConverter;
2121

2222
namespace {
2323
/**
24-
* Checks for and logs CURl errors on a reader.
24+
* Checks for and logs CURL errors on a reader.
2525
* @param path The path that the reader has opened.
2626
* @param reader The open reader which may have experienced a CURL error.
2727
* @return Whether a CURL error has occurred on the reader.

0 commit comments

Comments
 (0)