util.cpp (b7d6a1a70a818783151eaa5092c1e3e2682dfb25) util.cpp (9b2a20d3cfa1131521456b9ebfde7a7bb8b234bb)
1#include "config.h"
2
3#include "util.hpp"
4
5#include "config_parser.hpp"
6#include "types.hpp"
7
8#include <fmt/compile.h>
9#include <fmt/format.h>
10#include <sys/wait.h>
11
12#include <phosphor-logging/elog-errors.hpp>
13#include <phosphor-logging/lg2.hpp>
1#include "config.h"
2
3#include "util.hpp"
4
5#include "config_parser.hpp"
6#include "types.hpp"
7
8#include <fmt/compile.h>
9#include <fmt/format.h>
10#include <sys/wait.h>
11
12#include <phosphor-logging/elog-errors.hpp>
13#include <phosphor-logging/lg2.hpp>
14#include <stdplus/numeric/str.hpp>
14#include <xyz/openbmc_project/Common/error.hpp>
15
16#include <cctype>
17#include <string>
18#include <string_view>
19
20namespace phosphor
21{

--- 107 unchanged lines hidden (view full) ---

129 if (!intf.starts_with(pfx))
130 {
131 return std::nullopt;
132 }
133 intf.remove_prefix(pfx.size());
134 unsigned idx;
135 try
136 {
15#include <xyz/openbmc_project/Common/error.hpp>
16
17#include <cctype>
18#include <string>
19#include <string_view>
20
21namespace phosphor
22{

--- 107 unchanged lines hidden (view full) ---

130 if (!intf.starts_with(pfx))
131 {
132 return std::nullopt;
133 }
134 intf.remove_prefix(pfx.size());
135 unsigned idx;
136 try
137 {
137 idx = DecodeInt<unsigned, 10>{}(intf);
138 idx = stdplus::StrToInt<10, unsigned>{}(intf);
138 }
139 catch (...)
140 {
141 return std::nullopt;
142 }
143 if (idx == 0)
144 {
145 return "ethaddr";

--- 75 unchanged lines hidden ---
139 }
140 catch (...)
141 {
142 return std::nullopt;
143 }
144 if (idx == 0)
145 {
146 return "ethaddr";

--- 75 unchanged lines hidden ---