protocol/ArgParser: use libfmt
This commit is contained in:
parent
149d1a2f47
commit
1132a1c9a7
@ -5,17 +5,15 @@
|
|||||||
#include "RangeArg.hxx"
|
#include "RangeArg.hxx"
|
||||||
#include "Ack.hxx"
|
#include "Ack.hxx"
|
||||||
#include "Chrono.hxx"
|
#include "Chrono.hxx"
|
||||||
|
#include "lib/fmt/ToBuffer.hxx"
|
||||||
#include "util/NumberParser.hxx"
|
#include "util/NumberParser.hxx"
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static inline ProtocolError
|
static inline ProtocolError
|
||||||
MakeArgError(const char *msg, const char *value) noexcept
|
MakeArgError(const char *msg, const char *value) noexcept
|
||||||
{
|
{
|
||||||
char buffer[256];
|
return {ACK_ERROR_ARG, FmtBuffer<256>("{}: {}", msg, value)};
|
||||||
snprintf(buffer, sizeof(buffer), "%s: %s", msg, value);
|
|
||||||
return {ACK_ERROR_ARG, buffer};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
@ -66,6 +66,7 @@ test(
|
|||||||
include_directories: inc,
|
include_directories: inc,
|
||||||
dependencies: [
|
dependencies: [
|
||||||
gtest_dep,
|
gtest_dep,
|
||||||
|
fmt_dep,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
protocol: 'gtest',
|
protocol: 'gtest',
|
||||||
|
Loading…
Reference in New Issue
Block a user